index1.vue 139 KB

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