index.vue 142 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881
  1. <template>
  2. <div class="app-container">
  3. <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
  4. <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
  5. <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
  6. </div>
  7. <el-tabs v-model="tabName" @tab-click="handleTabClick">
  8. <el-tab-pane v-if="isBasic" label="设备基础信息" name="first">
  9. <div class="filter-container">
  10. <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 120px;" @change="changePastureName">
  11. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  12. </el-select>
  13. <tree-select
  14. v-model="getdataListParm.parammaps.eqClassId"
  15. :height="150"
  16. :width="250"
  17. class="typeSelect"
  18. size="small"
  19. :data="parentClass"
  20. :default-props="defaultProps"
  21. :node-key="nodeKey"
  22. clearable
  23. :disabled="disabled"
  24. :placeholder="placeholder"
  25. :checked-keys="defaultCheckedKeys"
  26. style="display: inline-block;"
  27. @popoverHide="popoverHide"
  28. />
  29. <el-input v-model="getdataListParm.parammaps.eqName" placeholder="设备名称" clearable style="width: 120px;" class="filter-item" />
  30. <el-input v-model="getdataListParm.parammaps.eqCode" placeholder="设备内部编号" clearable style="width: 150px;" class="filter-item" />
  31. <!-- <el-input v-model="getdataListParm.parammaps.financeCode" placeholder="财务编号" clearable style="width: 120px;" class="filter-item" /> -->
  32. <el-select v-model="getdataListParm.parammaps.departmentId" clearable placeholder="部门" class="filter-item" style="width: 120px;">
  33. <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.id" />
  34. </el-select>
  35. <el-select v-model="getdataListParm.parammaps.status" clearable placeholder="状态" class="filter-item" style="width: 120px;">
  36. <el-option v-for="item in getDictByName" :key="item.id" :label="item.label" :value="item.id" />
  37. </el-select>
  38. <el-select v-model="getdataListParm.parammaps.warning" clearable placeholder="折旧预警" class="filter-item" style="width: 120px;">
  39. <el-option v-for="item in depreciationAlertList" :key="item.id" :label="item.name" :value="item.id" />
  40. </el-select>
  41. <!-- <el-date-picker ref="inputDatetime1" v-model="getdataListParm.parammaps.inputDatetime1" class="inputDatetime" type="daterange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="审批日期" end-placeholder="审批日期" /> -->
  42. <el-date-picker ref="inputDatetime2" v-model="getdataListParm.parammaps.inputDatetime2" class="inputDatetime" type="daterange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="购置日期" end-placeholder="购置日期" />
  43. <!-- <el-date-picker ref="inputDatetime3" v-model="getdataListParm.parammaps.inputDatetime3" class="inputDatetime" type="daterange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="报废日期" end-placeholder="报废日期" /> -->
  44. <el-input v-model="getdataListParm.parammaps.assetCode" placeholder="资产编号" clearable style="width: 120px;" class="filter-item" />
  45. <el-input v-model="getdataListParm.parammaps.brand" placeholder="品牌" clearable style="width: 120px;" class="filter-item" />
  46. <el-input v-model="getdataListParm.parammaps.proName" placeholder="供应商" clearable style="width: 120px;" class="filter-item" />
  47. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  48. <div>
  49. <el-button v-if="isBasicsAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
  50. <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
  51. <el-button v-waves class="filter-item" type="warning" icon="el-icon-upload2">导入</el-button>
  52. </el-upload>
  53. <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
  54. <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="handleBatchChange">批量变更</el-button>
  55. </div>
  56. <el-table
  57. :key="tableKey"
  58. v-loading="listLoading"
  59. element-loading-text="给我一点时间"
  60. :data="list"
  61. border
  62. fit
  63. highlight-current-row
  64. style="width: 100%;"
  65. :row-style="rowStyle"
  66. :cell-style="cellStyle"
  67. class="elTable"
  68. @selection-change="handleSelectionChange"
  69. @sort-change="tableSort2"
  70. >
  71. <el-table-column type="selection" width="55" />
  72. <el-table-column label="序号" align="center" type="index" width="50px">
  73. <template slot-scope="scope">
  74. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="牧场" align="center" prop="pastureName" />
  78. <el-table-column label="设备类别" align="center" prop="eqClassName" />
  79. <el-table-column label="设备名称" align="center" prop="eqName" />
  80. <el-table-column label="设备内部编号" align="center" prop="eqCode" />
  81. <!-- <el-table-column label="财务编号" align="center" prop="financeCode" /> -->
  82. <el-table-column label="规格" align="center" prop="specification" />
  83. <el-table-column label="品牌" align="center" prop="brandName" />
  84. <el-table-column label="状态" align="center" prop="status">
  85. <template slot-scope="{row}">
  86. <div v-if="row.status == '正常'">
  87. <div v-if="row.warning == 1" style="background:#EC808D;display:block;line-height: 50px;">{{ row.status }}</div>
  88. <div v-else-if="row.warning == 2" style="background:#FACD91;display:block;line-height: 50px;">{{ row.status }}</div>
  89. <div v-else>{{ row.status }}</div>
  90. </div>
  91. <div v-else>
  92. <div style="background:#D7D7D7;display:block;line-height: 50px;">{{ row.status }}</div>
  93. </div>
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="部门" align="center" prop="deptName" />
  97. <el-table-column label="责任人" align="center" prop="employeName" />
  98. <el-table-column label="审批日期" sortable align="center" prop="spDate" />
  99. <el-table-column label="购置日期" sortable align="center" prop="purchaseDate" />
  100. <el-table-column label="入场日期" sortable align="center" prop="entranceDate" />
  101. <el-table-column label="报废日期" sortable align="center" prop="bfDate" />
  102. <el-table-column label="设备图片" prop="picpath" align="center" min-width="110px">
  103. <template slot-scope="scope">
  104. <el-popover placement="right" title="" trigger="hover">
  105. <img v-if="scope.row.picpath !== '' && scope.row.srcpath !== ''" :src="scope.row.picpath">
  106. <img v-if="scope.row.picpath !== '' && scope.row.srcpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  107. </el-popover>
  108. </template>
  109. </el-table-column>
  110. <el-table-column label="折旧年限" sortable align="center" prop="depreciation" />
  111. <el-table-column label="使用时长(年)" sortable align="center" prop="serviceDuration" />
  112. <el-table-column label="使用率(%)" sortable align="center" prop="utilizationRate" />
  113. <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
  114. <template slot-scope="{row}">
  115. <el-button v-if="isBasicsCard" type="primary" size="mini" @click="form_see(row)">查看</el-button>
  116. <el-button type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  117. <el-button v-if="isBasicsDel2" style="display:inline-block" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  118. <el-button v-else style="display:none" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  119. </template>
  120. </el-table-column>
  121. </el-table>
  122. <pagination v-show="total>=0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="getList" />
  123. </div>
  124. </el-tab-pane>
  125. <el-tab-pane v-if="isBasicSH" label="审核设备" name="second">
  126. <div class="filter-container">
  127. <el-select v-model="getdataListParmSH.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 120px;">
  128. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  129. </el-select>
  130. <el-input v-model="getdataListParmSH.parammaps.assetCode" placeholder="资产编号" clearable style="width: 180px;" class="filter-item" />
  131. <el-input v-model="getdataListParmSH.parammaps.eqName" placeholder="设备名称" clearable style="width: 120px;" class="filter-item" />
  132. <el-input v-model="getdataListParmSH.parammaps.eqCode" placeholder="设备内部编号" clearable style="width: 150px;" class="filter-item" />
  133. <el-input v-model="getdataListParmSH.parammaps.financeCode" placeholder="财务编码" clearable style="width: 120px;" class="filter-item" />
  134. <el-select v-model="getdataListParmSH.parammaps.departmentId" clearable placeholder="部门" class="filter-item" style="width: 120px;">
  135. <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.id" />
  136. </el-select>
  137. <el-select v-model="getdataListParmSH.parammaps.status" clearable placeholder="状态" class="filter-item" style="width: 120px;">
  138. <el-option v-for="item in getDictByName" :key="item.id" :label="item.label" :value="item.id" />
  139. </el-select>
  140. <el-select v-model="getdataListParmSH.parammaps.SHStatus" clearable placeholder="审核状态" class="filter-item" style="width: 120px;">
  141. <el-option v-for="item in statues" :key="item.id" :label="item.name" :value="item.id" />
  142. </el-select>
  143. <el-date-picker ref="inputDatetime1" v-model="getdataListParmSH.parammaps.inputDatetime1" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  144. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_searchSH">搜索</el-button>
  145. <div>
  146. <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownloadSH">导出</el-button>
  147. </div>
  148. <el-table
  149. :key="tableKey"
  150. v-loading="listLoadingSH"
  151. element-loading-text="给我一点时间"
  152. :data="listSH"
  153. border
  154. fit
  155. highlight-current-row
  156. style="width: 100%;"
  157. :row-style="rowStyle"
  158. :cell-style="cellStyle"
  159. class="elTable"
  160. >
  161. <el-table-column label="序号" align="center" type="index" width="50px">
  162. <template slot-scope="scope">
  163. <span>{{ scope.$index + (pageNumSH-1) * pageSizeSH + 1 }}</span>
  164. </template>
  165. </el-table-column>
  166. <el-table-column label="牧场" align="center" prop="pastureName" />
  167. <el-table-column label="资产编号" align="center" prop="assetCode" />
  168. <el-table-column label="设备名称" align="center" prop="eqName" />
  169. <el-table-column label="设备内部编号" align="center" prop="eqCode" />
  170. <el-table-column label="财务编号" align="center" prop="financeCode" />
  171. <el-table-column label="规格" align="center" prop="specification" />
  172. <el-table-column label="品牌" align="center" prop="brandName" />
  173. <el-table-column label="状态" align="center" prop="status" />
  174. <el-table-column label="部门" align="center" prop="deptName" />
  175. <el-table-column label="责任人" align="center" prop="employeName" />
  176. <el-table-column label="录入日期" sortable align="center" prop="lrTime" />
  177. <el-table-column label="审核状态" min-width="110px" align="center" :formatter="SHStatus" />
  178. <el-table-column label="设备图片" prop="specifications" align="center" min-width="110px">
  179. <template slot-scope="scope">
  180. <el-popover placement="right" title="" trigger="hover">
  181. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  182. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  183. </el-popover>
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
  187. <template slot-scope="{row}">
  188. <el-button v-if="isBasicsCard" type="primary" size="mini" @click="form_see(row)">查看</el-button>
  189. <el-button v-if="isBasicsUpdate && row.SHStatus == 2" style="display:inline-block" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  190. <el-button v-else style="display:none" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  191. <el-button v-if="isBasicExamine && row.SHStatus == 0" style="display:inline-block" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
  192. <el-button v-else style="display:none" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
  193. <el-button v-if="isBasicsDel && row.SHStatus == 2" style="display:inline-block" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  194. <el-button v-else style="display:none" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  195. </template>
  196. </el-table-column>
  197. </el-table>
  198. <pagination v-show="totalSH>=0" :total="totalSH" :page.sync="getdataListParmSH.offset" :limit.sync="getdataListParmSH.pagecount" @pagination="getListSH" />
  199. </div>
  200. </el-tab-pane>
  201. </el-tabs>
  202. <!-- 新增 -->
  203. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" v-show = "dialogFormVisible" :close-on-click-modal="false" width="90%">
  204. <div class="app-add">
  205. <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="115px" style="width: 90%;margin:0 auto 30px">
  206. <el-row>
  207. <el-col :span="10">
  208. <el-form-item label="设备类别:" prop="eqClassId">
  209. <tree-select
  210. v-model="createTemp.eqClassId"
  211. :height="200"
  212. :width="300"
  213. size="small"
  214. :data="parentClass"
  215. :default-props="defaultProps"
  216. :node-key="nodeKey"
  217. :disabled="disabled"
  218. :placeholder="placeholder"
  219. :checked-keys="defaultCheckedKeys"
  220. @popoverHide="popoverHide"
  221. />
  222. </el-form-item>
  223. </el-col>
  224. </el-row>
  225. <el-row>
  226. <el-col :span="6">
  227. <el-form-item label="资产编号:" prop="assetCode">
  228. <el-input ref="assetCode" v-model="createTemp.assetCode" placeholder="请输入编号" disabled />
  229. </el-form-item>
  230. </el-col>
  231. <el-col :span="6">
  232. <el-form-item label="设备名称:" prop="eqName">
  233. <el-input ref="eqName" v-model="createTemp.eqName" placeholder="请输入设备名称" disabled/>
  234. </el-form-item>
  235. </el-col>
  236. <el-col :span="6">
  237. <el-form-item label="设备内部编号:" prop="eqCode">
  238. <el-input ref="eqCode" v-model="createTemp.eqCode" placeholder="请输入设备内部编号" />
  239. </el-form-item>
  240. </el-col>
  241. <el-col :span="6">
  242. <el-form-item label="财务编号:" prop="financeCode">
  243. <el-input ref="financeCode" v-model="createTemp.financeCode" placeholder="请输入财务编号" />
  244. </el-form-item>
  245. </el-col>
  246. </el-row>
  247. <el-row>
  248. <el-col :span="6">
  249. <el-form-item label="设备规格:" prop="specification">
  250. <el-input ref="specification" v-model="createTemp.specification" placeholder="请输入设备规格" />
  251. </el-form-item>
  252. </el-col>
  253. <el-col :span="6">
  254. <el-form-item label="品牌:" prop="brandName">
  255. <el-autocomplete v-model="createTemp.brandName" value-key="brandName" class="inline-input" :fetch-suggestions="brandSearch" placeholder="请输入品牌" style="width:100%;" @select="(value)=> {handleSelectBrand(value)}" />
  256. </el-form-item>
  257. </el-col>
  258. <el-col :span="6">
  259. <el-form-item label="供应商:" prop="providerId">
  260. <el-select v-model="createTemp.providerId" filterable placeholder="请选择供应商" style="width:100%">
  261. <el-option v-for="item in findAllProvider" :key="item.id" clearable :label="item.name" :value="item.id" />
  262. </el-select>
  263. </el-form-item>
  264. </el-col>
  265. <el-col :span="6">
  266. <el-form-item label="用途:" prop="purpose">
  267. <el-input ref="purpose" v-model="createTemp.purpose" placeholder="请输入用途" />
  268. </el-form-item>
  269. </el-col>
  270. </el-row>
  271. <el-row>
  272. <el-col :span="6">
  273. <el-form-item label="状态:" prop="status">
  274. <el-select v-model="createTemp.status" placeholder="状态" class="filter-item">
  275. <el-option v-for="item in getDictByName" :key="item.id" :label="item.label" :value="item.id" />
  276. </el-select>
  277. </el-form-item>
  278. </el-col>
  279. <el-col :span="6">
  280. <el-form-item label="购置日期:" prop="purchaseDate">
  281. <el-date-picker v-model="createTemp.purchaseDate" type="date" placeholder="选择日期" style="width:170px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
  282. </el-form-item>
  283. </el-col>
  284. <el-col :span="6">
  285. <el-form-item label="入场日期:" prop="entranceDate">
  286. <el-date-picker v-model="createTemp.entranceDate" type="date" placeholder="选择日期" style="width:170px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
  287. </el-form-item>
  288. </el-col>
  289. <el-col :span="6">
  290. <el-form-item label="折旧年限:" prop="depreciation">
  291. <el-input ref="depreciation" v-model="createTemp.depreciation" placeholder="请输入折旧年限" />
  292. </el-form-item>
  293. </el-col>
  294. </el-row>
  295. <el-row>
  296. <el-col :span="6">
  297. <el-form-item label="原值:" prop="yuanzhi">
  298. <el-input ref="yuanzhi" v-model="createTemp.yuanzhi" placeholder="请输入原值" />
  299. </el-form-item>
  300. </el-col>
  301. <el-col :span="6">
  302. <el-form-item label="残值:" prop="salvage">
  303. <el-input ref="salvage" v-model="createTemp.salvage" placeholder="请输入残值" />
  304. </el-form-item>
  305. </el-col>
  306. <el-col :span="6">
  307. <el-form-item label="月核减值:" prop="subtractvalue">
  308. <el-input ref="subtractvalue" v-model="createTemp.subtractvalue" placeholder="请输入月核减值" />
  309. </el-form-item>
  310. </el-col>
  311. <el-col :span="6">
  312. <el-form-item label="保养级别:" prop="upkeepgrade">
  313. <el-select ref="upkeepgrade" v-model="createTemp.upkeepgrade" placeholder="保养级别" class="filter-item" @visible-change="upkeepgradeChange" @change="changeUpkeepgrade">
  314. <el-option v-for="item in upkeepgrades" :key="item.id" :label="item.label" :value="item.id" />
  315. </el-select>
  316. </el-form-item>
  317. </el-col>
  318. </el-row>
  319. <el-row>
  320. <el-col :span="6">
  321. <el-form-item label="保养费用:" prop="yearUpkeepCost">
  322. <el-input ref="yearUpkeepCost" v-model="createTemp.yearUpkeepCost" placeholder="请输入近一年保养费用" />
  323. </el-form-item>
  324. </el-col>
  325. <el-col :span="6">
  326. <el-form-item label="维修费用:" prop="yearMaintainCost">
  327. <el-input ref="yearMaintainCost" v-model="createTemp.yearMaintainCost" placeholder="请输入近一年维修费用" />
  328. </el-form-item>
  329. </el-col>
  330. <el-col :span="6">
  331. <el-form-item label="基数(小时):" prop="baseHours">
  332. <el-input ref="baseHours" v-model="createTemp.baseHours" placeholder="请输入基数" />
  333. </el-form-item>
  334. </el-col>
  335. <el-col :span="6">
  336. <el-form-item label="牧场:" prop="pastureId">
  337. <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" @change="changePasture">
  338. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  339. </el-select>
  340. </el-form-item>
  341. </el-col>
  342. </el-row>
  343. <el-row>
  344. <el-col :span="6">
  345. <el-form-item label="部门:" prop="deptId">
  346. <el-select v-model="createTemp.deptId" :disabled="disabled" placeholder="部门" class="filter-item" style="width: 100%;" @change="changeDepart">
  347. <el-option v-for="item in createDepartList" :key="item.id" :label="item.name" :value="item.id" />
  348. </el-select>
  349. </el-form-item>
  350. </el-col>
  351. <el-col :span="6">
  352. <el-form-item label="责任人:" prop="employeName">
  353. <el-autocomplete v-model="createTemp.employeName" value-key="empname" class="inline-input" :fetch-suggestions="employeSearch" placeholder="请输入责任人" style="width:100%;" @select="handleSelectEmploye">
  354. <template slot-scope="{ item }">
  355. <div class="name" style="display: inline;">{{ item.name }}</div>
  356. </template>
  357. </el-autocomplete>
  358. </el-form-item>
  359. </el-col>
  360. <el-col :span="6">
  361. <el-form-item label="录入人:" prop="inputUser">
  362. <el-select v-model="createTemp.inputUser" placeholder="录入人" class="filter-item">
  363. <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
  364. </el-select>
  365. </el-form-item>
  366. </el-col>
  367. <el-col :span="6">
  368. <el-form-item label="录入时间:" prop="inputDatetime">
  369. <el-date-picker v-model="createTemp.inputDatetime" :picker-options="pickerOptions1" type="date" placeholder="录入时间" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:170px;" />
  370. </el-form-item>
  371. </el-col>
  372. </el-row>
  373. <el-row>
  374. <el-col :span="6">
  375. <el-form-item label="设备图片:">
  376. <el-upload
  377. id="uploadPic"
  378. ref="upload"
  379. :limit="1"
  380. list-type="picture-card"
  381. :file-list="createTemp.fileList"
  382. :headers="headers"
  383. :action="uploadImageUrl"
  384. :auto-upload="true"
  385. :on-preview="handlePicPreview"
  386. :before-remove="beforeRemove"
  387. :class="{hide:showUpload}"
  388. :on-change="(file,fileList)=>{ return handlePicChange(file, fileList) }"
  389. :on-success="(response,file, fileList)=>{ return handlePicSuccess(response,file, fileList) }"
  390. :on-remove="(file, fileList)=>{ return handlePicRemove(file, fileList) }"
  391. >
  392. <i class="el-icon-plus" />
  393. </el-upload>
  394. <el-dialog :visible.sync="dialogVisible" append-to-body :width="width">
  395. <img :src="dialogImageUrl" alt="" @load="onLoad">
  396. </el-dialog>
  397. </el-form-item>
  398. </el-col>
  399. </el-row>
  400. </el-form>
  401. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:5px">
  402. <el-button v-if="dialogStatus==='create'" ref="createb" type="success" :disabled="isokDisable" @click="add_dialog_save_again()">保存并新增</el-button>
  403. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
  404. <el-button @click="dialogFormVisible = false; getdataListParm.parammaps.inputDatetime = ''">取消并关闭</el-button>
  405. </div>
  406. </div>
  407. </el-dialog>
  408. <!-- 查看 -->
  409. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_See" :close-on-click-modal="false" width="90%">
  410. <div class="app-contentcard">
  411. <div style="position: absolute;top:20px;left:150px;font:18px/24px '' ;color:#303133;">
  412. <span style="margin:0 10px;">设备名称:{{ seeTemp.eqName }}</span>
  413. <span>内部编号:{{ seeTemp.eqCode }}</span>
  414. </div>
  415. <div class="card">
  416. <el-tabs v-model="activeName" @tab-click="form_seeTabClick">
  417. <el-tab-pane label="基础信息" name="first">
  418. <el-form ref="seeTemp" :rules="rules" :model="seeTemp" label-position="right" label-width="115px" style="width: 100%;margin-bottom:30px">
  419. <el-row>
  420. <el-form-item label="设备类别:" prop="eqClassName">
  421. <el-input ref="eqClassName" v-model="seeTemp.eqClassName" placeholder="请输入设备类别" disabled />
  422. </el-form-item>
  423. </el-row>
  424. <el-row>
  425. <el-col :span="6">
  426. <el-form-item label="资产编号:" prop="assetCode">
  427. <el-input ref="assetCode" v-model="seeTemp.assetCode" placeholder="请输入资产编号" disabled />
  428. </el-form-item>
  429. </el-col>
  430. <el-col :span="6">
  431. <el-form-item label="设备名称:" prop="eqName">
  432. <el-input ref="eqName" v-model="seeTemp.eqName" placeholder="请输入设备名称" disabled />
  433. </el-form-item>
  434. </el-col>
  435. <el-col :span="6">
  436. <el-form-item label="设备内部编号:" prop="eqCode">
  437. <el-input ref="eqCode" v-model="seeTemp.eqCode" placeholder="请输入设备内部编号" disabled />
  438. </el-form-item>
  439. </el-col>
  440. <el-col :span="6">
  441. <el-form-item label="财务编号:" prop="financeCode">
  442. <el-input ref="financeCode" v-model="seeTemp.financeCode" placeholder="请输入财务编号" disabled />
  443. </el-form-item>
  444. </el-col>
  445. </el-row>
  446. <el-row>
  447. <el-col :span="6">
  448. <el-form-item label="设备规格:" prop="specification">
  449. <el-input ref="specification" v-model="seeTemp.specification" placeholder="请输入设备规格" disabled />
  450. </el-form-item>
  451. </el-col>
  452. <el-col :span="6">
  453. <el-form-item label="品牌:" prop="brandName">
  454. <el-input ref="brandName" v-model="seeTemp.brandName" placeholder="请输入品牌" disabled />
  455. </el-form-item>
  456. </el-col>
  457. <el-col :span="6">
  458. <el-form-item label="供应商:" prop="providerName">
  459. <el-input ref="providerName" v-model="seeTemp.providerName" placeholder="请输入供应商" disabled />
  460. </el-form-item>
  461. </el-col>
  462. <el-col :span="6">
  463. <el-form-item label="用途:" prop="purpose">
  464. <el-input ref="purpose" v-model="seeTemp.purpose" placeholder="请输入用途" disabled />
  465. </el-form-item>
  466. </el-col>
  467. </el-row>
  468. <el-row>
  469. <el-col :span="6">
  470. <el-form-item label="状态:" prop="status">
  471. <el-input ref="status" v-model="seeTemp.status" placeholder="请输入状态" disabled />
  472. </el-form-item>
  473. </el-col>
  474. <el-col :span="6">
  475. <el-form-item label="购置日期:" prop="purchaseDate">
  476. <el-input ref="purchaseDate" v-model="seeTemp.purchaseDate" placeholder="请输入购置日期" disabled />
  477. </el-form-item>
  478. </el-col>
  479. <el-col :span="6">
  480. <el-form-item label="入场日期:" prop="entranceDate">
  481. <el-input ref="entranceDate" v-model="seeTemp.entranceDate" placeholder="请输入入场日期" disabled />
  482. </el-form-item>
  483. </el-col>
  484. <el-col :span="6">
  485. <el-form-item label="折旧年限:" prop="depreciation">
  486. <el-input ref="depreciation" v-model="seeTemp.depreciation" placeholder="请输入折旧年限" disabled />
  487. </el-form-item>
  488. </el-col>
  489. </el-row>
  490. <el-row>
  491. <el-col :span="6">
  492. <el-form-item label="原值:" prop="yuanzhi">
  493. <el-input ref="yuanzhi" v-model="seeTemp.yuanzhi" placeholder="请输入原值" disabled />
  494. </el-form-item>
  495. </el-col>
  496. <el-col :span="6">
  497. <el-form-item label="残值:" prop="salvage">
  498. <el-input ref="salvage" v-model="seeTemp.salvage" placeholder="请输入残值" disabled />
  499. </el-form-item>
  500. </el-col>
  501. <el-col :span="6">
  502. <el-form-item label="月核减值:" prop="subtractvalue">
  503. <el-input ref="subtractvalue" v-model="seeTemp.subtractvalue" placeholder="请输入月核减值" disabled />
  504. </el-form-item>
  505. </el-col>
  506. <el-col :span="6">
  507. <el-form-item label="保养级别:" prop="upkeepgrade">
  508. <el-input ref="upkeepgrade" v-model="seeTemp.upkeepgrade" placeholder="请输入保养级别" disabled />
  509. </el-form-item>
  510. </el-col>
  511. </el-row>
  512. <el-row>
  513. <el-col :span="6">
  514. <el-form-item label="保养费用:" prop="yearUpkeepCost">
  515. <el-input ref="yearUpkeepCost" v-model="seeTemp.yearUpkeepCost" placeholder="请输入近一年保养费用" disabled />
  516. </el-form-item>
  517. </el-col>
  518. <el-col :span="6">
  519. <el-form-item label="维修费用:" prop="yearMaintainCost">
  520. <el-input ref="yearMaintainCost" v-model="seeTemp.yearMaintainCost" placeholder="请输入近一年维修费用" disabled />
  521. </el-form-item>
  522. </el-col>
  523. <el-col :span="6">
  524. <el-form-item label="基数(小时):" prop="baseHours">
  525. <el-input ref="baseHours" v-model="seeTemp.baseHours" placeholder="请输入基数" disabled />
  526. </el-form-item>
  527. </el-col>
  528. <el-col :span="6">
  529. <el-form-item label="牧场:" prop="pastureName">
  530. <el-input ref="pastureName" v-model="seeTemp.pastureName" placeholder="请输入牧场" disabled />
  531. </el-form-item>
  532. </el-col>
  533. </el-row>
  534. <el-row>
  535. <el-col :span="6">
  536. <el-form-item label="部门:" prop="deptName">
  537. <el-input ref="deptName" v-model="seeTemp.deptName" placeholder="请输入部门" disabled />
  538. </el-form-item>
  539. </el-col>
  540. <el-col :span="6">
  541. <el-form-item label="责任人:" prop="employeName">
  542. <el-input ref="employeName" v-model="seeTemp.employeName" placeholder="请输入责任人" disabled />
  543. </el-form-item>
  544. </el-col>
  545. <el-col :span="6">
  546. <el-form-item label="录入人:" prop="inputUserName">
  547. <el-input ref="inputUserName" v-model="seeTemp.inputUserName" placeholder="请输入录入人" disabled />
  548. </el-form-item>
  549. </el-col>
  550. <el-col :span="6">
  551. <el-form-item label="录入时间:" prop="inputDatetime">
  552. <el-input ref="inputDatetime" v-model="seeTemp.inputDatetime" placeholder="请输入录入时间" disabled />
  553. </el-form-item>
  554. </el-col>
  555. </el-row>
  556. <el-row>
  557. <el-col>
  558. <el-form-item label="设备图片:">
  559. <el-popover placement="right" title="" trigger="hover">
  560. <img v-if="seeTemp.picpath !== '' && seeTemp.srcpath !== ''" :src="seeTemp.picpath">
  561. <img v-if="seeTemp.picpath !== '' && seeTemp.srcpath !== ''" slot="reference" :src="seeTemp.picpath" :alt="seeTemp.srcpath" style="height: 100px;width:100px;">
  562. </el-popover>
  563. </el-form-item>
  564. </el-col>
  565. </el-row>
  566. <div v-if="isFlowChart">
  567. <el-row>
  568. <el-col>
  569. <el-form-item label="流程进度" />
  570. <el-steps :active="active" align-center finish-status="success">
  571. <el-step
  572. v-for="(item,index) in activeList"
  573. :key="index"
  574. :title="item.title"
  575. :status="item.status"
  576. >
  577. <template slot="description">
  578. <div class="step-row">
  579. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  580. <div>{{ item.reason }}</div>
  581. </div>
  582. </template>
  583. </el-step>
  584. </el-steps>
  585. </el-col>
  586. </el-row>
  587. <el-row>
  588. <el-col>
  589. <el-form-item label="操作:">
  590. <el-button v-if="isBasicExamine && seeTemp.SHStatus == 0" type="success" style="display:inline-block" @click="handleExamine()">审核</el-button>
  591. <el-button v-else type="success" style="display:none" @click="handleExamine()">审核</el-button>
  592. </el-form-item>
  593. </el-col>
  594. </el-row>
  595. </div>
  596. </el-form>
  597. </el-tab-pane>
  598. <el-tab-pane v-if="isDisplayRecord" label="点检记录" name="second">
  599. <el-date-picker ref="inputDatetimeCheck1" v-model="getAssetBigSpotCheckListParm.parammaps.inputDatetimeSpotCheck1" class="inputDatetime" type="datetimerange" style="width: 250px;margin-bottom:10px" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  600. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_searchSportCheck">搜索</el-button>
  601. <el-table
  602. :key="tableKey"
  603. v-loading="listLoadingSpotCheck1"
  604. element-loading-text="给我一点时间"
  605. :data="listSpotCheck1"
  606. border
  607. fit
  608. highlight-current-row
  609. style="width: 100%;"
  610. :row-style="rowStyle"
  611. :cell-style="cellStyle"
  612. class="elTable"
  613. >
  614. <el-table-column label="序号" align="center" type="index" width="50px">
  615. <template slot-scope="scope">
  616. <span>{{ scope.$index + (pageNumSpotCheck1-1) * pageSizeSpotCheck1 + 1 }}</span>
  617. </template>
  618. </el-table-column>
  619. <el-table-column label="点检结果" sortable prop="inspectionResults" min-width="110px" align="center" />
  620. <el-table-column label="点检日期" sortable prop="date" min-width="110px" align="center" />
  621. <el-table-column label="点检人" sortable prop="empname" min-width="110px" align="center" />
  622. </el-table>
  623. <pagination v-show="total>=0" :total="totalSpotCheck1" :page.sync="getAssetBigSpotCheckListParm.offset" :limit.sync="getAssetBigSpotCheckListParm.pagecount" @pagination="getAssetBigSpotCheckList" />
  624. </el-tab-pane>
  625. <el-tab-pane v-if="isDisplayRecord" label="保养记录" name="third">
  626. <el-input v-model="getBigupkeepbyeqParm.parammaps.upkeepCode" placeholder="保养单号" style="width: 140px;" class="filter-item" />
  627. <el-select v-model="getBigupkeepbyeqParm.parammaps.upkeepType" clearable placeholder="保养类型" class="filter-item" style="width: 120px;">
  628. <el-option v-for="item in maintainTypes" :key="item.id" :label="item.name" :value="item.name" />
  629. </el-select>
  630. <el-date-picker ref="inputDatetimeUpkeepbyeq" v-model="getBigupkeepbyeqParm.parammaps.inputDatetimeUpkeepbyeq" class="inputDatetime" type="datetimerange" style="width: 250px;margin-bottom:10px" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  631. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_searchUpkeepbyeq">搜索</el-button>
  632. <el-table
  633. :key="tableKey"
  634. v-loading="listLoadingUpkeepbyeq"
  635. element-loading-text="给我一点时间"
  636. :data="listUpkeepbyeq"
  637. border
  638. fit
  639. highlight-current-row
  640. style="width: 100%;"
  641. :row-style="rowStyle"
  642. :cell-style="cellStyle"
  643. class="elTable"
  644. @sort-change="tableSort"
  645. >
  646. <el-table-column label="序号" align="center" type="index" width="50px">
  647. <template slot-scope="scope">
  648. <span>{{ scope.$index + (pageNumUpkeepbyeq-1) * pageSizeUpkeepbyeq + 1 }}</span>
  649. </template>
  650. </el-table-column>
  651. <el-table-column label="保养单号" prop="upkeepCode" min-width="110px" align="center" />
  652. <el-table-column label="保养日期" sortable prop="plantime" min-width="110px" align="center" />
  653. <el-table-column label="保养名称" prop="upkeepName" min-width="110px" align="center" />
  654. <el-table-column label="保养类型" prop="upkeepType" min-width="110px" align="center" />
  655. <el-table-column label="保养级别" prop="upkeepLevel" min-width="110px" align="center" />
  656. <el-table-column label="保养人" prop="upkeepPerson" min-width="110px" align="center" />
  657. <el-table-column label="保养费用" prop="upkeepCost" min-width="110px" align="center" />
  658. </el-table>
  659. <pagination v-show="total>=0" :total="totalUpkeepbyeq" :page.sync="getBigupkeepbyeqParm.offset" :limit.sync="getBigupkeepbyeqParm.pagecount" @pagination="getBigupkeepbyeqList" />
  660. </el-tab-pane>
  661. <el-tab-pane v-if="isDisplayRecord" label="维修记录" name="fouth">
  662. <el-input v-model="getAssetMaintainParm.parammaps.repairCode" placeholder="维修单号" style="width: 140px;" class="filter-item" />
  663. <el-date-picker ref="inputDatetimeAssetMaintain" v-model="getAssetMaintainParm.parammaps.inputDatetimeAssetMaintain" class="inputDatetime" type="datetimerange" style="width: 250px;margin-bottom:10px" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  664. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_searchAssetMaintain">搜索</el-button>
  665. <el-table
  666. :key="tableKey"
  667. v-loading="listLoadingAssetMaintain"
  668. element-loading-text="给我一点时间"
  669. :data="listAssetMaintain"
  670. border
  671. fit
  672. highlight-current-row
  673. style="width: 100%;"
  674. :row-style="rowStyle"
  675. :cell-style="cellStyle"
  676. class="elTable"
  677. @sort-change="tableSort"
  678. >
  679. <el-table-column label="序号" align="center" type="index" width="50px">
  680. <template slot-scope="scope">
  681. <span>{{ scope.$index + (pageNumAssetMaintain-1) * pageSizeAssetMaintain + 1 }}</span>
  682. </template>
  683. </el-table-column>
  684. <el-table-column label="维修单号" prop="repairCode" min-width="110px" align="center" />
  685. <el-table-column label="报修人" prop="requestName" min-width="110px" align="center" />
  686. <el-table-column label="报修时间" sortable prop="requestTime" min-width="110px" align="center" />
  687. <el-table-column label="维修人" prop="empname" min-width="110px" align="center" />
  688. <el-table-column label="维修时间" sortable prop="stopTime" min-width="110px" align="center" />
  689. <el-table-column label="诊断故障" prop="details" min-width="110px" align="center" />
  690. <el-table-column label="维修费用" sortable prop="maintenanceCost" min-width="110px" align="center" />
  691. </el-table>
  692. <pagination v-show="total>=0" :total="totalAssetMaintain" :page.sync="getAssetMaintainParm.offset" :limit.sync="getAssetMaintainParm.pagecount" @pagination="getAssetMaintainList" />
  693. </el-tab-pane>
  694. <el-tab-pane v-if="isDisplayRecord" label="启停记录" name="fifth">
  695. <div class="filter-container">
  696. <el-date-picker v-model="getAssetSTTParm.parammaps.startTime" type="date" placeholder="开启日期" style="width:170px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
  697. <el-date-picker v-model="getAssetSTTParm.parammaps.stopTime" type="date" placeholder="关闭日期" style="width:170px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
  698. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_searchAssetSTT">搜索</el-button>
  699. </div>
  700. <el-table
  701. :key="tableKey"
  702. v-loading="listLoadingAssetSTT"
  703. element-loading-text="给我一点时间"
  704. :data="listAssetSTT"
  705. border
  706. fit
  707. highlight-current-row
  708. style="width: 100%;"
  709. :row-style="rowStyle"
  710. :cell-style="cellStyle"
  711. class="elTable"
  712. >
  713. <el-table-column label="序号" align="center" type="index" width="50">
  714. <template slot-scope="scope">
  715. <span>{{ scope.$index + (pageNumAssetSTT-1) * pageSizeAssetSTT + 1 }}</span>
  716. </template>
  717. </el-table-column>
  718. <el-table-column label="开启时间" sortable prop="enabledTime" min-width="110px" align="center" />
  719. <el-table-column label="关闭时间" sortable prop="blockTime" min-width="110px" align="center" />
  720. <el-table-column label="运行时间(分钟)" sortable prop="runTime" min-width="110px" align="center" />
  721. <el-table-column label="关闭人" prop="blockName" min-width="110px" align="center" />
  722. </el-table>
  723. <pagination v-show="total>=0" :total="totalAssetSTT" :page.sync="getAssetSTTParm.offset" :limit.sync="getAssetSTTParm.pagecount" @pagination="getAssetSTTList" />
  724. </el-tab-pane>
  725. <el-tab-pane v-if="isDisplayRecord" label="变更记录" name="sixth">
  726. <div class="filter-container">
  727. <el-select v-model="getAssetChangeParm.parammaps.changeStatue" clearable placeholder="变更状态" class="filter-item" style="width: 120px;">
  728. <el-option v-for="item in changeStates" :key="item.id" :label="item.name" :value="item.id" />
  729. </el-select>
  730. <el-date-picker ref="inputDatetimeAssetChange" v-model="getAssetChangeParm.parammaps.inputDatetimeAssetChange" class="inputDatetime" type="datetimerange" style="width: 250px;margin-bottom:10px" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  731. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_searchAssetChange">搜索</el-button>
  732. </div>
  733. <el-table
  734. :key="tableKey"
  735. v-loading="listLoadingAssetChange"
  736. element-loading-text="给我一点时间"
  737. :data="listAssetChange"
  738. border
  739. fit
  740. highlight-current-row
  741. style="width: 100%;"
  742. :row-style="rowStyle"
  743. :cell-style="cellStyle"
  744. class="elTable"
  745. >
  746. <el-table-column label="序号" align="center" type="index" width="50px">
  747. <template slot-scope="scope">
  748. <span>{{ scope.$index + (pageNumAssetChange-1) * pageSizeAssetChange + 1 }}</span>
  749. </template>
  750. </el-table-column>
  751. <el-table-column label="变更时间" sortable prop="changeTime" min-width="110px" align="center" />
  752. <el-table-column label="变更状态" :formatter="changeStatue" prop="blockTime" min-width="110px" align="center" />
  753. <el-table-column label="变更人" prop="changeName" min-width="110px" align="center" />
  754. </el-table>
  755. <pagination v-show="total>=0" :total="totalAssetChange" :page.sync="getAssetChangeParm.offset" :limit.sync="getAssetChangeParm.pagecount" @pagination="getAssetChangeList" />
  756. </el-tab-pane>
  757. <el-tab-pane v-if="isDisplayRecord" label="备件领用记录" name="seventh">
  758. <el-input v-model="getAssetPartApplyParm.parammaps.useCode" placeholder="出库单号" style="width: 140px;" class="filter-item" />
  759. <el-input v-model="getAssetPartApplyParm.parammaps.partCode" placeholder="备件编号" style="width: 140px;" class="filter-item" />
  760. <el-input v-model="getAssetPartApplyParm.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
  761. <el-date-picker ref="inputDatetimeAssetPartApply" v-model="getAssetPartApplyParm.parammaps.inputDatetimeAssetPartApply" class="inputDatetime" type="datetimerange" style="width: 250px;margin-bottom:10px" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  762. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_searchAssetPartApply">搜索</el-button>
  763. <el-table
  764. :key="tableKey"
  765. v-loading="listLoadingAssetPartApply"
  766. element-loading-text="给我一点时间"
  767. :data="listAssetPartApply"
  768. border
  769. fit
  770. highlight-current-row
  771. style="width: 100%;"
  772. :row-style="rowStyle"
  773. :cell-style="cellStyle"
  774. class="elTable"
  775. @sort-change="tableSort"
  776. >
  777. <el-table-column label="序号" align="center" type="index" width="50px">
  778. <template slot-scope="scope">
  779. <span>{{ scope.$index + (pageNumAssetPartApply-1) * pageSizeAssetPartApply + 1 }}</span>
  780. </template>
  781. </el-table-column>
  782. <el-table-column label="出库单号" prop="useForm" min-width="110px" align="center" />
  783. <el-table-column label="备件编号" sortable prop="partCode" min-width="110px" align="center" />
  784. <el-table-column label="备件名称" prop="partName" min-width="110px" align="center" />
  785. <el-table-column label="备件规格" prop="specification" min-width="110px" align="center" />
  786. <el-table-column label="备件品牌" prop="brandName" min-width="110px" align="center" />
  787. <el-table-column label="计量单位" prop="unit" min-width="110px" align="center" />
  788. <el-table-column label="领用数量" sortable prop="useNumber" min-width="110px" align="center" />
  789. <el-table-column label="实际出库数量" sortable prop="checkoutNumber" min-width="110px" align="center" />
  790. <el-table-column label="单价" sortable prop="price" min-width="110px" align="center" />
  791. <el-table-column label="总价" sortable prop="sumPrice" min-width="110px" align="center" />
  792. <el-table-column label="领用部门" prop="departmentName" min-width="110px" align="center" />
  793. <el-table-column label="领用时间" sortable prop="receiveTime" min-width="110px" align="center" />
  794. <el-table-column label="距离上次时间(天)" sortable prop="dif" min-width="110px" align="center" />
  795. </el-table>
  796. <pagination v-show="total>=0" :total="totalAssetPartApply" :page.sync="getAssetPartApplyParm.offset" :limit.sync="getAssetPartApplyParm.pagecount" @pagination="getAssetPartApplyList" />
  797. </el-tab-pane>
  798. <el-tab-pane v-if="isDisplayRecord" label="费用统计" name="eighth">
  799. <el-row>
  800. <el-col :span="12">
  801. <div v-if="activeName==='eighth'" id="barChart1" style="width: 100%;height:400px;" />
  802. </el-col>
  803. <el-col :span="12">
  804. <div v-if="activeName==='eighth'" id="barChart2" style="width: 100%;height:400px;" />
  805. </el-col>
  806. </el-row>
  807. <el-dialog :title="textMap[dialogStatus]" append-to-body :visible.sync="dialogFormVisible_ChartSee" :close-on-click-modal="false" width="80%">
  808. <div class="app-contentSee">
  809. <div class="filter-container">
  810. <el-select v-model="getChartSeeParm.parammaps.useTypeV" placeholder="类型" clearable class="filter-item" style="width: 120px;">
  811. <el-option v-for="item in useTypes" :key="item.id" :label="item.name" :value="item.name" />
  812. </el-select>
  813. <el-date-picker ref="inputDatetime2" v-model="getChartSeeParm.parammaps.inputDatetime2" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  814. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_searchChartSee">搜索</el-button>
  815. <el-button class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownloadChartSee">导出</el-button>
  816. </div>
  817. <el-table
  818. :key="tableKey"
  819. v-loading="listLoadingChartSee"
  820. element-loading-text="给我一点时间"
  821. :data="listChartSee"
  822. border
  823. fit
  824. highlight-current-row
  825. style="width: 100%;"
  826. :row-style="rowStyle"
  827. :cell-style="cellStyle"
  828. class="elTable"
  829. >
  830. <el-table-column label="序号" align="center" type="index" width="50px">
  831. <template slot-scope="scope">
  832. <span>{{ scope.$index + (pageNumChartSee-1) * pageSizeChartSee + 1 }}</span>
  833. </template>
  834. </el-table-column>
  835. <el-table-column :key="1" label="类型" align="center">
  836. <template slot-scope="scope">
  837. <span>{{ scope.row.useTypeV }}</span>
  838. </template>
  839. </el-table-column>
  840. <el-table-column :key="2" label="单号" width="140px" align="center">
  841. <template slot-scope="scope">
  842. <span>{{ scope.row.RUcode }}</span>
  843. </template>
  844. </el-table-column>
  845. <el-table-column :key="3" label="领用日期" min-width="80px" align="center">
  846. <template slot-scope="scope">
  847. <span>{{ scope.row.creatTime }}</span>
  848. </template>
  849. </el-table-column>
  850. <el-table-column :key="4" label="领用部门" min-width="100px" align="center">
  851. <template slot-scope="scope">
  852. <span>{{ scope.row.departmentName }}</span>
  853. </template>
  854. </el-table-column>
  855. <el-table-column :key="5" label="备件编号" min-width="80px" align="center">
  856. <template slot-scope="scope">
  857. <span>{{ scope.row.partCode }}</span>
  858. </template>
  859. </el-table-column>
  860. <el-table-column :key="6" label="备件名称" min-width="80px" align="center">
  861. <template slot-scope="scope">
  862. <span>{{ scope.row.partName }}</span>
  863. </template>
  864. </el-table-column>
  865. <el-table-column :key="7" label="备件规格" min-width="80px" align="center">
  866. <template slot-scope="scope">
  867. <span>{{ scope.row.specification }}</span>
  868. </template>
  869. </el-table-column>
  870. <el-table-column :key="8" label="备件品牌" min-width="100px" align="center">
  871. <template slot-scope="scope">
  872. <span>{{ scope.row.brandName }}</span>
  873. </template>
  874. </el-table-column>
  875. <el-table-column :key="9" label="计量单位" min-width="80px" align="center">
  876. <template slot-scope="scope">
  877. <span>{{ scope.row.unit }}</span>
  878. </template>
  879. </el-table-column>
  880. <el-table-column :key="10" label="出库数量" min-width="110px" align="center">
  881. <template slot-scope="scope">
  882. <span>{{ scope.row.checkoutNumber }}</span>
  883. </template>
  884. </el-table-column>
  885. <el-table-column :key="11" label="退库数量" min-width="100px" align="center">
  886. <template slot-scope="scope">
  887. <span>{{ scope.row.quitNumber }}</span>
  888. </template>
  889. </el-table-column>
  890. <el-table-column :key="12" label="单价" min-width="110px" align="center">
  891. <template slot-scope="scope">
  892. <span>{{ scope.row.price }}</span>
  893. </template>
  894. </el-table-column>
  895. <el-table-column :key="13" label="总价" min-width="110px" align="center">
  896. <template slot-scope="scope">
  897. <span>{{ scope.row.sumPrice }}</span>
  898. </template>
  899. </el-table-column>
  900. </el-table>
  901. <pagination v-show="totalChartSee>=0" :total="totalChartSee" :page.sync="getChartSeeParm.offset" :limit.sync="getChartSeeParm.pagecount" @pagination="getChartSeeList" />
  902. </div>
  903. </el-dialog>
  904. </el-tab-pane>
  905. </el-tabs>
  906. </div>
  907. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
  908. <el-button @click="dialogFormVisible_See = false">关闭</el-button>
  909. </div>
  910. </div>
  911. </el-dialog>
  912. <!-- 审核 -->
  913. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
  914. <div class="app-examine">
  915. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
  916. <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
  917. <el-row style="width:88%;height:150px;margin:0 auto;">
  918. <el-col :span="20">
  919. <el-form-item>
  920. <el-radio-group v-model="examineTemp.SHstatue" @change="changeSHStatue">
  921. <el-radio :label="1" checked>通过</el-radio>
  922. <el-radio :label="2">不通过</el-radio>
  923. </el-radio-group>
  924. </el-form-item>
  925. </el-col>
  926. <el-col v-if="statueReason" :span="22">
  927. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 3}" placeholder="请输入不通过原因" />
  928. </el-col>
  929. </el-row>
  930. </el-form>
  931. </div>
  932. <div slot="footer" class="dialog-footer">
  933. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='examine'?createExamineData():createExamineData()">确认</el-button>
  934. <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
  935. </div>
  936. </el-dialog>
  937. <!-- 变更 -->
  938. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_change" :close-on-click-modal="false" width="30%">
  939. <div class="app-change">
  940. <el-form ref="batchChangeTemp" :rules="rules" :model="batchChange.temp" label-position="right" label-width="115px" style="width: 90%;margin:0 auto 30px" @click.native.prevent @submit.native.prevent>
  941. <el-row>
  942. <el-col :span="24">
  943. <el-form-item label="变更部门:" prop="departmentId">
  944. <el-select v-model="batchChange.temp.departmentId" placeholder="变更部门" class="filter-item" style="width: 100%;" @change="changeBatchDept">
  945. <el-option v-for="item in batchChange.deptList" :key="item.deptid" :label="item.departmentName" :value="item.deptid" />
  946. </el-select>
  947. </el-form-item>
  948. </el-col>
  949. </el-row>
  950. <el-row>
  951. <el-col :span="24">
  952. <el-form-item label="变更责任人:" prop="employeeId">
  953. <el-select v-model="batchChange.temp.employeeId" placeholder="变更责任人" class="filter-item" style="width: 100%;" @change="changeBatchPerson">
  954. <el-option v-for="item in batchChange.personList" :key="item.id" :label="item.empname" :value="item.id" />
  955. </el-select>
  956. </el-form-item>
  957. </el-col>
  958. </el-row>
  959. </el-form>
  960. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
  961. <el-button type="primary" :disabled="isokDisable" @click="changeData()">保存并关闭</el-button>
  962. <el-button @click="dialogFormVisible_change = false;">取消并关闭</el-button>
  963. </div>
  964. </div>
  965. </el-dialog>
  966. </div>
  967. </template>
  968. <script>
  969. import echarts from 'echarts'
  970. require('echarts/theme/macarons')
  971. // 引入
  972. import { GetDataByName, GetDataByNames, PostDataByName, PostDataByNames, getRecuData, checkButtons, ExecDataByConfig, failproccess, GetAccount, GetReportform } from '@/api/common'
  973. import waves from '@/directive/waves'
  974. import { parseTime, sortChange, json2excel } from '@/utils/index.js'
  975. import Pagination from '@/components/Pagination'
  976. import { MessageBox } from 'element-ui'
  977. import TreeSelect from '@/components/TreeSelect'
  978. import Cookies from 'js-cookie'
  979. import { getToken } from '@/utils/auth'
  980. export default {
  981. inject: ['reload'],
  982. name: 'Basics',
  983. components: { Pagination, TreeSelect },
  984. directives: { waves },
  985. data() {
  986. return {
  987. isBasicsAdd: [], isBasicsCard: [], isBasicsUpdate: [], isBasicsDel: [], isBasicsDel2: [], isBasic: [], isBasicSH: [], isBasicExamine: [],
  988. rules: {
  989. // assetCode: [{ required: true, message: '必填', trigger: 'blur' }],
  990. eqName: [{ required: true, message: '必填', trigger: 'blur' }],
  991. eqCode: [{ required: true, message: '必填', trigger: 'blur' }],
  992. financeCode: [{ required: true, message: '必填', trigger: 'blur' }],
  993. departmentId: [{ required: true, message: '必填', trigger: 'blur' }],
  994. employeeId: [{ required: true, message: '必填', trigger: 'blur' }],
  995. depreciation: [{ type: 'number', required: true, validator: (rule, value, callback) => {
  996. if (!value) {
  997. callback(new Error('不能为空'))
  998. }
  999. setTimeout(() => {
  1000. const re = /^[0-9]*[1-9][0-9]*$/ // /^[0-9]*[1-9][0-9]*$/
  1001. const rsCheck = re.test(value)
  1002. if (!rsCheck) {
  1003. callback(new Error('请输入正整数'))
  1004. } else {
  1005. callback()
  1006. }
  1007. }, 0)
  1008. }, trigger: 'blur' }]
  1009. },
  1010. findAllBrand: [], findAllProvider: [],
  1011. findAllAssetType: [], findAllPasture: [], findAllDepart: [], findAllEmploye: [],
  1012. getDictByName: [], upkeepgrades: [], createDepartList: [],
  1013. statues: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
  1014. depreciationAlertList: [{ id: '0', name: '正常' }, { id: '1', name: '到期预警' }, { id: '2', name: '超期使用' }],
  1015. requestParams: [
  1016. { name: 'findAllBrand', offset: 0, pagecount: 0, params: [] },
  1017. { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
  1018. { name: 'findAlllAssetProvider', offset: 0, pagecount: 0, params: [] },
  1019. { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
  1020. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  1021. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  1022. { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] },
  1023. { name: 'getdictbyname', offset: 0, pagecount: 0, params: ['保养级别'] }
  1024. ],
  1025. getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
  1026. disabled: false, placeholder: '请选择设备类别',
  1027. nodeKey: 'id',
  1028. defaultCheckedKeys: [],
  1029. parentClass: [],
  1030. defaultProps: { children: 'children', label: 'typeName' },
  1031. getRecuListParm: { name: 'getAssetTypeList', idname: 'id', params: [-1] },
  1032. tableKey: 0,
  1033. list: [],
  1034. total: 0,
  1035. listLoading: true,
  1036. getdataListParm: {
  1037. name: 'getAssetList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
  1038. parammaps: {proId:'',brandId:'', assetCode:'',eqCode: '', eqName: '', departmentId: '', pastureId: Cookies.get('pastureid'), pastureName: Cookies.get('pasturename'), status: '', inputDatetime1: '', startTime: '', stopTime: '', inputDatetime2: '', startTime2: '', stopTime2: '', inputDatetime3: '', startTime3: '', stopTime3: '', warning: '', eqClassId: '' }
  1039. },
  1040. listSH: [], totalSH: 0, listLoadingSH: true, tabName: '',
  1041. getdataListParmSH: {
  1042. name: 'getAssetListSH', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
  1043. parammaps: { eqCode: '', eqName: '', pastureName: Cookies.get('pasturename'), status: '', inputDatetime1: '', startTime: '', stopTime: '', SHStatus: '' }
  1044. },
  1045. textMap: { update: '编辑', create: '新增', card: '查看设备信息', examine: '审核', change: '批量变更' },
  1046. dialogFormVisible: false,
  1047. dialogStatus: '',
  1048. pickerOptions1: {
  1049. disabledDate(time) {
  1050. return time.getTime() > Date.now()// 当天之前的时间可选
  1051. }
  1052. },
  1053. dialogImageUrl: '', dialogVisible: false,
  1054. fileList: [], showUpload: false,
  1055. headers: { optname: 'insertcustompic', id: 1, token: getToken() },
  1056. uploadImageUrl: process.env.VUE_APP_BASE_API + 'authdata/uploaderimage',
  1057. width: '',
  1058. createTemp: { inputDatetime: parseTime(new Date(), '{y}-{m}-{d}'), employeId: this.$store.state.user.employeid, inputUser: this.$store.state.user.employeid, deptId: this.$store.state.user.departmentid, departmentName: Cookies.get('departmentname'), pastureId: this.$store.state.user.pastureid, assetCode: '', eqClassName: '', eqClassId: '', eqCode: '', eqName: '', specification: '', providerName: '', brandName: '', financeCode: '', status: '正常', purpose: '', purchaseDate: parseTime(new Date(), '{y}-{m}-{d}'), entranceDate: parseTime(new Date(), '{y}-{m}-{d}'), yearUpkeepCost: '', yearMaintainDost: '', yuanzhi: '', baseHours: '', upkeepgrade: '', salvage: '', subtractvalue: '', yearMaintainCost: '', brandId: '', providerId: '', inputUserName: '', employeName: this.$store.state.user.employename, depreciation: '' },
  1059. requestParam: { name: 'insertAsset', offset: 0, pagecount: 0, parammaps: {}},
  1060. seeTemp: {},
  1061. dialogFormVisible_Examine: false,
  1062. dialogFormVisible_See: false,
  1063. activeName: 'first',
  1064. maintainTypes: [{ id: '0', name: '周保养' }, { id: '1', name: '月保养' }, { id: '2', name: '间隔保养' }],
  1065. changeStates: [{ id: '17', name: '正常' }, { id: '18', name: '闲置' }, { id: '19', name: '报废' }, { id: '20', name: '封存' }],
  1066. getdataEQNumber: { name: 'cerateEQNumber', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: {}},
  1067. dialoFormVisible_Examine: false,
  1068. examineTemp: { SHstatue: 1 },
  1069. statueReason: false,
  1070. activeList: [],
  1071. active: 3,
  1072. isFlowChart: false,
  1073. isDisplayRecord: false,
  1074. buttons: [],
  1075. // 查看-点检记录
  1076. getAssetBigSpotCheckListParm: { name: 'getAssetBigSpotCheck1', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { inputDatetimeSpotCheck1: '', startTime: '', stopTime: '' }},
  1077. listLoadingSpotCheck1: false,
  1078. listSpotCheck1: [],
  1079. totalSpotCheck1: 0,
  1080. // 查看-保养记录
  1081. getBigupkeepbyeqParm: { name: 'getBigupkeepbyeq', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { inputDatetimeUpkeepbyeq: '', startTime: '', stopTime: '', upkeepType: '', upkeepCode: '' }},
  1082. listLoadingUpkeepbyeq: false,
  1083. listUpkeepbyeq: [],
  1084. totalUpkeepbyeq: 0,
  1085. // 查看-维修记录
  1086. getAssetMaintainParm: { name: 'getAssetMaintain1', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { inputDatetimeAssetMaintain: '', startTime: '', stopTime: '', repairCode: '' }},
  1087. listLoadingAssetMaintain: false,
  1088. listAssetMaintain: [],
  1089. totalAssetMaintain: 0,
  1090. // 查看-启停记录
  1091. getAssetSTTParm: { name: 'getAssetSTT1', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { startTime: '', stopTime: '' }},
  1092. listLoadingAssetSTT: false,
  1093. listAssetSTT: [],
  1094. totalAssetSTT: 0,
  1095. // 查看-变更记录
  1096. getAssetChangeParm: { name: 'getAssetChange1', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { startTime: '', stopTime: '', changeStatue: '', inputDatetimeAssetChange: '' }},
  1097. listLoadingAssetChange: false,
  1098. listAssetChange: [],
  1099. totalAssetChange: 0,
  1100. // 查看-备件领用记录
  1101. getAssetPartApplyParm: { name: 'getAssetPartApply', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { startTime: '', stopTime: '', inputDatetimeAssetPartApply: '' }},
  1102. listLoadingAssetPartApply: false,
  1103. listAssetPartApply: [],
  1104. totalAssetPartApply: 0,
  1105. downLoadParm: {},
  1106. downLoadList: [],
  1107. requestBrand: {
  1108. name: 'getBrandByPartCode',
  1109. page: 0,
  1110. offset: 0,
  1111. pagecount: 10,
  1112. returntype: 'Map',
  1113. parammaps: {}
  1114. },
  1115. BrandList: [],
  1116. requestEmploye: {
  1117. name: 'findAllEmployeV2',
  1118. page: 0,
  1119. offset: 0,
  1120. pagecount: 10,
  1121. returntype: 'Map',
  1122. parammaps: {
  1123. pastureId: Cookies.get('pastureid')
  1124. }
  1125. },
  1126. employeList: [],
  1127. totaltitle: 0,
  1128. getBarChart1Parm: {
  1129. name: 'getReportEqCostYear',
  1130. parammaps: {}
  1131. },
  1132. barChart1: null,
  1133. chart_data1: {},
  1134. getBarChart2Parm: {
  1135. name: 'getReportEqCostMonth',
  1136. parammaps: {
  1137. receiveTime: new Date().getFullYear()
  1138. }
  1139. },
  1140. barChart2: null,
  1141. chart_data2: {},
  1142. dialogFormVisible_ChartSee: false,
  1143. getChartSeeParm: {
  1144. name: 'getEqPartuseDetailList',
  1145. page: 0,
  1146. offset: 0,
  1147. pagecount: 10,
  1148. returntype: 'Map',
  1149. parammaps: {
  1150. receiveTime: '',
  1151. eqId: '',
  1152. useTypeV: '',
  1153. inputDatetime2: '',
  1154. stopTime: '',
  1155. startTime: ''
  1156. }
  1157. },
  1158. listLoadingChartSee: false,
  1159. totalChartSee: 0,
  1160. listChartSee: [],
  1161. pageNum: 0,
  1162. pageSize: 0,
  1163. pageNumSH: 0,
  1164. pageSizeSH: 0,
  1165. useTypes: [{ id: 0, name: '维修' }, { id: 1, name: '保养' }],
  1166. downLoadParm2: {},
  1167. downLoadList2: [],
  1168. isPercentage: false,
  1169. percentage: 1,
  1170. isokDisable: false,
  1171. edit: 0,
  1172. selectionList: [],
  1173. dialogFormVisible_change: false,
  1174. batchChange: {
  1175. temp: { departmentId: '', employeeId: '' },
  1176. getdataListParmDept: { name: 'getAssetAndEmpList', offset: 0, pagecount: 0, parammaps: {}},
  1177. deptList: [],
  1178. getdataListParmPerson: { name: 'getAllEmp', offset: 0, pagecount: 0, parammaps: {}},
  1179. personList: []
  1180. },
  1181. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  1182. cellStyle: { padding: 0 + 'px' }
  1183. }
  1184. },
  1185. computed: {
  1186. // 设置请求头
  1187. // headers() {
  1188. // return {
  1189. // // 设置token
  1190. // // eslint-disable-next-line no-undef
  1191. // token: getToken()
  1192. // }
  1193. // },
  1194. uploadData() {
  1195. return {
  1196. name: 'importStockUse',
  1197. importParams: '牧场,设备类别,资产编号,设备名称,设备内部编号,设备规格,品牌,供应商,用途,状态,购置日期,入场日期,折旧年限,财务编号,原值,残值,月核减值,保养级别,保养费用,维修费用,维修费用,基数(小时),部门,责任人,录入人,录入时间,使用时长(年),使用率(%),SignColumn',
  1198. sheetname: 'SheetJS'
  1199. }
  1200. },
  1201. // 设置上传地址
  1202. uploadExcelUrl() {
  1203. // process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
  1204. return process.env.VUE_APP_BASE_API + 'authdata/equipment'
  1205. }
  1206. },
  1207. created() {
  1208. const that = this
  1209. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  1210. that.buttons = response.data.list
  1211. that.getButtons()
  1212. })
  1213. this.getListSH()
  1214. this.getDownClassList()
  1215. if (this.$route.query.tabName == undefined) {
  1216. this.tabName = 'first'
  1217. } else {
  1218. this.tabName = this.$route.query.tabName
  1219. }
  1220. if (this.isBasic === false) {
  1221. this.tabName = 'second'
  1222. }
  1223. if (this.tabName == 'first') {
  1224. this.isDisplayRecord = true
  1225. this.isFlowChart = false
  1226. } else {
  1227. this.isDisplayRecord = false
  1228. this.isFlowChart = true
  1229. }
  1230. if (this.$route.query.myPath !== undefined && this.$route.query.myPath == 'AssetStandardManagement') {
  1231. setTimeout(() => {
  1232. if (this.$route.query.pastureName !== undefined && this.$route.query.pastureId !== undefined && this.$route.query.departmentId !== undefined) {
  1233. this.getdataListParm.parammaps.pastureName = this.$route.query.pastureName
  1234. this.getdataListParm.parammaps.pastureId = this.$route.query.pastureId
  1235. // console.log(isNaN(this.$route.query.departmentId), '9999')
  1236. this.getdataListParm.parammaps.eqClassId = this.$route.query.eqClassId
  1237. this.getdataListParm.parammaps.eqClassName = this.$route.query.eqClassName
  1238. this.defaultCheckedKeys = [this.getdataListParm.parammaps.eqClassId]
  1239. this.getDepartParam.parammaps.pastureId = this.$route.query.pastureId
  1240. if (isNaN(this.$route.query.departmentId)) {
  1241. this.getdataListParm.parammaps.departmentId = ''
  1242. } else {
  1243. this.getdataListParm.parammaps.departmentId = parseInt(this.$route.query.departmentId)
  1244. }
  1245. this.getDepartDownList()
  1246. this.$forceUpdate()
  1247. } else {
  1248. this.getdataListParm.parammaps.pastureName = Cookies.get('pasturename')
  1249. this.getdataListParm.parammaps.pastureId = Cookies.get('pastureid')
  1250. this.getdataListParm.parammaps.departmentId = ''
  1251. }
  1252. this.getList()
  1253. }, 5000)
  1254. } else {
  1255. if (this.$route.query.pastureName !== undefined && this.$route.query.pastureId !== undefined && this.$route.query.departmentId !== undefined) {
  1256. this.getdataListParm.parammaps.pastureName = this.$route.query.pastureName
  1257. this.getdataListParm.parammaps.pastureId = this.$route.query.pastureId
  1258. this.getdataListParm.parammaps.departmentId = parseInt(this.$route.query.departmentId)
  1259. } else {
  1260. this.getdataListParm.parammaps.pastureName = Cookies.get('pasturename')
  1261. this.getdataListParm.parammaps.pastureId = Cookies.get('pastureid')
  1262. this.getdataListParm.parammaps.departmentId = ''
  1263. }
  1264. this.getList()
  1265. }
  1266. if (this.$route.query.myPath !== undefined && this.$route.query.myPath == 'equipmentOverview') {
  1267. this.getDepartParam.parammaps.pastureId = this.$route.query.pastureId
  1268. }
  1269. if (this.$route.query.myPath !== undefined && this.$route.query.myPath == 'equipmentOverview2') {
  1270. setTimeout(() => {
  1271. if (this.$route.query.pastureName !== undefined && this.$route.query.pastureId !== undefined && this.$route.query.eqClassId !== undefined) {
  1272. this.getdataListParm.parammaps.pastureName = this.$route.query.pastureName
  1273. this.getdataListParm.parammaps.pastureId = this.$route.query.pastureId
  1274. this.getdataListParm.parammaps.eqClassId = this.$route.query.eqClassId
  1275. this.getdataListParm.parammaps.eqClassName = this.$route.query.eqClassName
  1276. this.defaultCheckedKeys = [this.getdataListParm.parammaps.eqClassId]
  1277. this.getDepartParam.parammaps.pastureId = this.$route.query.pastureId
  1278. this.getDepartDownList()
  1279. this.$forceUpdate()
  1280. } else {
  1281. this.getdataListParm.parammaps.pastureName = Cookies.get('pasturename')
  1282. this.getdataListParm.parammaps.pastureId = Cookies.get('pastureid')
  1283. this.getdataListParm.parammaps.eqClassId = ''
  1284. }
  1285. this.getList()
  1286. }, 5000)
  1287. } else {
  1288. if (this.$route.query.pastureName !== undefined && this.$route.query.pastureId !== undefined && this.$route.query.departmentId !== undefined) {
  1289. this.getdataListParm.parammaps.pastureName = this.$route.query.pastureName
  1290. this.getdataListParm.parammaps.pastureId = this.$route.query.pastureId
  1291. this.getdataListParm.parammaps.departmentId = parseInt(this.$route.query.departmentId)
  1292. } else {
  1293. this.getdataListParm.parammaps.pastureName = Cookies.get('pasturename')
  1294. this.getdataListParm.parammaps.pastureId = Cookies.get('pastureid')
  1295. this.getdataListParm.parammaps.departmentId = ''
  1296. }
  1297. this.getList()
  1298. }
  1299. // 设备购置报废统计
  1300. if (this.$route.query.myPath !== undefined && this.$route.query.myPath == 'PurchaseScrap') {
  1301. if (this.$route.query.project == '新购设备数') {
  1302. this.getdataListParm.parammaps.pastureName = this.$route.query.pastureName
  1303. this.getdataListParm.parammaps.inputDatetime2 = [parseTime(new Date(), '{y}') + '-01-01', parseTime(new Date(), '{y}') + '-12-31']
  1304. this.getDepartParam.parammaps.pastureId = this.$route.query.pastureId
  1305. this.getDepartDownList()
  1306. } else {
  1307. this.getdataListParm.parammaps.pastureName = this.$route.query.pastureName
  1308. this.getdataListParm.parammaps.inputDatetime3 = [parseTime(new Date(), '{y}') + '-01-01', parseTime(new Date(), '{y}') + '-12-31']
  1309. this.getDepartParam.parammaps.pastureId = this.$route.query.pastureId
  1310. this.getDepartDownList()
  1311. }
  1312. }
  1313. this.getList()
  1314. // Window.addEventListener('keyup', )
  1315. this.keyupSubmit()
  1316. },
  1317. methods: {
  1318. // 导入
  1319. beforeImportExcel(file) {
  1320. const isLt2M = file.size / 1024 / 1024 < 10
  1321. if (!isLt2M) {
  1322. this.$message.error('上传文件大小不能超过 10MB!')
  1323. }
  1324. return isLt2M
  1325. },
  1326. handleImportExcelSuccess(res, file) {
  1327. if (res.msg === 'ok') {
  1328. this.$message({
  1329. title: '成功',
  1330. message: '导入成功:' + res.data.success + '条!',
  1331. type: 'success',
  1332. duration: 2000
  1333. })
  1334. if (res.data.err_count > 0) {
  1335. this.$notify({
  1336. title: '失败',
  1337. message: '导入失败:' + res.data.err_count + '条!',
  1338. type: 'danger',
  1339. duration: 2000
  1340. })
  1341. }
  1342. } else {
  1343. this.$notify({
  1344. title: '失败',
  1345. message: '上传失败',
  1346. type: 'danger',
  1347. duration: 2000
  1348. })
  1349. }
  1350. },
  1351. formatJsonTemp(filterVal, jsonData) {
  1352. return jsonData.map(v =>
  1353. filterVal.map(j => {
  1354. if (j === 'timestamp') {
  1355. return parseTime(v[j])
  1356. } else {
  1357. return v[j]
  1358. }
  1359. })
  1360. )
  1361. },
  1362. tableSort2(column) {
  1363. sortChange(column, this.list)
  1364. },
  1365. tableSort(column) {
  1366. if (this.activeName == 'third') {
  1367. sortChange(column, this.listUpkeepbyeq)
  1368. } else if (this.activeName == 'fouth') {
  1369. sortChange(column, this.listAssetMaintain)
  1370. } else if (this.activeName == 'seventh') {
  1371. sortChange(column, this.listAssetPartApply)
  1372. }
  1373. },
  1374. getButtons() {
  1375. // 新增
  1376. const BasicsAdd = 'asset:basics:add'
  1377. const isBasicsAdd = checkButtons(this.$store.state.user.buttons, BasicsAdd)
  1378. this.isBasicsAdd = isBasicsAdd
  1379. // 卡片
  1380. const BasicsCard = 'asset:basics:kapian'
  1381. const isBasicsCard = checkButtons(this.$store.state.user.buttons, BasicsCard)
  1382. this.isBasicsCard = isBasicsCard
  1383. // 编辑
  1384. const BasicsUpdate = 'asset:basics:update'
  1385. const isBasicsUpdate = checkButtons(this.$store.state.user.buttons, BasicsUpdate)
  1386. this.isBasicsUpdate = isBasicsUpdate
  1387. // 删除
  1388. const BasicsDel = 'asset:basics:del'
  1389. const isBasicsDel = checkButtons(this.$store.state.user.buttons, BasicsDel)
  1390. this.isBasicsDel = isBasicsDel
  1391. // 设备基础信息-删除
  1392. const BasicsDel2 = 'asset:basics:del2'
  1393. const isBasicsDel2 = checkButtons(this.$store.state.user.buttons, BasicsDel2)
  1394. this.isBasicsDel2 = isBasicsDel2
  1395. // 设备基础信息
  1396. const Basic = 'asset:basic:basic'
  1397. const isBasic = checkButtons(this.$store.state.user.buttons, Basic)
  1398. this.isBasic = isBasic
  1399. // 设备审核
  1400. const BasicSH = 'asset:basic:shjm'
  1401. const isBasicSH = checkButtons(this.$store.state.user.buttons, BasicSH)
  1402. this.isBasicSH = isBasicSH
  1403. // 审核
  1404. const BasicExamine = 'asset:basic:shenhe'
  1405. const isBasicExamine = checkButtons(this.$store.state.user.buttons, BasicExamine)
  1406. this.isBasicExamine = isBasicExamine
  1407. },
  1408. // 2-2:下拉框
  1409. getDownList() {
  1410. GetDataByNames(this.requestParams).then(response => {
  1411. if (response.data.list !== null) {
  1412. this.findAllBrand = response.data.findAllBrand.list
  1413. this.findAllProvider = response.data.findAllProvider.list
  1414. this.findAllAssetType = response.data.findAllAssetType.list
  1415. this.findAllPasture = response.data.findAllPasture.list
  1416. this.findAllEmploye = response.data.findAllEmploye.list
  1417. this.getDictByName = response.data.getDictByName.list
  1418. this.upkeepgrades = response.data.getdictbyname.list
  1419. this.getDepartDownList()
  1420. }
  1421. })
  1422. },
  1423. getDepartDownList() {
  1424. GetDataByName(this.getDepartParam).then(response => {
  1425. this.findAllDepart = response.data.list
  1426. })
  1427. },
  1428. changePastureName(item) {
  1429. this.getDepartParam.parammaps.pastureId = this.findAllPasture.find(obj => obj.name == item).id
  1430. this.getdataListParm.parammaps.departmentId = ''
  1431. this.getDepartDownList()
  1432. },
  1433. getCreateDepartDownList() {
  1434. GetDataByName(this.getDepartParam).then(response => {
  1435. this.createDepartList = response.data.list
  1436. if (this.edit == 1) {
  1437. if (this.createDepartList.find(obj => obj.id == Cookies.get('departmentid'))) {
  1438. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  1439. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == Cookies.get('departmentid')).name
  1440. this.createTemp.deptId = parseInt(Cookies.get('departmentid'))
  1441. } else {
  1442. this.createTemp.departmentId = response.data.list[0].id
  1443. this.createTemp.departmentId = response.data.list[0].id
  1444. this.createTemp.deptId = response.data.list[0].name
  1445. }
  1446. }
  1447. })
  1448. },
  1449. changePasture(item) {
  1450. this.getDepartParam.parammaps.pastureId = item
  1451. this.edit = 1
  1452. this.getCreateDepartDownList()
  1453. },
  1454. changeDepart(item) {
  1455. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == item).name
  1456. },
  1457. getList() {
  1458. this.listLoading = true
  1459. if (this.getdataListParm.parammaps.inputDatetime1 == null) {
  1460. this.getdataListParm.parammaps.inputDatetime1 = ''
  1461. this.getdataListParm.parammaps.startTime = ''
  1462. this.getdataListParm.parammaps.stopTime = ''
  1463. } else {
  1464. this.getdataListParm.parammaps.startTime = this.getdataListParm.parammaps.inputDatetime1[0]
  1465. this.getdataListParm.parammaps.stopTime = this.getdataListParm.parammaps.inputDatetime1[1]
  1466. }
  1467. if (this.getdataListParm.parammaps.inputDatetime2 == null || this.getdataListParm.parammaps.inputDatetime2 == '') {
  1468. this.getdataListParm.parammaps.inputDatetime2 = ''
  1469. this.getdataListParm.parammaps.startTime2 = ''
  1470. this.getdataListParm.parammaps.stopTime2 = ''
  1471. } else {
  1472. this.getdataListParm.parammaps.startTime2 = this.getdataListParm.parammaps.inputDatetime2[0]
  1473. this.getdataListParm.parammaps.stopTime2 = this.getdataListParm.parammaps.inputDatetime2[1]
  1474. }
  1475. if (this.getdataListParm.parammaps.inputDatetime3 == null || this.getdataListParm.parammaps.inputDatetime3 == '') {
  1476. this.getdataListParm.parammaps.inputDatetime3 = ''
  1477. this.getdataListParm.parammaps.startTime3 = ''
  1478. this.getdataListParm.parammaps.stopTime3 = ''
  1479. } else {
  1480. this.getdataListParm.parammaps.startTime3 = this.getdataListParm.parammaps.inputDatetime3[0]
  1481. this.getdataListParm.parammaps.stopTime3 = this.getdataListParm.parammaps.inputDatetime3[1]
  1482. }
  1483. GetDataByName(this.getdataListParm).then(response => {
  1484. console.log('table数据', response.data.list)
  1485. if (response.data.list !== null) {
  1486. this.list = response.data.list
  1487. for (let i = 0; i < response.data.list.length; i++) {
  1488. if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
  1489. this.list[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1490. this.list[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1491. } else {
  1492. this.list[i].srcpath = ''
  1493. this.list[i].picpath = ''
  1494. }
  1495. }
  1496. this.pageNum = response.data.pageNum
  1497. this.pageSize = response.data.pageSize
  1498. } else {
  1499. this.list = []
  1500. }
  1501. this.total = response.data.total
  1502. setTimeout(() => {
  1503. this.listLoading = false
  1504. }, 100)
  1505. this.getDownList()
  1506. })
  1507. },
  1508. getListSH() {
  1509. this.listLoadingSH = true
  1510. console.log(this.$refs)
  1511. console.log(this.$refs['inputDatetime1'])
  1512. if (this.getdataListParmSH.parammaps.inputDatetime1 == null) {
  1513. this.getdataListParmSH.parammaps.inputDatetime1 = ''
  1514. } else {
  1515. this.getdataListParmSH.parammaps.startTime = this.getdataListParmSH.parammaps.inputDatetime1[0]
  1516. this.getdataListParmSH.parammaps.stopTime = this.getdataListParmSH.parammaps.inputDatetime1[1]
  1517. }
  1518. GetDataByName(this.getdataListParmSH).then(response => {
  1519. console.log('table数据', response.data.list)
  1520. if (response.data.list !== null) {
  1521. this.listSH = response.data.list
  1522. for (let i = 0; i < response.data.list.length; i++) {
  1523. if (response.data.list[i].srcpath !== null && response.data.list[i].picpath) {
  1524. this.listSH[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1525. this.listSH[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1526. } else {
  1527. this.listSH[i].srcpath = ''
  1528. this.listSH[i].picpath = ''
  1529. }
  1530. }
  1531. this.pageNumSH = response.data.pageNum
  1532. this.pageSizeSH = response.data.pageSize
  1533. } else {
  1534. this.listSH = []
  1535. }
  1536. this.totalSH = response.data.total
  1537. setTimeout(() => {
  1538. this.listLoadingSH = false
  1539. }, 100)
  1540. })
  1541. },
  1542. SHStatus: function(cellValue) {
  1543. if (cellValue.SHStatus == 0) {
  1544. return '审核中'
  1545. } else if (cellValue.SHStatus == 1) {
  1546. return '已通过'
  1547. } else if (cellValue.SHStatus == 2) {
  1548. return '未通过'
  1549. } else if (cellValue.SHStatus == 3) {
  1550. return '历史数据'
  1551. }
  1552. },
  1553. form_search() {
  1554. this.listLoading = true
  1555. this.getdataListParm.parammaps.pastureId = ''
  1556. if (this.getdataListParm.parammaps.warning !== '') {
  1557. this.getdataListParm.parammaps.d1 = 1
  1558. } else {
  1559. this.getdataListParm.parammaps.d1 = ''
  1560. }
  1561. if (this.getdataListParm.parammaps.inputDatetime1 == null) {
  1562. this.getdataListParm.parammaps.inputDatetime1 = ''
  1563. this.getdataListParm.parammaps.startTime = ''
  1564. this.getdataListParm.parammaps.stopTime = ''
  1565. } else {
  1566. this.getdataListParm.parammaps.startTime = this.getdataListParm.parammaps.inputDatetime1[0]
  1567. this.getdataListParm.parammaps.stopTime = this.getdataListParm.parammaps.inputDatetime1[1]
  1568. }
  1569. console.log(this.getdataListParm.parammaps.inputDatetime2)
  1570. if (this.getdataListParm.parammaps.inputDatetime2 == null) {
  1571. this.getdataListParm.parammaps.inputDatetime2 = ''
  1572. this.getdataListParm.parammaps.startTime2 = ''
  1573. this.getdataListParm.parammaps.stopTime2 = ''
  1574. } else {
  1575. this.getdataListParm.parammaps.startTime2 = this.getdataListParm.parammaps.inputDatetime2[0]
  1576. this.getdataListParm.parammaps.stopTime2 = this.getdataListParm.parammaps.inputDatetime2[1]
  1577. }
  1578. if (this.getdataListParm.parammaps.inputDatetime3 == null) {
  1579. this.getdataListParm.parammaps.inputDatetime3 = ''
  1580. this.getdataListParm.parammaps.startTime3 = ''
  1581. this.getdataListParm.parammaps.stopTime3 = ''
  1582. } else {
  1583. this.getdataListParm.parammaps.startTime3 = this.getdataListParm.parammaps.inputDatetime3[0]
  1584. this.getdataListParm.parammaps.stopTime3 = this.getdataListParm.parammaps.inputDatetime3[1]
  1585. }
  1586. this.getdataListParm.offset = 1
  1587. this.getList()
  1588. },
  1589. form_searchSH() {
  1590. this.listLoadingSH = true
  1591. if (this.getdataListParmSH.parammaps.inputDatetime1 == null) {
  1592. this.getdataListParmSH.parammaps.inputDatetime1 = ''
  1593. } else {
  1594. this.getdataListParmSH.parammaps.startTime = this.getdataListParmSH.parammaps.inputDatetime1[0]
  1595. this.getdataListParmSH.parammaps.stopTime = this.getdataListParmSH.parammaps.inputDatetime1[1]
  1596. }
  1597. this.getdataListParmSH.offset = 1
  1598. this.getListSH()
  1599. },
  1600. handlePicChange(file, fileList) {
  1601. if (fileList.length > 0) {
  1602. this.$nextTick(() => {
  1603. this.showUpload = true
  1604. })
  1605. } else {
  1606. this.$nextTick(() => {
  1607. this.showUpload = false
  1608. })
  1609. }
  1610. console.log(this.createTemp)
  1611. },
  1612. handlePicSuccess(response, file, fileList) {
  1613. if (fileList.length > 0) {
  1614. this.$nextTick(() => {
  1615. this.showUpload = true
  1616. })
  1617. } else {
  1618. this.$nextTick(() => {
  1619. this.showUpload = false
  1620. })
  1621. }
  1622. if (this.createTemp.picpath === undefined || this.createTemp.picpath === '' || this.createTemp.picpath == -1) {
  1623. this.$set(this.createTemp, 'picpath', response.execresult.LastInsertId)
  1624. }
  1625. },
  1626. handlePicRemove(file, fileList) {
  1627. if (this.dialogStatus === 'create') {
  1628. if (fileList.length < 1) {
  1629. this.showUpload = false
  1630. }
  1631. for (const key in this.createTemp) {
  1632. if (this.createTemp[key] === file.response.execresult.LastInsertId) {
  1633. this.$delete(this.createTemp, key)
  1634. }
  1635. }
  1636. } else {
  1637. if (fileList.length < 1) {
  1638. this.$nextTick(() => {
  1639. this.showUpload = false
  1640. })
  1641. }
  1642. const url = file.url
  1643. console.log(url, 'url')
  1644. for (const key in this.createTemp) {
  1645. console.log(this.createTemp[key], 'createTemp[key]')
  1646. if (this.createTemp[key] === url) {
  1647. console.log(key)
  1648. if (key === 'picpath') {
  1649. this.$delete(this.createTemp, 'picpath')
  1650. this.$delete(this.createTemp, 'picId')
  1651. }
  1652. }
  1653. }
  1654. }
  1655. console.log(this.createTemp, '文件列表移除文件时的钩子row')
  1656. },
  1657. handlePicPreview(file) {
  1658. this.dialogImageUrl = file.url
  1659. this.dialogVisible = true
  1660. },
  1661. onLoad(e) {
  1662. const img = e.target
  1663. let width = 0
  1664. if (img.fileSize > 0 || (img.width > 1 && img.height > 1)) {
  1665. width = img.width + 40
  1666. }
  1667. this.width = width + 'px'
  1668. },
  1669. add_dialog_saveAdd() {
  1670. console.log('点击了保存')
  1671. this.isokDisable = true
  1672. setTimeout(() => {
  1673. this.isokDisable = false
  1674. }, 1000)
  1675. this.$refs['createTemp'].validate(valid => {
  1676. if (valid) {
  1677. for (var i = 0; i < this.listAdd.length; i++) {
  1678. if (this.listAdd[i].score == null) {
  1679. this.$message({ type: 'warning', message: '请检查检查结果是否为空', duration: 2000 })
  1680. return false
  1681. }
  1682. if (this.listAdd[i].pic1 == undefined) {
  1683. this.listAdd[i].pic1 = -1
  1684. }
  1685. if (this.listAdd[i].pic2 == undefined) {
  1686. this.listAdd[i].pic2 = -1
  1687. }
  1688. if (this.listAdd[i].pic3 == undefined) {
  1689. this.listAdd[i].pic3 = -1
  1690. }
  1691. }
  1692. this.postDataPramas.common = { 'returnmap': '0' }
  1693. this.postDataPramas.data = []
  1694. this.postDataPramas.data[0] = { 'name': 'insertBigjudge', 'type': 'e', 'parammaps': {
  1695. pastureId: this.createTemp.pastureId,
  1696. batime: this.createTemp.batime,
  1697. empId: this.createTemp.empId
  1698. }}
  1699. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  1700. this.postDataPramas.data[1].children = []
  1701. this.postDataPramas.data[1].children[0] = { 'name': 'insertjudge', 'type': 'e', 'parammaps': {
  1702. bigId: '@insertBigjudge.LastInsertId',
  1703. statue: '@insertSpotList.statue',
  1704. score: '@insertSpotList.score',
  1705. note: '@insertSpotList.note',
  1706. pic1: '@insertSpotList.pic1',
  1707. pic2: '@insertSpotList.pic2',
  1708. pic3: '@insertSpotList.pic3'
  1709. }}
  1710. ExecDataByConfig(this.postDataPramas).then(response => {
  1711. console.log('新增保存发送参数', this.postDataPramas)
  1712. if (response.msg === 'fail') {
  1713. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1714. } else {
  1715. this.getdataListParm.parammaps.inputDatetime = ''
  1716. this.getList()
  1717. this.dialogFormVisibleAdd = false
  1718. this.createTemp.providerName = ''
  1719. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1720. }
  1721. })
  1722. }
  1723. })
  1724. },
  1725. beforeRemove(file, fileList) {
  1726. console.log(file.response, '删除文件之前的钩子,参数为上传的文件和文件列表')
  1727. return this.$confirm('删除当前图片, 是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' })
  1728. },
  1729. resetCreateTemp() {
  1730. this.defaultCheckedKeys = []
  1731. this.createTemp.defaultCheckedKeys = []
  1732. this.createTemp.brandId = ''
  1733. this.createTemp.providerId = ''
  1734. this.createTemp.inputDatetime = parseTime(new Date(), '{y}-{m}-{d}')
  1735. this.createTemp.eqClassName = ''
  1736. this.createTemp.eqClassId = ''
  1737. this.createTemp.employeName = Cookies.get('employename')
  1738. this.createTemp.employeId = Cookies.get('employeid')
  1739. this.createTemp.inputUser = Cookies.get('employeid')
  1740. this.createTemp.deptId = parseInt(Cookies.get('departmentid'))
  1741. this.createTemp.departmentName = Cookies.get('departmentname')
  1742. this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
  1743. this.createTemp.eqCode = ''
  1744. this.createTemp.eqName = ''
  1745. this.createTemp.specification = ''
  1746. this.createTemp.providerName = ''
  1747. this.createTemp.financeCode = ''
  1748. this.createTemp.status = '正常'
  1749. this.createTemp.providerName = ''
  1750. this.createTemp.brandName = ''
  1751. this.createTemp.purpose = ''
  1752. this.createTemp.purchaseDate = parseTime(new Date(), '{y}-{m}-{d}')
  1753. this.createTemp.entranceDate = parseTime(new Date(), '{y}-{m}-{d}')
  1754. this.createTemp.assetCode = ''
  1755. this.createTemp.yearUpkeepCost = ''
  1756. this.createTemp.yearMaintainDost = ''
  1757. this.createTemp.yuanzhi = ''
  1758. this.createTemp.baseHours = ''
  1759. this.createTemp.upkeepgrade = 113
  1760. this.createTemp.salvage = ''
  1761. this.createTemp.subtractvalue = ''
  1762. this.createTemp.yearMaintainCost = ''
  1763. this.createTemp.inputUserName = ''
  1764. this.createTemp.picpath = ''
  1765. this.fileList = []
  1766. this.showUpload = false
  1767. this.createTemp.fileList = []
  1768. this.createTemp.depreciation = ''
  1769. },
  1770. form_add() {
  1771. this.resetCreateTemp()
  1772. this.edit = 1
  1773. this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
  1774. this.getCreateDepartDownList()
  1775. this.dialogStatus = 'create'
  1776. this.dialogFormVisible = true
  1777. this.$nextTick(() => {
  1778. this.$refs['createTemp'].clearValidate()
  1779. })
  1780. },
  1781. changeBrand(item) {
  1782. this.createTemp.brandName = this.findAllBrand.find(obj => obj.id === item).name
  1783. },
  1784. changeUpkeepgrade(item) {
  1785. console.log(item)
  1786. },
  1787. upkeepgradeChange(e) {
  1788. if (!e) {
  1789. this.$refs['upkeepgrade'].blur()
  1790. }
  1791. },
  1792. popoverHide(checkedIds, checkedData) {
  1793. console.log(checkedIds, checkedData)
  1794. if (checkedIds !== null) {
  1795. this.getdataEQNumber.parammaps.eqCode = checkedData.typeCode
  1796. if (checkedData.children === undefined) {
  1797. this.createTemp.eqClassId = checkedData.eqClassId
  1798. this.createTemp.eqName = checkedData.NewName
  1799. this.getdataListParm.parammaps.eqClassId = checkedData.eqClassId
  1800. this.getEQNumber()
  1801. } else {
  1802. this.defaultCheckedKeys = []
  1803. this.createTemp.eqClassId = ''
  1804. this.getdataListParm.parammaps.eqClassId = ''
  1805. this.$message({ type: 'warning', message: '请选择具体设备类型' })
  1806. }
  1807. } else {
  1808. this.defaultCheckedKeys = []
  1809. this.createTemp.eqClassId = ''
  1810. this.getdataListParm.parammaps.eqClassId = ''
  1811. }
  1812. },
  1813. add_dialog_save() {
  1814. this.isokDisable = true
  1815. setTimeout(() => {
  1816. this.isokDisable = false
  1817. }, 1000)
  1818. this.$refs['createTemp'].validate(valid => {
  1819. if (valid) {
  1820. console.log(this.createTemp)
  1821. this.requestParam.name = 'insertAsset'
  1822. if (this.createTemp.status == '正常') { this.createTemp.status = 17 }
  1823. if (this.createTemp.providerId == '') { this.createTemp.providerId = 0 }
  1824. if (this.createTemp.brandId == '') { this.createTemp.brandId = 0 }
  1825. if (this.createTemp.yuanzhi == '') { this.createTemp.yuanzhi = 0 }
  1826. if (this.createTemp.salvage == '') { this.createTemp.salvage = 0 }
  1827. if (this.createTemp.subtractvalue == '') { this.createTemp.subtractvalue = 0 }
  1828. if (this.createTemp.yearUpkeepCost == '') { this.createTemp.yearUpkeepCost = 0 }
  1829. if (this.createTemp.yearMaintainCost == '') { this.createTemp.yearMaintainCost = 0 }
  1830. if (this.createTemp.baseHours == '') { this.createTemp.baseHours = 0 }
  1831. // 原值yuanzhi残值salvage月核减值subtractvalue保养费用yearUpkeepCost维修费用yearMaintainCost
  1832. var rulesValue = /^\d+(\.\d{1,3})?$/
  1833. this.requestParam.parammaps = this.createTemp
  1834. this.requestParam.parammaps.picpath = this.createTemp.picpath
  1835. if (this.createTemp.yuanzhi !== '' || this.createTemp.salvage !== '' || this.createTemp.subtractvalue !== '' || this.createTemp.yearUpkeepCost !== '' || this.createTemp.yearMaintainCost !== '') {
  1836. this.requestParam.parammaps.yuanzhi = parseFloat(this.createTemp.yuanzhi)
  1837. if (!rulesValue.test(parseFloat(this.createTemp.yuanzhi))) {
  1838. this.$message({ type: 'error', message: '原值请输入自然数,最多保留三位小数点', duration: 2000 })
  1839. return false
  1840. }
  1841. if (!rulesValue.test(parseFloat(this.createTemp.salvage))) {
  1842. this.$message({ type: 'error', message: '残值请输入自然数,最多保留三位小数点', duration: 2000 })
  1843. return false
  1844. }
  1845. if (!rulesValue.test(parseFloat(this.createTemp.subtractvalue))) {
  1846. this.$message({ type: 'error', message: '月核减值请输入自然数,最多保留三位小数点', duration: 2000 })
  1847. return false
  1848. }
  1849. if (!rulesValue.test(parseFloat(this.createTemp.yearUpkeepCost))) {
  1850. this.$message({ type: 'error', message: '保养费用输入自然数,最多保留三位小数点', duration: 2000 })
  1851. return false
  1852. }
  1853. if (!rulesValue.test(parseFloat(this.createTemp.yearMaintainCost))) {
  1854. this.$message({ type: 'error', message: '维修费用请输入自然数,最多保留三位小数点', duration: 2000 })
  1855. return false
  1856. }
  1857. }
  1858. PostDataByName(this.requestParam).then(response => {
  1859. console.log('新增保存发送参数', this.requestParam)
  1860. if (response.msg !== 'fail') {
  1861. if (this.getdataListParm.parammaps.inputDatetime1 === null) {
  1862. this.getdataListParm.parammaps.inputDatetime1 = ''
  1863. }
  1864. this.dialogFormVisible = false
  1865. this.getList()
  1866. this.$notify({ title: '成功', message: '新增成功', type: 'success', duration: 2000 })
  1867. // this.reload()
  1868. } else {
  1869. failproccess(response, this.$notify)
  1870. }
  1871. })
  1872. }
  1873. })
  1874. },
  1875. // 继续新增
  1876. add_dialog_save_again() {
  1877. this.isokDisable = true
  1878. setTimeout(() => {
  1879. this.isokDisable = false
  1880. }, 1000)
  1881. this.$refs['createTemp'].validate(valid => {
  1882. if (valid) {
  1883. this.requestParam.name = 'insertAsset'
  1884. if (this.createTemp.status == '正常') { this.createTemp.status = 17 }
  1885. if (this.createTemp.providerId == '') { this.createTemp.providerId = 0 }
  1886. if (this.createTemp.brandId == '') { this.createTemp.brandId = 0 }
  1887. if (this.createTemp.yuanzhi == '') { this.createTemp.yuanzhi = 0 }
  1888. if (this.createTemp.salvage == '') { this.createTemp.salvage = 0 }
  1889. if (this.createTemp.subtractvalue == '') { this.createTemp.subtractvalue = 0 }
  1890. if (this.createTemp.yearUpkeepCost == '') { this.createTemp.yearUpkeepCost = 0 }
  1891. if (this.createTemp.yearMaintainCost == '') { this.createTemp.yearMaintainCost = 0 }
  1892. if (this.createTemp.baseHours == '') { this.createTemp.baseHours = 0 }
  1893. // 原值yuanzhi残值salvage月核减值subtractvalue保养费用yearUpkeepCost维修费用yearMaintainCost
  1894. var rulesValue = /^\d+(\.\d{1,3})?$/
  1895. this.requestParam.parammaps = this.createTemp
  1896. this.requestParam.parammaps.picpath = this.createTemp.picpath
  1897. if (this.createTemp.yuanzhi !== '' || this.createTemp.salvage !== '' || this.createTemp.subtractvalue !== '' || this.createTemp.yearUpkeepCost !== '' || this.createTemp.yearMaintainCost !== '') {
  1898. this.requestParam.parammaps.yuanzhi = parseFloat(this.createTemp.yuanzhi)
  1899. // if (!rulesValue.test(parseFloat(this.createTemp.yuanzhi)) || !rulesValue.test(parseFloat(this.createTemp.salvage)) || !rulesValue.test(parseFloat(this.createTemp.subtractvalue)) || !rulesValue.test(parseFloat(this.createTemp.yearUpkeepCost)) || !rulesValue.test(parseFloat(this.createTemp.yearMaintainCost))) {
  1900. if (!rulesValue.test(parseFloat(this.createTemp.yuanzhi))) {
  1901. this.$message({ type: 'error', message: '原值请输入自然数,最多保留三位小数点', duration: 2000 })
  1902. return false
  1903. }
  1904. if (!rulesValue.test(parseFloat(this.createTemp.salvage))) {
  1905. this.$message({ type: 'error', message: '残值请输入自然数,最多保留三位小数点', duration: 2000 })
  1906. return false
  1907. }
  1908. if (!rulesValue.test(parseFloat(this.createTemp.subtractvalue))) {
  1909. this.$message({ type: 'error', message: '月核减值请输入自然数,最多保留三位小数点', duration: 2000 })
  1910. return false
  1911. }
  1912. if (!rulesValue.test(parseFloat(this.createTemp.yearUpkeepCost))) {
  1913. this.$message({ type: 'error', message: '保养费用输入自然数,最多保留三位小数点', duration: 2000 })
  1914. return false
  1915. }
  1916. if (!rulesValue.test(parseFloat(this.createTemp.yearMaintainCost))) {
  1917. this.$message({ type: 'error', message: '维修费用请输入自然数,最多保留三位小数点', duration: 2000 })
  1918. return false
  1919. }
  1920. }
  1921. PostDataByName(this.requestParam).then(response => {
  1922. console.log('新增保存发送参数', this.requestParam)
  1923. if (response.msg !== 'fail') {
  1924. if (this.getdataListParm.parammaps.inputDatetime === null) {
  1925. this.getdataListParm.parammaps.inputDatetime = ''
  1926. }
  1927. this.resetCreateTemp()
  1928. this.$notify({ title: '成功', message: '新增成功', type: 'success', duration: 2000 })
  1929. } else {
  1930. failproccess(response, this.$notify)
  1931. }
  1932. })
  1933. }
  1934. })
  1935. },
  1936. form_edit(row) {
  1937. if (this.dialogFormVisible) {
  1938. return
  1939. }
  1940. this.edit = 0
  1941. this.getDepartParam.parammaps.pastureId = row.pastureId
  1942. this.getCreateDepartDownList()
  1943. this.createTemp = Object.assign({}, row) // copy obj
  1944. if (row.inputUser !== undefined) {
  1945. this.createTemp.inputUser = parseInt(row.inputUser)
  1946. }
  1947. if (this.createTemp.eqClassId !== undefined) {
  1948. this.defaultCheckedKeys = [this.createTemp.eqClassId]
  1949. } else {
  1950. this.createTemp.eqClassId = ''
  1951. this.defaultCheckedKeys = []
  1952. }
  1953. this.dialogStatus = 'update'
  1954. this.dialogFormVisible = true
  1955. this.$nextTick(() => {
  1956. this.$refs['createTemp'].clearValidate()
  1957. })
  1958. const urlArray = []
  1959. const fileList = []
  1960. if (row.picpath == undefined) {
  1961. urlArray.push()
  1962. } else if (row.picpath == '') {
  1963. urlArray.push()
  1964. } else {
  1965. urlArray.push(row.picpath)
  1966. }
  1967. for (let i = 0; i < urlArray.length; i++) {
  1968. const urlObj = {}
  1969. this.$set(urlObj, 'url', urlArray[i])
  1970. fileList.push(urlObj)
  1971. }
  1972. this.$set(this.createTemp, 'fileList', fileList)
  1973. console.log(this.createTemp)
  1974. if (this.createTemp.fileList.length >= 1) {
  1975. this.showUpload = true
  1976. } else {
  1977. this.showUpload = false
  1978. }
  1979. },
  1980. edit_dialog_save() {
  1981. this.$refs['createTemp'].validate(valid => {
  1982. if (valid) {
  1983. console.log('-----------', this.createTemp)
  1984. console.log(this.createTemp.providerId)
  1985. if (this.createTemp.eqClassId == '' || this.createTemp.eqClassId == undefined || this.createTemp.eqClassId == null) {
  1986. this.$message({ type: 'warning', message: '请选择设备类别' })
  1987. } else {
  1988. this.requestParam.name = 'updateAsset'
  1989. this.requestParam.parammaps = this.createTemp
  1990. if (this.createTemp.status === '正常') { this.createTemp.status = 17 }
  1991. if (this.createTemp.status === '闲置') { this.createTemp.status = 18 }
  1992. if (this.createTemp.status === '报废') { this.createTemp.status = 19 }
  1993. if (this.createTemp.status === '封存') { this.createTemp.status = 20 }
  1994. if (this.createTemp.providerId === '' || this.createTemp.providerId === undefined) { this.createTemp.providerId = 0 }
  1995. if (this.createTemp.brandId === '' || this.createTemp.brandId == undefined) { this.createTemp.brandId = 0 }
  1996. if (this.createTemp.yuanzhi === '') { this.createTemp.yuanzhi = 0 }
  1997. if (this.createTemp.salvage === '') { this.createTemp.salvage = 0 }
  1998. if (this.createTemp.subtractvalue === '') { this.createTemp.subtractvalue = 0 }
  1999. if (this.createTemp.yearUpkeepCost === '') { this.createTemp.yearUpkeepCost = 0 }
  2000. if (this.createTemp.yearMaintainCost === '') { this.createTemp.yearMaintainCost = 0 }
  2001. if (this.createTemp.baseHours === '') { this.createTemp.baseHours = 0 }
  2002. if (this.createTemp.upkeepgrade === 'A' || this.createTemp.upkeepgrade === 'B' || this.createTemp.upkeepgrade === 'C') {
  2003. this.createTemp.upkeepgrade = this.createTemp.upkeepgradeId
  2004. this.createTemp.upkeepgradeId = ''
  2005. }
  2006. this.createTemp.deptId = this.createTemp.deptId
  2007. this.createTemp.departmentName = this.createTemp.departmentName
  2008. this.createTemp.employeeId = this.createTemp.employeId
  2009. // var rulesValue = /^\d+(\.\d{1,3})?$/
  2010. this.requestParam.parammaps = this.createTemp
  2011. if (this.tabName === 'first') {
  2012. this.requestParam.parammaps.SHStatus = this.createTemp.SHStatus
  2013. } else if (this.tabName === 'second') {
  2014. this.requestParam.parammaps.SHStatus = 0
  2015. }
  2016. const picpath = parseInt(this.createTemp.picpath)
  2017. if (isNaN(picpath) == false) {
  2018. this.requestParam.parammaps.picpath = this.createTemp.picpath
  2019. } else {
  2020. this.requestParam.parammaps.picpath = this.createTemp.picId
  2021. }
  2022. PostDataByName(this.requestParam).then(response => {
  2023. console.log(response)
  2024. if (response.msg !== 'fail') {
  2025. if (this.getdataListParm.parammaps.inputDatetime1 === null) {
  2026. this.getdataListParm.parammaps.inputDatetime1 = ''
  2027. }
  2028. this.getList()
  2029. this.getListSH()
  2030. this.dialogFormVisible = false
  2031. this.$notify({ title: '成功', message: '保存成功-', type: 'success', duration: 2000 })
  2032. // this.reload()
  2033. } else {
  2034. failproccess(response, this.$notify)
  2035. }
  2036. })
  2037. }
  2038. }
  2039. })
  2040. },
  2041. brandSearch(queryString, cb) {
  2042. console.log('品牌模糊查询输入值', queryString)
  2043. this.requestBrand.parammaps['brandName'] = queryString
  2044. GetDataByName(this.requestBrand).then(response => {
  2045. console.log('品牌模糊查询搜索data', response.data.list)
  2046. this.BrandList = response.data.list
  2047. cb(this.BrandList)
  2048. })
  2049. },
  2050. handleSelectBrand(item) {
  2051. console.log('品牌模糊查询选中值', item)
  2052. this.$set(this.createTemp, 'brandName', item.brandName)
  2053. this.$set(this.createTemp, 'brandId', item.brandId)
  2054. this.$forceUpdate()
  2055. },
  2056. employeSearch(queryString, cb) {
  2057. console.log('责任人模糊查询输入值', queryString)
  2058. this.requestEmploye.parammaps['empname'] = queryString
  2059. GetDataByName(this.requestEmploye).then(response => {
  2060. console.log('责任人模糊查询搜索data', response.data.list)
  2061. this.employeList = response.data.list
  2062. cb(this.employeList)
  2063. })
  2064. },
  2065. handleSelectEmploye(item) {
  2066. console.log('责任人模糊查询选中值', item)
  2067. this.$set(this.createTemp, 'employeId', item.id)
  2068. this.$set(this.createTemp, 'employeName', item.name)
  2069. this.$forceUpdate()
  2070. },
  2071. form_see(row) {
  2072. console.log(row)
  2073. this.seeTemp = Object.assign({}, row) // copy obj
  2074. this.activeName = 'first'
  2075. this.dialogStatus = 'card'
  2076. this.dialogFormVisible_See = true
  2077. // 流程图
  2078. var reason = '未通过原因:' + this.seeTemp.workflowNote
  2079. if (this.seeTemp.SHStatus === 0) {
  2080. this.activeList = [{ title: '提交信息', date: this.seeTemp.inputDatetime, name: this.seeTemp.inputUserName }, { title: '设备中心审核' }]
  2081. this.active = 1
  2082. } else if (this.seeTemp.SHStatus === 1) {
  2083. this.activeList = [{ title: '提交信息', date: this.seeTemp.inputDatetime, name: this.seeTemp.inputUserName }, { title: '设备中心审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }]
  2084. this.active = 2
  2085. } else if (this.seeTemp.SHStatus === 2) {
  2086. this.activeList = [{ title: '提交信息', date: this.seeTemp.inputDatetime, name: this.seeTemp.inputUserName }, { title: '设备中心审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }]
  2087. this.active = 2
  2088. }
  2089. // 查看-点检记录
  2090. },
  2091. form_seeTabClick(val) {
  2092. console.log(val)
  2093. if (val.name == 'second') {
  2094. this.getAssetBigSpotCheckList()
  2095. } else if (val.name == 'third') {
  2096. this.getBigupkeepbyeqList()
  2097. } else if (val.name == 'fouth') {
  2098. this.getAssetMaintainList()
  2099. } else if (val.name == 'fifth') {
  2100. this.getAssetSTTList()
  2101. } else if (val.name == 'sixth') {
  2102. this.getAssetChangeList()
  2103. } else if (val.name == 'seventh') {
  2104. this.getAssetPartApplyList()
  2105. } else if (val.name == 'eighth') {
  2106. this.getBarChart1Parm.parammaps.eqId = this.seeTemp.id
  2107. this.getBarChart2Parm.parammaps.eqId = this.seeTemp.id
  2108. this.getChartSeeParm.parammaps.eqId = this.seeTemp.id
  2109. this.getBarChart1()
  2110. this.getBarChart2()
  2111. }
  2112. },
  2113. // 点检记录
  2114. getAssetBigSpotCheckList() {
  2115. this.listLoadingSpotCheck1 = true
  2116. if (this.$refs['inputDatetimeCheck1'] !== undefined && this.$refs['inputDatetimeCheck1'].value !== null) {
  2117. this.getAssetBigSpotCheckListParm.parammaps.startTime = this.$refs['inputDatetimeCheck1'].value[0]
  2118. this.getAssetBigSpotCheckListParm.parammaps.stopTime = this.$refs['inputDatetimeCheck1'].value[1]
  2119. } else {
  2120. this.getAssetBigSpotCheckListParm.parammaps.startTime = ''
  2121. this.getAssetBigSpotCheckListParm.parammaps.stopTime = ''
  2122. }
  2123. this.getAssetBigSpotCheckListParm.parammaps.assetId = this.seeTemp.assetId
  2124. this.getAssetBigSpotCheckListParm.parammaps.pastureId = this.seeTemp.pastureId
  2125. GetDataByName(this.getAssetBigSpotCheckListParm).then(response => {
  2126. console.log('点检记录-table数据', response.data.list)
  2127. if (response.data.list !== null) {
  2128. this.listSpotCheck1 = response.data.list
  2129. this.pageNumSpotCheck1 = response.data.pageNum
  2130. this.pageSizeSpotCheck1 = response.data.pageSize
  2131. } else {
  2132. this.listSpotCheck1 = []
  2133. }
  2134. this.totalSpotCheck1 = response.data.total
  2135. setTimeout(() => {
  2136. this.listLoadingSpotCheck1 = false
  2137. }, 100)
  2138. })
  2139. },
  2140. form_searchSportCheck() {
  2141. if (this.getAssetBigSpotCheckListParm.parammaps.inputDatetimeCheck1 == null) {
  2142. this.getAssetBigSpotCheckListParm.parammaps.inputDatetimeCheck1 = ''
  2143. }
  2144. this.getAssetBigSpotCheckListParm.offset = 1
  2145. this.getAssetBigSpotCheckList()
  2146. },
  2147. // 保养记录
  2148. getBigupkeepbyeqList() {
  2149. this.listLoadingSpotCheck1 = true
  2150. if (this.$refs['inputDatetimeUpkeepbyeq'] !== undefined && this.$refs['inputDatetimeUpkeepbyeq'].value !== null) {
  2151. this.getBigupkeepbyeqParm.parammaps.startTime = this.$refs['inputDatetimeUpkeepbyeq'].value[0]
  2152. this.getBigupkeepbyeqParm.parammaps.stopTime = this.$refs['inputDatetimeUpkeepbyeq'].value[1]
  2153. } else {
  2154. this.getBigupkeepbyeqParm.parammaps.startTime = ''
  2155. this.getBigupkeepbyeqParm.parammaps.stopTime = ''
  2156. }
  2157. this.getBigupkeepbyeqParm.parammaps.assetId = this.seeTemp.assetId
  2158. this.getBigupkeepbyeqParm.parammaps.pastureId = this.seeTemp.pastureId
  2159. GetDataByName(this.getBigupkeepbyeqParm).then(response => {
  2160. console.log('保养记录-table数据', response.data.list)
  2161. if (response.data.list !== null) {
  2162. this.listUpkeepbyeq = response.data.list
  2163. this.pageNumUpkeepbyeq = response.data.pageNum
  2164. this.pageSizeUpkeepbyeq = response.data.pageSize
  2165. } else {
  2166. this.listUpkeepbyeq = []
  2167. }
  2168. this.totalUpkeepbyeq = response.data.total
  2169. setTimeout(() => {
  2170. this.listLoadingSpotCheck1 = false
  2171. }, 100)
  2172. })
  2173. },
  2174. form_searchUpkeepbyeq() {
  2175. if (this.getBigupkeepbyeqParm.parammaps.inputDatetimeUpkeepbyeq === null) {
  2176. this.getBigupkeepbyeqParm.parammaps.inputDatetimeUpkeepbyeq = ''
  2177. }
  2178. this.getBigupkeepbyeqParm.offset = 1
  2179. this.getBigupkeepbyeqList()
  2180. },
  2181. // 维修记录
  2182. getAssetMaintainList() {
  2183. this.listLoadingAssetMaintain = true
  2184. if (this.$refs['inputDatetimeAssetMaintain'] !== undefined && this.$refs['inputDatetimeAssetMaintain'].value !== null) {
  2185. this.getAssetMaintainParm.parammaps.startTime = this.$refs['inputDatetimeAssetMaintain'].value[0]
  2186. this.getAssetMaintainParm.parammaps.stopTime = this.$refs['inputDatetimeAssetMaintain'].value[1]
  2187. } else {
  2188. this.getAssetMaintainParm.parammaps.startTime = ''
  2189. this.getAssetMaintainParm.parammaps.stopTime = ''
  2190. }
  2191. this.getAssetMaintainParm.parammaps.assetId = this.seeTemp.assetId
  2192. this.getAssetMaintainParm.parammaps.pastureId = this.seeTemp.pastureId
  2193. GetDataByName(this.getAssetMaintainParm).then(response => {
  2194. console.log('维修记录-tabile数据', response.data.list)
  2195. if (response.data.list !== null) {
  2196. this.listAssetMaintain = response.data.list
  2197. this.pageNumAssetMaintain = response.data.pageNum
  2198. this.pageSizeAssetMaintain = response.data.pageSize
  2199. } else {
  2200. this.listAssetMaintain = []
  2201. }
  2202. this.totalAssetMaintain = response.data.total
  2203. setTimeout(() => {
  2204. this.listLoadingAssetMaintain = false
  2205. }, 100)
  2206. })
  2207. },
  2208. form_searchAssetMaintain() {
  2209. if (this.getBigupkeepbyeqParm.parammaps.inputDatetimeAssetMaintan === null) {
  2210. this.getBigupkeepbyeqParm.parammaps.inputDatetimeAssetMaintan = ''
  2211. }
  2212. this.getBigupkeepbyeqParm.offset = 1
  2213. this.getAssetMaintainList()
  2214. },
  2215. // 启停记录
  2216. getAssetSTTList() {
  2217. this.listLoadingAssetSTT = true
  2218. this.getAssetSTTParm.parammaps.assetId = this.seeTemp.assetId
  2219. this.getAssetSTTParm.parammaps.pastureId = this.seeTemp.pastureId
  2220. GetDataByName(this.getAssetSTTParm).then(response => {
  2221. console.log('启停记录-tabile数据', response.data.list)
  2222. if (response.data.list !== null) {
  2223. this.listAssetSTT = response.data.list
  2224. this.pageNumAssetSTT = response.data.pageNum
  2225. this.pageSizeAssetSTT = response.data.pageSize
  2226. } else {
  2227. this.listAssetSTT = []
  2228. }
  2229. this.totalAssetSTT = response.data.total
  2230. setTimeout(() => {
  2231. this.listLoadingAssetSTT = false
  2232. }, 100)
  2233. })
  2234. },
  2235. form_searchAssetSTT() {
  2236. if (this.getAssetSTTParm.parammaps.startTime == null) {
  2237. this.getAssetSTTParm.parammaps.startTime = ''
  2238. }
  2239. if (this.getAssetSTTParm.parammaps.stopTime == null) {
  2240. this.getAssetSTTParm.parammaps.stopTime = ''
  2241. }
  2242. this.getAssetSTTParm.offset = 1
  2243. this.getAssetSTTList()
  2244. },
  2245. // 变更记录
  2246. getAssetChangeList() {
  2247. this.listLoadingAssetChange = true
  2248. console.log(this.$refs['inputDatetimeAssetChange'])
  2249. if (this.$refs['inputDatetimeAssetChange'] !== undefined && this.$refs['inputDatetimeAssetChange'].value !== null) {
  2250. this.getAssetChangeParm.parammaps.startTime = this.$refs['inputDatetimeAssetChange'].value[0]
  2251. this.getAssetChangeParm.parammaps.stopTime = this.$refs['inputDatetimeAssetChange'].value[1]
  2252. } else {
  2253. this.getAssetChangeParm.parammaps.startTime = ''
  2254. this.getAssetChangeParm.parammaps.stopTime = ''
  2255. }
  2256. this.getAssetChangeParm.parammaps.assetId = this.seeTemp.assetId
  2257. this.getAssetChangeParm.parammaps.pastureId = this.seeTemp.pastureId
  2258. GetDataByName(this.getAssetChangeParm).then(response => {
  2259. console.log('变更记录-tabile数据', response.data.list)
  2260. if (response.data.list !== null) {
  2261. this.listAssetChange = response.data.list
  2262. this.pageNumAssetChange = response.data.pageNum
  2263. this.pageSizeAssetChange = response.data.pageSize
  2264. } else {
  2265. this.listAssetChange = []
  2266. }
  2267. this.totalAssetChange = response.data.total
  2268. setTimeout(() => {
  2269. this.listLoadingAssetChange = false
  2270. }, 100)
  2271. })
  2272. },
  2273. form_searchAssetChange() {
  2274. if (this.getAssetChangeParm.parammaps.inputDatetimeAssetChange === null) {
  2275. this.getAssetChangeParm.parammaps.inputDatetimeAssetChange = ''
  2276. }
  2277. this.getAssetChangeParm.offset = 1
  2278. this.getAssetChangeList()
  2279. },
  2280. changeStatue: function(cellValue) {
  2281. if (cellValue.changeStatue == 17) {
  2282. return '正常'
  2283. } else if (cellValue.changeStatue == 18) {
  2284. return '闲置'
  2285. } else if (cellValue.changeStatue == 19) {
  2286. return '报废'
  2287. } else if (cellValue.changeStatue == 20) {
  2288. return '封存'
  2289. }
  2290. },
  2291. // 备件领用记录
  2292. getAssetPartApplyList() {
  2293. this.listLoadingAssetChange = true
  2294. console.log(this.$refs['inputDatetimeAssetPartApply'].value)
  2295. if (this.$refs['inputDatetimeAssetPartApply'] !== undefined && this.$refs['inputDatetimeAssetPartApply'].value !== null && this.$refs['inputDatetimeAssetPartApply'].value !== '') {
  2296. this.getAssetPartApplyParm.parammaps.startTime = this.$refs['inputDatetimeAssetPartApply'].value[0]
  2297. this.getAssetPartApplyParm.parammaps.stopTime = this.$refs['inputDatetimeAssetPartApply'].value[1]
  2298. } else {
  2299. this.getAssetPartApplyParm.parammaps.startTime = ''
  2300. this.getAssetPartApplyParm.parammaps.stopTime = ''
  2301. }
  2302. this.getAssetPartApplyParm.parammaps.assetId = this.seeTemp.assetId
  2303. this.getAssetPartApplyParm.parammaps.pastureId = this.seeTemp.pastureId
  2304. GetDataByName(this.getAssetPartApplyParm).then(response => {
  2305. console.log('备件领用记录-tabile数据', response.data.list)
  2306. if (response.data.list !== null) {
  2307. this.listAssetPartApply = response.data.list
  2308. this.pageNumAssetPartApply = response.data.pageNum
  2309. this.pageSizeAssetPartApply = response.data.pageSize
  2310. } else {
  2311. this.listAssetPartApply = []
  2312. }
  2313. this.totalAssetPartApply = response.data.total
  2314. setTimeout(() => {
  2315. this.listLoadingAssetPartApply = false
  2316. }, 100)
  2317. })
  2318. },
  2319. form_searchAssetPartApply() {
  2320. this.listLoadingAssetChange = true
  2321. if (this.getAssetPartApplyParm.parammaps.inputDatetimeAssetChange == null) {
  2322. this.getAssetPartApplyParm.parammaps.inputDatetimeAssetChange = ''
  2323. }
  2324. this.getAssetPartApplyParm.offset = 1
  2325. this.getAssetPartApplyList()
  2326. },
  2327. getBarChart1() {
  2328. GetReportform(this.getBarChart1Parm).then(response => {
  2329. console.log('图1', response)
  2330. this.chart_data1 = response.data.chart_data
  2331. var repireCost = response.data.chart_data.repireCost
  2332. var upkeepCost = response.data.chart_data.upkeepCost
  2333. var totaltitle1 = 0
  2334. if (repireCost !== null || repireCost !== undefined) {
  2335. repireCost.forEach(function(item, index) {
  2336. console.log(parseFloat(item))
  2337. totaltitle1 = totaltitle1 + parseFloat(item)
  2338. })
  2339. }
  2340. var totaltitle2 = 0
  2341. if (upkeepCost !== null || upkeepCost !== undefined) {
  2342. upkeepCost.forEach(function(item, index) {
  2343. console.log(parseFloat(item))
  2344. totaltitle2 = totaltitle2 + parseFloat(item)
  2345. })
  2346. }
  2347. this.totaltitle = totaltitle1 + totaltitle2
  2348. this.roadBarChart1(this.chart_data1, this.totaltitle.toFixed(2))
  2349. })
  2350. },
  2351. roadBarChart1(chart_data1, totaltitle) {
  2352. console.log(chart_data1, totaltitle)
  2353. if (this.barChart1 != null) {
  2354. this.barChart1.dispose()
  2355. }
  2356. this.barChart1 = echarts.init(document.getElementById('barChart1'))
  2357. var option = {
  2358. title: { text: '年度费用统计(总费用:' + totaltitle + '元)', textStyle: { color: '#769cfc' }},
  2359. tooltip: {
  2360. trigger: 'axis',
  2361. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  2362. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  2363. },
  2364. formatter: function(data) {
  2365. console.log(data.length)
  2366. var value = 0
  2367. let val = ''
  2368. if (data.length == 1) {
  2369. val += data[0].seriesName + ':' + data[0].data + '元<br/>'
  2370. } else {
  2371. value = (parseFloat(data[0].value) + parseFloat(data[1].value)).toFixed(2)
  2372. // eslint-disable-next-line no-unused-vars
  2373. val = data[0].name + '年设备总费用:' + value + '元' + '<br/>'
  2374. val += '维修费用:' + data[0].data + '元<br/>'
  2375. val += '保养费用:' + data[1].data + '元<br/>'
  2376. }
  2377. return val
  2378. }
  2379. },
  2380. legend: {
  2381. data: ['维修费用', '保养费用'],
  2382. x: 'right'
  2383. },
  2384. color: ['#769cfc', '#42b983'],
  2385. grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
  2386. xAxis: [
  2387. { type: 'category', data: this.chart_data1.year }
  2388. ],
  2389. yAxis: [
  2390. { type: 'value', name: '费用(元)' }
  2391. ],
  2392. series: [
  2393. { name: '维修费用', type: 'bar', barWidth: 60, stack: '广告', data: this.chart_data1.repireCost },
  2394. { name: '保养费用', type: 'bar', barWidth: 60, stack: '广告', data: this.chart_data1.upkeepCost }
  2395. ]
  2396. }
  2397. this.barChart1.setOption(option)
  2398. var that = this
  2399. window.onresize = function() {
  2400. that.barChart1.resize()
  2401. }
  2402. this.barChart1.on('click', function(param, i) {
  2403. console.log(param)
  2404. that.getBarChart2Parm.parammaps.receiveTime = param.name
  2405. that.getBarChart2()
  2406. that.getBarChart1()
  2407. })
  2408. },
  2409. getBarChart2() {
  2410. GetReportform(this.getBarChart2Parm).then(response => {
  2411. console.log('图2', response)
  2412. this.chart_data2 = response.data.chart_data
  2413. this.roadBarChart2(this.chart_data2)
  2414. })
  2415. },
  2416. roadBarChart2(chart_data1) {
  2417. if (this.barChart2 != null) {
  2418. this.barChart2.dispose()
  2419. }
  2420. this.barChart2 = echarts.init(document.getElementById('barChart2'))
  2421. var option = {
  2422. title: { text: this.getBarChart2Parm.parammaps.receiveTime + '年月度费用统计', textStyle: { color: '#769cfc' }},
  2423. tooltip: {
  2424. trigger: 'axis',
  2425. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  2426. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  2427. },
  2428. formatter: function(data) {
  2429. console.log(data)
  2430. var value = 0
  2431. var val = ''
  2432. if (data.length == 1) {
  2433. val += data[0].seriesName + ':' + data[0].data + '元<br/>'
  2434. } else {
  2435. value = (parseFloat(data[0].value) + parseFloat(data[1].value)).toFixed(2)
  2436. val = data[0].name + '月设备总费用:' + value + '元' + '<br/>'
  2437. val += '维修费用:' + data[0].data + '元<br/>'
  2438. val += '保养费用:' + data[1].data + '元<br/>'
  2439. }
  2440. return val
  2441. }
  2442. },
  2443. legend: {
  2444. data: ['维修费用', '保养费用'],
  2445. x: 'right'
  2446. },
  2447. color: ['#769cfc', '#42b983'],
  2448. grid: {
  2449. left: '3%',
  2450. right: '4%',
  2451. bottom: '3%',
  2452. containLabel: true
  2453. },
  2454. xAxis: [
  2455. { type: 'category', data: this.chart_data2.months }
  2456. ],
  2457. yAxis: [
  2458. { type: 'value', name: '费用(元)' }
  2459. ],
  2460. series: [
  2461. { name: '维修费用', type: 'bar', stack: '广告', data: this.chart_data2.repireCost },
  2462. { name: '保养费用', type: 'bar', stack: '广告', data: this.chart_data2.upkeepCost }
  2463. ]
  2464. }
  2465. this.barChart2.setOption(option)
  2466. var that = this
  2467. window.onresize = function() {
  2468. that.barChart2.resize()
  2469. }
  2470. this.barChart2.on('click', function(param, i) {
  2471. console.log(param)
  2472. that.dialogFormVisible_ChartSee = true
  2473. that.dialogStatus = 'card'
  2474. that.getChartSeeParm.parammaps.receiveTime = param.name
  2475. that.getChartSeeList()
  2476. that.getBarChart1()
  2477. that.getBarChart2()
  2478. })
  2479. },
  2480. getChartSeeList() {
  2481. this.listLoadingChartSee = true
  2482. if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
  2483. this.getChartSeeParm.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
  2484. this.getChartSeeParm.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
  2485. } else {
  2486. this.getChartSeeParm.parammaps.startTime = ''
  2487. this.getChartSeeParm.parammaps.stopTime = ''
  2488. }
  2489. GetDataByName(this.getChartSeeParm).then(response => {
  2490. console.log('table数据', response.data.list)
  2491. if (response.data.list !== null) {
  2492. this.listChartSee = response.data.list
  2493. this.pageNumChartSee = response.data.pageNum
  2494. this.pageSizeChartSee = response.data.pageSize
  2495. if (response.data.total) {
  2496. this.totalChartSee = response.data.total
  2497. }
  2498. } else {
  2499. this.listChartSee = []
  2500. }
  2501. setTimeout(() => {
  2502. this.listLoadingChartSee = false
  2503. }, 100)
  2504. })
  2505. },
  2506. form_searchChartSee() {
  2507. this.listLoadingChartSee = true
  2508. if (this.getChartSeeParm.parammaps.inputDatetime2 === null) {
  2509. this.getChartSeeParm.parammaps.inputDatetime2 = ''
  2510. }
  2511. this.getChartSeeParm.offset = 1
  2512. this.getChartSeeList()
  2513. },
  2514. handleDownloadChartSee() {
  2515. this.$alert('正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2516. this.isPercentage = true
  2517. this.percentage = 1
  2518. var timer = setInterval(() => {
  2519. this.percentage += 5
  2520. if (this.percentage > 95) {
  2521. this.percentage = 99
  2522. clearInterval(timer)
  2523. }
  2524. this.percentage = this.percentage
  2525. }, 1000)
  2526. this.downLoadParm2.name = 'getEqPartuseDetailList'
  2527. this.downLoadParm2.returntype = 'Map'
  2528. this.downLoadParm2.parammaps = this.getChartSeeParm.parammaps
  2529. GetAccount(this.downLoadParm2).then(response => {
  2530. this.$nextTick(() => {
  2531. this.downLoadList2 = response.data.list
  2532. if (response.data.list !== '') {
  2533. this.percentage = 99
  2534. setTimeout(() => {
  2535. this.isPercentage = false
  2536. }, 2000)
  2537. }
  2538. console.log(this.downLoadList2)
  2539. const ExcelDatas = [
  2540. {
  2541. tHeader: ['类型', '单号', '领用日期', '领用部门', '备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', '出库数量', '退库数量', '单价', '总价'],
  2542. filterVal: ['useTypeV', 'RUcode', 'creatTime', 'departmentName', 'partCode', 'partName', 'specification', 'brandName', 'unit', 'checkoutNumber', 'quitNumber', 'price', 'sumPrice'],
  2543. tableDatas: this.downLoadList2,
  2544. sheetName: '费用统计'
  2545. }
  2546. ]
  2547. json2excel(ExcelDatas, '费用统计', true, 'xlsx')
  2548. })
  2549. })
  2550. },
  2551. form_delete(row) {
  2552. MessageBox.confirm('确认删除此信息?', {
  2553. confirmButtonText: '确认',
  2554. cancelButtonText: '取消',
  2555. type: 'warning'
  2556. }).then(() => {
  2557. this.requestParam.name = 'deleteAsset'
  2558. this.requestParam.parammaps = {}
  2559. this.requestParam.parammaps['id'] = row.id
  2560. PostDataByName(this.requestParam).then(() => {
  2561. if (this.getdataListParm.parammaps.inputDatetime1 === null) {
  2562. this.getdataListParm.parammaps.inputDatetime1 = ''
  2563. }
  2564. this.getList()
  2565. this.getListSH()
  2566. this.dialogFormVisible = false
  2567. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  2568. })
  2569. }).catch(() => {
  2570. this.$message({ type: 'info', message: '已取消删除' })
  2571. })
  2572. },
  2573. getDownClassList() {
  2574. getRecuData(this.getRecuListParm).then(response => {
  2575. this.parentClass = response.data
  2576. })
  2577. },
  2578. getEQNumber() {
  2579. this.getdataEQNumber.parammaps.pastureId = Cookies.get('pastureid')
  2580. GetDataByName(this.getdataEQNumber).then(response => {
  2581. this.createTemp.assetCode = response.data.list[0].createNumber
  2582. console.log(response.data.list[0].createNumber)
  2583. console.log(this.createTemp.assetCode)
  2584. this.$forceUpdate()
  2585. })
  2586. },
  2587. handleTabClick(val) {
  2588. console.log('点击了基础信息/审核设备tab', val)
  2589. if (val.name == 'first') {
  2590. this.isFlowChart = false
  2591. this.isDisplayRecord = true
  2592. } else {
  2593. this.isFlowChart = true
  2594. this.isDisplayRecord = false
  2595. }
  2596. this.getList()
  2597. this.getListSH()
  2598. },
  2599. handleExamine(row) {
  2600. if (row == undefined) {
  2601. this.examineTemp = this.seeTemp
  2602. this.$set(this.seeTemp, 'SHstatue', 1)
  2603. this.$set(this.seeTemp, 'workflowNote', '')
  2604. } else {
  2605. this.examineTemp = Object.assign({}, row)
  2606. this.$set(this.examineTemp, 'SHstatue', 1)
  2607. this.$set(this.examineTemp, 'workflowNote', '')
  2608. }
  2609. this.dialogStatus = 'examine'
  2610. this.dialogFormVisible_Examine = true
  2611. this.statueReason = false
  2612. this.keyupSubmit()
  2613. },
  2614. changeSHStatue(val) {
  2615. if (val == 2) {
  2616. this.statueReason = true
  2617. } else {
  2618. this.statueReason = false
  2619. }
  2620. },
  2621. keyupSubmit() {
  2622. document.onkeydown = e => {
  2623. const _key = window.event.keyCode
  2624. if (_key === 13) {
  2625. this.createExamineData()
  2626. }
  2627. }
  2628. },
  2629. createExamineData() {
  2630. if (this.dialogStatus !== 'update' && this.dialogStatus !== 'create') {
  2631. this.isokDisable = true
  2632. setTimeout(() => {
  2633. this.isokDisable = false
  2634. }, 1000)
  2635. this.$refs['examineTemp'].validate(valid => {
  2636. if (valid) {
  2637. this.requestParam.name = 'eqCharge'
  2638. this.requestParam.parammaps = {}
  2639. this.requestParam.parammaps.id = this.examineTemp.id
  2640. if (this.examineTemp.SHstatue == 1) {
  2641. this.requestParam.parammaps.statue = 1
  2642. } else {
  2643. this.requestParam.parammaps.statue = 2
  2644. }
  2645. this.requestParam.parammaps.empId = Cookies.get('employeid')
  2646. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  2647. PostDataByName(this.requestParam).then(response => {
  2648. console.log('审核确认发送参数', this.requestParam)
  2649. if (response.msg !== 'fail') {
  2650. this.dialogFormVisible_Examine = false
  2651. this.dialogFormVisible_See = false
  2652. this.statueReason = false
  2653. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  2654. this.getListSH()
  2655. this.getList()
  2656. this.activeName == 'second'
  2657. } else {
  2658. failproccess(response, this.$notify)
  2659. }
  2660. })
  2661. }
  2662. })
  2663. }
  2664. },
  2665. handleDownload() {
  2666. this.$alert('设备基础信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2667. this.isPercentage = true
  2668. this.percentage = 1
  2669. var timer = setInterval(() => {
  2670. this.percentage += 5
  2671. if (this.percentage > 95) {
  2672. this.percentage = 99
  2673. clearInterval(timer)
  2674. }
  2675. this.percentage = this.percentage
  2676. }, 1000)
  2677. this.downLoadParm.name = 'getAssetList'
  2678. this.downLoadParm.parammaps = this.getdataListParm.parammaps
  2679. GetAccount(this.downLoadParm).then(response => {
  2680. this.downLoadList = response.data.list
  2681. if (response.data.list !== '') {
  2682. this.percentage = 99
  2683. setTimeout(() => {
  2684. this.isPercentage = false
  2685. }, 2000)
  2686. }
  2687. console.log(this.downLoadList)
  2688. const elecExcelDatas = [
  2689. {
  2690. tHeader: ['牧场','设备类别', '资产编号', '设备名称', '设备内部编号', '设备规格', '品牌', '供应商', '用途', '状态', '购置日期', '入场日期', '折旧年限', '财务编号', '原值', '残值', '月核减值', '保养级别', '保养费用', '维修费用', '基数(小时)', '部门', '责任人', '录入人', '录入时间', '使用时长(年)', '使用率(%)'],
  2691. filterVal: ['pastureName','eqClassName', 'assetCode', 'eqName', 'eqCode', 'specification', 'brandName', 'providerName', 'purpose', 'status', 'purchaseDate', 'entranceDate', 'depreciation', 'financeCode', 'yuanzhi', 'salvage', 'subtractvalue', 'upkeepgrade', 'yearUpkeepCost', 'yearMaintainCost', 'baseHours', 'deptName', 'employeName', 'inputUserName', 'inputDatetime', 'serviceDuration', 'utilizationRate'],
  2692. tableDatas: this.downLoadList,
  2693. sheetName: '设备基础信息'
  2694. }
  2695. ]
  2696. json2excel(elecExcelDatas, '设备基础信息', true, 'xlsx')
  2697. })
  2698. },
  2699. handleDownloadSH() {
  2700. this.$alert('设备基础信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2701. this.isPercentage = true
  2702. this.percentage = 1
  2703. var timer = setInterval(() => {
  2704. this.percentage += 5
  2705. if (this.percentage > 95) {
  2706. this.percentage = 99
  2707. clearInterval(timer)
  2708. }
  2709. this.percentage = this.percentage
  2710. }, 1000)
  2711. this.downLoadParm.name = 'getAssetListSH'
  2712. this.downLoadParm.parammaps = this.getdataListParmSH.parammaps
  2713. GetAccount(this.downLoadParm).then(response => {
  2714. this.downLoadList = response.data.list
  2715. if (response.data.list !== '') {
  2716. this.percentage = 99
  2717. setTimeout(() => {
  2718. this.isPercentage = false
  2719. }, 2000)
  2720. }
  2721. console.log(this.downLoadList)
  2722. const elecExcelDatas = [
  2723. {
  2724. tHeader: ['设备类别', '资产编号', '设备名称', '设备内部编号', '设备规格', '品牌', '供应商', '用途', '状态', '购置日期', '入场日期', '折旧年限', '财务编号', '原值', '残值', '月核减值', '保养级别', '保养费用', '维修费用', '基数(小时)', '牧场', '部门', '责任人', '录入人', '录入时间'],
  2725. filterVal: ['eqClassName', 'assetCode', 'eqName', 'eqCode', 'specification', 'brandName', 'providerName', 'purpose', 'status', 'purchaseDate', 'entranceDate', 'depreciation', 'financeCode', 'yuanzhi', 'salvage', 'subtractvalue', 'upkeepgrade', 'yearUpkeepCost', 'yearMaintainCost', 'baseHours', 'pastureName', 'deptName', 'employeName', 'inputUserName', 'inputDatetime'],
  2726. tableDatas: this.downLoadList,
  2727. sheetName: '设备基础信息'
  2728. }
  2729. ]
  2730. json2excel(elecExcelDatas, '设备基础信息', true, 'xlsx')
  2731. })
  2732. },
  2733. handleSelectionChange(item) {
  2734. this.selectionList = item
  2735. },
  2736. handleBatchChange() {
  2737. if (this.selectionList.length > 0) {
  2738. for (let i = 0; i < this.selectionList.length; i++) {
  2739. if (this.selectionList[i].pastureId !== this.selectionList[0].pastureId) {
  2740. this.$message({ type: 'error', message: '请检测变更牧场是否一致!', duration: 2000 })
  2741. return false
  2742. }
  2743. }
  2744. console.log('批量变更')
  2745. this.batchChange.temp.departmentId = ''
  2746. this.batchChange.temp.employeeId = ''
  2747. this.batchChange.deptList = []
  2748. this.batchChange.personList = []
  2749. this.dialogFormVisible_change = true
  2750. this.dialogStatus = 'change'
  2751. this.batchChange.getdataListParmDept.parammaps.pastureId = this.selectionList[0].pastureId
  2752. this.getBatchChangeDeptDownList()
  2753. } else {
  2754. this.$message({ type: 'error', message: '请选择变更牧场', duration: 2000 })
  2755. }
  2756. },
  2757. getBatchChangeDeptDownList() {
  2758. GetDataByName(this.batchChange.getdataListParmDept).then(response => {
  2759. if (response.data.list !== null) {
  2760. this.batchChange.deptList = response.data.list
  2761. } else {
  2762. this.batchChange.deptList = []
  2763. }
  2764. })
  2765. },
  2766. changeBatchDept(item) {
  2767. console.log(item)
  2768. this.batchChange.getdataListParmPerson.parammaps.deptId = item
  2769. this.batchChange.temp.employeeId = ''
  2770. this.batchChange.getdataListParmPerson.parammaps.pastureId = this.batchChange.deptList.find(obj => obj.deptid == item).pastureId
  2771. this.getBatchChangePersonDownList()
  2772. },
  2773. getBatchChangePersonDownList() {
  2774. GetDataByName(this.batchChange.getdataListParmPerson).then(response => {
  2775. if (response.data.list !== null) {
  2776. this.batchChange.personList = response.data.list
  2777. } else {
  2778. this.batchChange.personList = []
  2779. }
  2780. })
  2781. },
  2782. changeBatchPerson(item) {
  2783. console.log(item)
  2784. this.batchChange.temp.employeeId = item
  2785. this.batchChange.temp.employeName = this.batchChange.personList.find(obj => obj.id == item).empname
  2786. this.$forceUpdate()
  2787. },
  2788. changeData() {
  2789. this.isokDisable = true
  2790. setTimeout(() => {
  2791. this.isokDisable = false
  2792. }, 1000)
  2793. this.$refs['batchChangeTemp'].validate(valid => {
  2794. if (valid) {
  2795. this.requestParam = {}
  2796. var array = []
  2797. for (let i = 0; i < this.selectionList.length; i++) {
  2798. var obj = {}
  2799. var parammaps = {}
  2800. obj.name = 'updateEquipmentALL'
  2801. obj.offset = 0
  2802. obj.pagecount = 0
  2803. parammaps.departmentId = this.batchChange.temp.departmentId
  2804. parammaps.employeeId = this.batchChange.temp.employeeId
  2805. parammaps.employeName = this.batchChange.temp.employeName
  2806. parammaps.id = this.selectionList[i].id
  2807. obj.parammaps = parammaps
  2808. array.push(obj)
  2809. }
  2810. this.requestParam.array = array
  2811. PostDataByNames(this.requestParam).then(response => {
  2812. if (response.msg !== 'fail') {
  2813. this.dialogFormVisible_change = false
  2814. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  2815. this.getList()
  2816. } else {
  2817. failproccess(response, this.$notify)
  2818. }
  2819. })
  2820. }
  2821. })
  2822. }
  2823. }
  2824. }
  2825. </script>
  2826. <style lang="scss" scoped>
  2827. .el-autocomplete-suggestion li{
  2828. padding:0 3px!important;
  2829. }
  2830. .el-table .warning-row {
  2831. background: oldlace;
  2832. }
  2833. .el-table .success-row {
  2834. background: #f0f9eb;
  2835. }
  2836. </style>
  2837. <style lang="scss">
  2838. .upkeepgrade .el-form-item__label{
  2839. line-height: 20px;
  2840. }
  2841. .inputDatetime .el-range-separator{
  2842. padding: 0;
  2843. margin: 0 10px;
  2844. }
  2845. .el-radio__label{
  2846. padding-left: 2px !important;
  2847. }
  2848. </style>
  2849. <style>
  2850. .el-table .goBeyond { background: #F47C7C ; }
  2851. .el-table .warning { background: #989DF0; }
  2852. .el-table .scrap { background: #D7D7D7; }
  2853. </style>