index.vue 84 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063
  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-input v-model="getdataListParm.parammaps.partCode" placeholder="备件编号" style="width: 200px;" class="filter-item" />
  11. <el-input v-model="getdataListParm.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
  12. <el-input v-model="getdataListParm.parammaps.specification" placeholder="备件规格" style="width: 200px;" class="filter-item" />
  13. <tree-select
  14. class="typeSelect"
  15. :height="150"
  16. :width="250"
  17. size="small"
  18. clearable
  19. :data="parentDept"
  20. :disabled="disabled"
  21. :placeholder="placeholder"
  22. style="display:inline-block;"
  23. :default-props="defaultProps"
  24. :node-key="nodeKey"
  25. :checked-keys="defaultCheckedKeys"
  26. @popoverHide="popoverHide"
  27. />
  28. <el-date-picker
  29. ref="inputDatetime"
  30. v-model="getdataListParm.parammaps.inputDatetime"
  31. class="inputDatetime"
  32. type="datetimerange"
  33. style="width: 250px;top:-3px;"
  34. format="yyyy-MM-dd"
  35. value-format="yyyy-MM-dd"
  36. range-separator="至"
  37. start-placeholder="审批时间"
  38. end-placeholder="审批时间"
  39. />
  40. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  41. <div>
  42. <el-button v-if="isBasicAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
  43. <el-button v-if="isBasicTemplate" v-waves class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">模板</el-button>
  44. <el-button v-if="isDisable" v-waves class="filter-item" type="danger" icon="el-icon-remove-outline" @click="handleBatchDisable">批量禁用</el-button>
  45. <el-button v-if="isEnable" v-waves class="filter-item" type="danger" icon="el-icon-success" @click="handleBatchEnable">批量启用</el-button>
  46. <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
  47. <el-button v-if="isBasicImport" v-waves class="filter-item" type="warning" icon="el-icon-download" @click="form_search">导入</el-button>
  48. </el-upload>
  49. <el-button v-if="isBasicExport" v-waves class="filter-item" type="success" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
  50. <el-button v-if="isEasSynchronization" class="filter-item" type="primary" style="float: right;" @click="handleEAS">EAS同步</el-button>
  51. </div>
  52. </div>
  53. <el-table
  54. :key="tableKey"
  55. v-loading="listLoading"
  56. element-loading-text="给我一点时间"
  57. :data="list"
  58. border
  59. fit
  60. highlight-current-row
  61. style="width: 100%;"
  62. :row-style="rowStyle"
  63. :cell-style="cellStyle"
  64. class="elTable table-fixed"
  65. @selection-change="handleSelectionChange2"
  66. >
  67. <el-table-column type="selection" width="55"></el-table-column>
  68. <el-table-column label="序号" align="center" type="index" width="50px">
  69. <template slot-scope="scope">
  70. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="备件编号" min-width="110px" align="center">
  74. <template slot-scope="scope">
  75. <span>{{ scope.row.partCode }}</span>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="备件名称" min-width="110px" align="center">
  79. <template slot-scope="scope">
  80. <span>{{ scope.row.partName }}</span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="备件规格" min-width="110px" align="center">
  84. <template slot-scope="scope">
  85. <span>{{ scope.row.specification }}</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="计量单位" min-width="60px" align="center">
  89. <template slot-scope="scope">
  90. <span>{{ scope.row.unit }}</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="备件类别" min-width="110px" align="center">
  94. <template slot-scope="scope">
  95. <span>{{ scope.row.eqClassName1 }}/{{ scope.row.eqClassName2 }}/{{ scope.row.eqClassName3 }}</span>
  96. </template>
  97. </el-table-column>
  98. <!-- <el-table-column label="录入时间" min-width="110px" align="center">
  99. <template slot-scope="scope">
  100. <span>{{ scope.row.createTime }}</span>
  101. </template>
  102. </el-table-column> -->
  103. <el-table-column label="审批时间" sortable prop="chargeDate" min-width="110px" align="center" />
  104. <el-table-column label="录入人" min-width="110px" align="center">
  105. <template slot-scope="scope">
  106. <span>{{ scope.row.createPerson }}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="备件图片" min-width="110px" align="center">
  110. <template slot-scope="scope">
  111. <el-popover placement="right" title="" trigger="hover">
  112. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  113. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  114. </el-popover>
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="备件库存" min-width="120px" align="center">
  118. <template slot-scope="scope">
  119. <span>{{ scope.row.reportery }}</span>
  120. </template>
  121. </el-table-column>
  122. <el-table-column label="操作" align="center" width="350px" class-name="small-padding fixed-width" fixed="right">
  123. <template slot-scope="{row}">
  124. <el-button v-if="isBasicSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
  125. <el-button v-if="isBasicEditTab1 && row.enable == 1" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  126. <el-button v-if="isDisable && row.enable == 1" type="danger" size="mini" @click="handleDisable(row)">禁用</el-button>
  127. <el-button v-if="isEnable && row.enable == 0" type="danger" size="mini" @click="handleEnable(row)">启用</el-button>
  128. <el-button v-if="isBasicDelete1 && row.enable == 1" type="danger" size="mini" @click="handleDelate(row)">删除</el-button>
  129. </template>
  130. </el-table-column>
  131. </el-table>
  132. <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
  133. </el-tab-pane>
  134. <el-tab-pane v-if="isBasicSH" label="审核备件" name="second">
  135. <div class="filter-container">
  136. <el-input v-model="getdataListParmSH.parammaps.partCode" placeholder="备件编号" style="width: 200px;" class="filter-item" />
  137. <el-input v-model="getdataListParmSH.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
  138. <el-input v-model="getdataListParmSH.parammaps.specification" placeholder="备件规格" style="width: 200px;" class="filter-item" />
  139. <tree-select
  140. class="typeSelect"
  141. :height="150"
  142. :width="250"
  143. size="small"
  144. clearable
  145. :data="parentDept"
  146. :disabled="disabled"
  147. :placeholder="placeholder"
  148. style="display:inline-block;"
  149. :default-props="defaultProps"
  150. :node-key="nodeKey"
  151. :checked-keys="defaultCheckedKeys"
  152. @popoverHide="popoverHide"
  153. />
  154. <el-select v-model="getdataListParmSH.parammaps.statue" style="width: 120px;" clearable placeholder="审核状态" class="filter-item">
  155. <el-option v-for="item in statues" :key="item.id" :label="item.name" :value="item.id" />
  156. </el-select>
  157. <el-date-picker
  158. ref="inputDatetimeSH"
  159. v-model="getdataListParmSH.parammaps.inputDatetimeSH"
  160. class="inputDatetime"
  161. type="datetimerange"
  162. style="width: 250px;top:-3px;"
  163. format="yyyy-MM-dd"
  164. value-format="yyyy-MM-dd"
  165. range-separator="至"
  166. start-placeholder="开始日期"
  167. end-placeholder="结束日期"
  168. />
  169. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_searchSH">搜索</el-button>
  170. <div>
  171. <el-button v-if="isBasicExamine" class="filter-item" type="primary" @click="handleExamines">批量审批</el-button>
  172. </div>
  173. </div>
  174. <el-table
  175. :key="tableKey"
  176. v-loading="listLoadingSH"
  177. element-loading-text="给我一点时间"
  178. :data="listSH"
  179. border
  180. fit
  181. highlight-current-row
  182. style="width: 100%;"
  183. :row-style="rowStyle"
  184. :cell-style="cellStyle"
  185. class="elTable table-fixed"
  186. @selection-change="handleSelectionChange"
  187. >
  188. <el-table-column type="selection" width="55" />
  189. <el-table-column label="序号" align="center" type="index" width="50px">
  190. <template slot-scope="scope">
  191. <span>{{ scope.$index + (pageNumSH-1) * pageSizeSH + 1 }}</span>
  192. </template>
  193. </el-table-column>
  194. <el-table-column label="备件编号" min-width="130px" align="center">
  195. <template slot-scope="scope">
  196. <span>{{ scope.row.partCode }}</span>
  197. </template>
  198. </el-table-column>
  199. <el-table-column label="备件名称" min-width="110px" align="center">
  200. <template slot-scope="scope">
  201. <span>{{ scope.row.partName }}</span>
  202. </template>
  203. </el-table-column>
  204. <el-table-column label="备件规格" min-width="110px" align="center">
  205. <template slot-scope="scope">
  206. <span>{{ scope.row.specification }}</span>
  207. </template>
  208. </el-table-column>
  209. <el-table-column label="计量单位" min-width="60px" align="center">
  210. <template slot-scope="scope">
  211. <span>{{ scope.row.unit }}</span>
  212. </template>
  213. </el-table-column>
  214. <el-table-column label="备件类别" min-width="150px" align="center">
  215. <template slot-scope="scope">
  216. <span>{{ scope.row.eqClassName1 }}/{{ scope.row.eqClassName2 }}/{{ scope.row.eqClassName3 }}</span>
  217. </template>
  218. </el-table-column>
  219. <el-table-column label="审核状态" min-width="130px" align="center" :formatter="statue" />
  220. <el-table-column label="审批时间" sortable prop="chargeDate" min-width="110px" align="center" />
  221. <el-table-column label="备件图片" min-width="110px" align="center">
  222. <template slot-scope="scope">
  223. <el-popover placement="right" title="" trigger="hover">
  224. <img :src="scope.row.picpath">
  225. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  226. </el-popover>
  227. </template>
  228. </el-table-column>
  229. <el-table-column label="录入人" min-width="100px" align="center">
  230. <template slot-scope="scope">
  231. <span>{{ scope.row.createPerson }}</span>
  232. </template>
  233. </el-table-column>
  234. <el-table-column label="操作" align="center" width="300px" class-name="small-padding fixed-width" fixed="right">
  235. <template slot-scope="{row}">
  236. <el-button v-if="isBasicSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
  237. <!-- 编辑 -->
  238. <el-button v-if="isBasicEdit && row.statue==2" type="success" style="display:inline-block" size="mini" @click="form_edit(row)">编辑</el-button>
  239. <el-button v-else type="success" style="display:none" size="mini" @click="form_edit(row)">编辑</el-button>
  240. <el-button v-if="isBasicExamine && row.statue == 0" style="display:inline-block" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
  241. <el-button v-else style="display:none" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
  242. <el-button v-if="isBasicDelete && row.statue == 2" style="display:inline-block" type="danger" size="mini" @click="handleDelate(row)">删除</el-button>
  243. <el-button v-else style="display:none" type="danger" size="mini" @click="handleDelate(row)">删除</el-button>
  244. </template>
  245. </el-table-column>
  246. </el-table>
  247. <pagination v-show="totalSH>0" :total="totalSH" :page.sync="getdataListParmSH.offset" :limit.sync="getdataListParmSH.pagecount" @pagination="get_table_dataSH" />
  248. </el-tab-pane>
  249. </el-tabs>
  250. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
  251. <div class="app-add">
  252. <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="100px" style="width: 90%;margin:0 auto">
  253. <el-row>
  254. <el-col v-if="partClassCreate" :span="8">
  255. <el-form-item ref="partClass" label="备件类别:" prop="partClass">
  256. <tree-select
  257. class="typeSelect"
  258. :height="150"
  259. :width="230"
  260. size="small"
  261. :data="parentDept"
  262. :disabled="disabled"
  263. :default-props="defaultProps"
  264. :node-key="nodeKey"
  265. :checked-keys="defaultCheckedKeys"
  266. @popoverHide="popoverHide"
  267. />
  268. <!-- style="display:inline-block;width:100%" -->
  269. <!-- display -->
  270. </el-form-item>
  271. </el-col>
  272. <el-col v-if="partClassUpdate" :span="8">
  273. <el-form-item label="备件类别:" prop="partClass">
  274. <el-input ref="partClass" v-model="createTemp.partClass" disabled />
  275. </el-form-item>
  276. </el-col>
  277. <el-col :span="8">
  278. <el-form-item label="备件编号:" prop="partCode">
  279. <el-input ref="partCode" v-model="createTemp.partCode" disabled />
  280. </el-form-item>
  281. </el-col>
  282. <el-col :span="8">
  283. <el-form-item label="备件名称:" prop="partName">
  284. <el-input ref="partName" v-model="createTemp.partName" />
  285. </el-form-item>
  286. </el-col>
  287. </el-row>
  288. <el-row>
  289. <el-col :span="8">
  290. <el-form-item label="备件规格:" prop="specification">
  291. <el-input ref="specification" v-model="createTemp.specification" />
  292. </el-form-item>
  293. </el-col>
  294. <el-col :span="8">
  295. <el-form-item label="计量单位:" prop="unit">
  296. <el-select v-model="createTemp.unit" clearable placeholder="计量单位" class="filter-item" style="width:100%">
  297. <el-option
  298. v-for="item in units"
  299. :key="item.id"
  300. :label="item.label"
  301. :value="item.label"
  302. />
  303. </el-select>
  304. </el-form-item>
  305. </el-col>
  306. <el-col :span="8">
  307. <el-form-item label="用途:" prop="purpose">
  308. <el-input v-model="createTemp.purpose" type="textarea" placeholder="用途" autosize maxlength="100" show-word-limit />
  309. <!-- <el-input v-model="createTemp.purpose" :row="1" type="textarea" placeholder="用途" /> -->
  310. </el-form-item>
  311. </el-col>
  312. </el-row>
  313. <el-row>
  314. <el-col :span="8">
  315. <el-form-item label="录入日期:" prop="createTime">
  316. <el-date-picker
  317. v-model="createTemp.createTime"
  318. disabled
  319. :picker-options="pickerOptions"
  320. type="date"
  321. placeholder="录入日期"
  322. style="top:-3px;width:100%"
  323. format="yyyy-MM-dd"
  324. value-format="yyyy-MM-dd"
  325. />
  326. </el-form-item>
  327. </el-col>
  328. <el-col :span="8">
  329. <el-form-item label="录入人:" prop="createPerson">
  330. <el-select v-model="createTemp.createPerson" placeholder="录入人" class="filter-item" style="width:100%">
  331. <el-option
  332. v-for="item in findAllEmploye"
  333. :key="item.id"
  334. :label="item.name"
  335. :value="item.id"
  336. />
  337. </el-select>
  338. </el-form-item>
  339. </el-col>
  340. <el-col :span="8">
  341. <el-form-item label="备注:" prop="note">
  342. <el-input v-model="createTemp.note" type="textarea" placeholder="备注" autosize />
  343. </el-form-item>
  344. </el-col>
  345. </el-row>
  346. <el-row>
  347. <el-col>
  348. <el-form-item label="备件图片:" prop="picpath">
  349. <el-upload
  350. id="uploadPic"
  351. ref="upload"
  352. :limit="1"
  353. list-type="picture-card"
  354. :file-list="createTemp.fileList"
  355. :headers="headers"
  356. :action="uploadImageUrl"
  357. :auto-upload="true"
  358. :on-preview="handlePicPreview"
  359. :before-remove="beforeRemove"
  360. :class="{hide:showUpload}"
  361. :on-change="(file,fileList)=>{ return handlePicChange(file, fileList) }"
  362. :on-success="(response,file, fileList)=>{ return handlePicSuccess(response,file, fileList) }"
  363. :on-remove="(file, fileList)=>{ return handlePicRemove(file, fileList) }"
  364. >
  365. <i class="el-icon-plus" />
  366. </el-upload>
  367. <el-dialog :visible.sync="dialogVisible" append-to-body :width="width">
  368. <img :src="dialogImageUrl" alt="" @load="onLoad">
  369. </el-dialog>
  370. </el-form-item>
  371. </el-col>
  372. </el-row>
  373. </el-form>
  374. </div>
  375. <div slot="footer" class="dialog-footer">
  376. <el-button v-if="dialogStatus==='create'" ref="createb" type="success" :disabled="isokDisable" @click="add_dialog_save_again()">保存并新增</el-button>
  377. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
  378. <el-button @click="dialogFormVisible = false;createTemp.partCode='';createTemp.partClass = '';createTemp.partClassNameCode = '';get_table_data();">取消并关闭</el-button>
  379. </div>
  380. </el-dialog>
  381. <!-- 查看 -->
  382. <el-dialog :title="textMap[dialogStatusSee]" :visible.sync="dialogFormVisible_See" :close-on-click-modal="false" width="90%">
  383. <el-tabs v-model="activeName" @tab-click="handleClick">
  384. <el-tab-pane label="备件基础信息" name="first">
  385. <el-form
  386. ref="seeTemp"
  387. :rules="rules"
  388. :model="seeTemp"
  389. label-position="right"
  390. label-width="100px"
  391. style="width: 90%;margin:0 auto"
  392. >
  393. <el-row>
  394. <el-col :span="8">
  395. <el-form-item ref="partClass" label="备件类别:" prop="partClass">
  396. <span>{{ seeTemp.eqClassName1 }}/{{ seeTemp.eqClassName3 }}/{{ seeTemp.eqClassName3 }}</span>
  397. </el-form-item>
  398. </el-col>
  399. <el-col :span="8">
  400. <el-form-item label="备件编号:" prop="partCode">
  401. <span>{{ seeTemp.partCode }}</span>
  402. </el-form-item>
  403. </el-col>
  404. <el-col :span="8">
  405. <el-form-item label="备件名称:" prop="partName">
  406. <span>{{ seeTemp.partName }}</span>
  407. </el-form-item>
  408. </el-col>
  409. </el-row>
  410. <el-row>
  411. <el-col :span="8">
  412. <el-form-item label="备件规格:" prop="specification">
  413. <span>{{ seeTemp.specification }}</span>
  414. </el-form-item>
  415. </el-col>
  416. <el-col :span="8">
  417. <el-form-item label="计量单位:" prop="unit">
  418. <span>{{ seeTemp.unit }}</span>
  419. </el-form-item>
  420. </el-col>
  421. <el-col :span="8">
  422. <el-form-item label="用途:" prop="purpose">
  423. <span>{{ seeTemp.purpose }}</span>
  424. </el-form-item>
  425. </el-col>
  426. </el-row>
  427. <el-row>
  428. <el-col :span="8">
  429. <el-form-item label="录入日期:" prop="createTime">
  430. <span>{{ seeTemp.createTime }}</span>
  431. </el-form-item>
  432. </el-col>
  433. <el-col :span="8">
  434. <el-form-item label="录入人:" prop="createPerson">
  435. <span>{{ seeTemp.createPerson }}</span>
  436. </el-form-item>
  437. </el-col>
  438. <el-col :span="8">
  439. <el-form-item label="备注:" prop="note">
  440. <span>{{ seeTemp.note }}</span>
  441. </el-form-item>
  442. </el-col>
  443. </el-row>
  444. <el-row>
  445. <el-col>
  446. <el-form-item label="备件图片:">
  447. <el-popover placement="right" title="" trigger="hover">
  448. <img v-if="seeTemp.picpath !== ''" :src="seeTemp.picpath">
  449. <img v-if="seeTemp.picpath !== ''" slot="reference" :src="seeTemp.picpath" :alt="seeTemp.srcpath" style="height: 100px;width:100px;">
  450. </el-popover>
  451. </el-form-item>
  452. </el-col>
  453. </el-row>
  454. <div v-if="isFlowChart">
  455. <el-row>
  456. <el-col>
  457. <el-form-item label="流程进度" />
  458. <el-steps :active="active" align-center finish-status="success">
  459. <el-step
  460. v-for="(item,index) in activeList"
  461. :key="index"
  462. :title="item.title"
  463. :status="item.status"
  464. >
  465. <template slot="description">
  466. <div class="step-row">
  467. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  468. <div>{{ item.reason }}</div>
  469. </div>
  470. </template>
  471. </el-step>
  472. </el-steps>
  473. </el-col>
  474. </el-row>
  475. <el-row>
  476. <el-col>
  477. <el-form-item label="操作:">
  478. <el-button v-if="isBasicExamine && seeTemp.statue == 0" type="success" style="display:inline-block" @click="handleExamine()">审核</el-button>
  479. <el-button v-else type="success" style="display:none" class="success" @click="handleExamine()">审核</el-button>
  480. </el-form-item>
  481. </el-col>
  482. </el-row>
  483. </div>
  484. </el-form>
  485. </el-tab-pane>
  486. <el-tab-pane v-if="isDisplayPasture" label="牧场信息" name="second">
  487. <div class="pasture-title">
  488. <b>备件类别:<span>{{ seeTemp.eqClassName1 }}/{{ seeTemp.eqClassName3 }}/{{ seeTemp.eqClassName3 }}</span></b>
  489. <b>备件编号:<span> {{seeTemp.partCode}}</span></b>
  490. <b>备件编名称:<span>{{seeTemp.partName}}</span></b>
  491. </div>
  492. <el-table
  493. :key="tableKey"
  494. v-loading="listLoadingSee"
  495. element-loading-text="给我一点时间"
  496. :data="listSee"
  497. border
  498. fit
  499. highlight-current-row
  500. style="width: 100%;"
  501. :row-style="rowStyle"
  502. :cell-style="cellStyle"
  503. class="elTable"
  504. @sort-change="tableSort"
  505. >
  506. <!-- table表格 -->
  507. <el-table-column label="序号" align="center" type="index" width="50px">
  508. <template slot-scope="scope">
  509. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  510. </template>
  511. </el-table-column>
  512. <el-table-column label="牧场" min-width="130px" align="center">
  513. <template slot-scope="scope">
  514. <span>{{ scope.row.pastureName }}</span>
  515. </template>
  516. </el-table-column>
  517. <el-table-column label="供应商" min-width="110px" align="center">
  518. <template slot-scope="scope">
  519. <span>{{ scope.row.providerName }}</span>
  520. </template>
  521. </el-table-column>
  522. <el-table-column label="当前库存" sortable prop="reportery" min-width="130px" align="center">
  523. <template slot-scope="scope">
  524. <span>{{ scope.row.reportery }}</span>
  525. </template>
  526. </el-table-column>
  527. <el-table-column label="最低库存" sortable prop="minRepertory" min-width="110px" align="center">
  528. <template slot-scope="scope">
  529. <span>{{ scope.row.minRepertory }}</span>
  530. </template>
  531. </el-table-column>
  532. <el-table-column label="最高库存" sortable prop="maxRepertory" min-width="110px" align="center">
  533. <template slot-scope="scope">
  534. <span>{{ scope.row.maxRepertory }}</span>
  535. </template>
  536. </el-table-column>
  537. <el-table-column label="单价" sortable prop="price" min-width="130px" align="center">
  538. <template slot-scope="scope">
  539. <span>{{ scope.row.price }}</span>
  540. </template>
  541. </el-table-column>
  542. <el-table-column label="库位" min-width="110px" align="center">
  543. <template slot-scope="scope">
  544. <span>{{ scope.row.location }}</span>
  545. </template>
  546. </el-table-column>
  547. </el-table>
  548. <pagination
  549. v-show="totalSee>0"
  550. :total="totalSee"
  551. :page.sync="getdataListSee.offset"
  552. :limit.sync="getdataListSee.pagecount"
  553. @pagination="getSeeList"
  554. />
  555. </el-tab-pane>
  556. </el-tabs>
  557. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
  558. <el-button @click="dialogFormVisible_See = false">关闭</el-button>
  559. </div>
  560. </el-dialog>
  561. <!-- 审核 -->
  562. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
  563. <div class="app-examine">
  564. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
  565. <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
  566. <el-row style="width:88%;height:150px;margin:0 auto;">
  567. <el-col :span="20">
  568. <el-form-item>
  569. <el-radio-group v-model="examineTemp.SHstatue" @change="changeStatue">
  570. <el-radio :label="1" checked>通过</el-radio>
  571. <el-radio :label="2">不通过</el-radio>
  572. </el-radio-group>
  573. </el-form-item>
  574. </el-col>
  575. <el-col v-if="statueReason" :span="20">
  576. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
  577. </el-col>
  578. </el-row>
  579. </el-form>
  580. </div>
  581. <div slot="footer" class="dialog-footer">
  582. <el-button type="primary" :disabled="isokDisable" @keyup.enter.native="createExamineData()" @click="createExamineData()">确认</el-button>
  583. <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
  584. </div>
  585. </el-dialog>
  586. <!-- 批量审批 -->
  587. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examines" :close-on-click-modal="false" width="40%">
  588. <div class="app-examine" style="text-align:center;font:600 20px/40px '';height:200px;margin-top:40px;">
  589. <div> 当前共选中备件:{{ Selection }}条 </div>
  590. <div> 是否确认批量通过审核 </div>
  591. </div>
  592. <div slot="footer" class="dialog-footer">
  593. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='examine'?createExamineDatas():createExamineDatas()">确认</el-button>
  594. <el-button @click="dialogFormVisible_Examines = false;">关闭</el-button>
  595. </div>
  596. </el-dialog> <!-- EAS同步 -->
  597. <!-- EAS同步 -->
  598. <el-dialog :title="textMap[easStatus.dialogStatus]" :visible.sync="easStatus.dialogFormVisible" :close-on-click-modal="false" width="80%">
  599. <div class="easStatus">
  600. <el-table
  601. :key="easStatus.tableKey"
  602. v-loading="easStatus.listLoading"
  603. element-loading-text="给我一点时间"
  604. :data="easStatus.list"
  605. border
  606. fit
  607. highlight-current-row
  608. style="width: 100%;"
  609. :row-style="rowStyle"
  610. :cell-style="cellStyle"
  611. class="elTable table-fixed"
  612. >
  613. <el-table-column label="序号" align="center" type="index" width="50px">
  614. <template slot-scope="scope">
  615. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  616. </template>
  617. </el-table-column>
  618. <el-table-column label="备件编号" min-width="110px" align="center" prop="partCode" />
  619. <el-table-column label="备件编号" min-width="110px" align="center" prop="partName" />
  620. <el-table-column label="备件规格" min-width="110px" align="center" prop="specification" />
  621. <el-table-column label="录入时间" min-width="110px" align="center" prop="createTime" />
  622. <el-table-column label="失败原因" min-width="110px" align="center" prop="failReason" />
  623. <el-table-column label="操作" align="center" width="300px" class-name="small-padding fixed-width" fixed="right">
  624. <template slot-scope="{row}">
  625. <el-button v-if="isManualSynchronization" type="primary" size="mini" style="width:70px;" @click="handleManual(row)">手动同步</el-button>
  626. <el-button v-if="isIgnoreSynchronization" type="danger" size="mini" style="width:70px;" @click="handleIgnore(row)">忽略同步</el-button>
  627. </template>
  628. </el-table-column>
  629. </el-table>
  630. <pagination v-show="easStatus.total>0" :total="easStatus.total" :page.sync="easStatus.getdataListParm.offset" :limit.sync="easStatus.getdataListParm.pagecount" @pagination="get_table_dataEasStatusLst" />
  631. </div>
  632. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  633. <el-button @click="easStatus.dialogFormVisible = false;get_table_data()">关闭</el-button>
  634. </div>
  635. </el-dialog>
  636. </div>
  637. </template>
  638. <script>
  639. // 引入
  640. import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, checkButtons, getRecuData, failproccess, transData, GetAccount, EasSync } from '@/api/common'
  641. import waves from '@/directive/waves' // waves directive
  642. import { parseTime, json2excel, sortChange } from '@/utils/index.js'
  643. // eslint-disable-next-line no-unused-vars
  644. import { validateEMail } from '@/utils/validate.js'
  645. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  646. import TreeSelect from '@/components/TreeSelect'
  647. import Cookies from 'js-cookie'
  648. import { MessageBox } from 'element-ui'
  649. import { getToken } from '@/utils/auth'
  650. export default {
  651. name: 'Basic',
  652. components: { Pagination, TreeSelect },
  653. directives: { waves },
  654. data() {
  655. return {
  656. isStyle:'display:none',
  657. isBasicAdd: [],
  658. isBasicTemplate: [],
  659. isBasicExport: [],
  660. isBasicImport: [],
  661. isBasicSee: [],
  662. isBasicEdit: [],
  663. isBasicEditTab1: [],
  664. isDisable: [],
  665. isEnable: [],
  666. isBasicExamine: [],
  667. isBasicDelete: [],
  668. isBasicDelete1: [],
  669. isBasic: [],
  670. isBasicSH: [],
  671. isEasSynchronization: [],
  672. isManualSynchronization: [],
  673. isIgnoreSynchronization: [],
  674. multipleSelection:[],
  675. rules: {
  676. temptypeCode: [{ required: true, message: '必填', trigger: 'blur' }],
  677. partClass: [{ required: true, message: '必填', trigger: 'blur' }],
  678. partCode: [{ required: true, message: '必填', trigger: 'blur' }],
  679. partName: [{ required: true, message: '必填', trigger: 'blur' }],
  680. specification: [{ required: true, message: '必填', trigger: 'blur' }],
  681. providerId: [{ required: true, message: '必填', trigger: 'blur' }],
  682. unit: [{ required: true, message: '必填', trigger: 'blur' }],
  683. purpose: [{ required: true, message: '必填', trigger: 'blur' }]
  684. },
  685. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  686. cellStyle: { padding: 0 + 'px' },
  687. textMap: {
  688. see: '查看详情',
  689. create: '新增',
  690. update: '编辑',
  691. examine: '审核',
  692. examines: '批量审批',
  693. easStatus: 'EAS同步—同步失败数据'
  694. },
  695. dialogFormVisible: false,
  696. dialogStatus: '',
  697. dialogImageUrl: '',
  698. dialogVisible: false,
  699. fileList: [],
  700. showUpload: false,
  701. headers: {
  702. optname: 'insertcustompic',
  703. id: 1,
  704. token: getToken() // 从cookie里获取token,并赋值token
  705. },
  706. uploadImageUrl: process.env.VUE_APP_BASE_API + 'authdata/uploaderimage',
  707. widht: '',
  708. listType: [],
  709. parentDept: [],
  710. defaultProps: {
  711. children: 'children',
  712. label: 'partClassNameCode'
  713. },
  714. nodeKey: 'id',
  715. defaultCheckedKeys: [],
  716. deptform: {
  717. id: '',
  718. tempPtypeCode: '',
  719. temptypeCode: '',
  720. typeName: '',
  721. typeCode: '',
  722. pid: '',
  723. sort: '',
  724. enable: ''
  725. },
  726. statues: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
  727. findAllProvider: [],
  728. findAllAssetType: [],
  729. findAllPasture: [],
  730. findAllDepart: [],
  731. findAllEmploye: [],
  732. getDictByNameYuJing: [],
  733. findAllCategory: [],
  734. requestParams: [
  735. { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
  736. { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
  737. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  738. { name: 'findAllDepart', offset: 0, pagecount: 0, params: [] },
  739. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  740. { name: 'findAllCategory', offset: 0, pagecount: 0, params: [] },
  741. { name: 'getDictByName', offset: 0, pagecount: 0, params: ['计量单位'] }
  742. ],
  743. isokDisable: false,
  744. disabled: false,
  745. activeName: 'first',
  746. tableKey: 0,
  747. total: 0,
  748. listLoading: true,
  749. list: [],
  750. getdataListParm: {
  751. name: 'getStockList',
  752. page: 1,
  753. offset: 1,
  754. pagecount: 10,
  755. returntype: 'Map',
  756. parammaps: {
  757. partCode: '',
  758. partName: '',
  759. partClass: '',
  760. inputDatetime: '',
  761. specification: '',
  762. easStatus: ''
  763. }
  764. },
  765. pickerOptions: {
  766. disabledDate(time) {
  767. return time.getTime() > Date.now()// 当天之前的时间可选
  768. }
  769. },
  770. createTemp: {
  771. partClass: '',
  772. partCode: '',
  773. tempPtypeCode: '',
  774. temptypeCode: '',
  775. partName: '',
  776. specification: '',
  777. unit: '',
  778. purpose: '',
  779. createPerson: this.$store.state.user.employeid,
  780. createTime: parseTime(new Date(), '{y}-{m}-{d}'),
  781. note: ''
  782. },
  783. placeholder: '请选择备件类别',
  784. partClassCreate: false,
  785. partClassUpdate: false,
  786. temptypeCode: true,
  787. temptypeCode1: false,
  788. listLoadingSee: true,
  789. dialogFormVisible_See: false,
  790. dialogStatusSee: '',
  791. listSee: [],
  792. seeTemp: {},
  793. getdataListSee: {
  794. name: 'getStockdetail',
  795. page: 1,
  796. offset: 1,
  797. pagecount: 10,
  798. returntype: 'Map',
  799. parammaps: {}
  800. },
  801. totalSee: 0,
  802. getRecuListParm: {
  803. name: 'getStockTypeList',
  804. idname: 'id',
  805. params: [-1]
  806. },
  807. requestParam: {},
  808. getDeptListParm: { name: 'getpart_classList_enable' },
  809. units: [],
  810. radio1: '全部',
  811. getdataListParmSH: {
  812. name: 'getStockListSH',
  813. page: 1,
  814. offset: 1,
  815. pagecount: 10,
  816. returntype: 'Map',
  817. parammaps: {
  818. partCode: '',
  819. partName: '',
  820. partClass: '',
  821. statue: '',
  822. inputDatetimeSH: '',
  823. specification: ''
  824. }
  825. },
  826. listSH: [],
  827. listLoadingSH: false,
  828. totalSH: 0,
  829. tabName: '',
  830. dialogFormVisible_Examine: false,
  831. dialogFormVisible_Examines: false,
  832. examineTemp: {
  833. SHstatue: 1
  834. },
  835. statueReason: false,
  836. activeList: [],
  837. active: 3,
  838. isFlowChart: false, // 流程图/操作
  839. isDisplayPasture: false, // 查看-牧场信息,
  840. buttons: [],
  841. isPercentage: false,
  842. percentage: 1,
  843. downloadParam: {},
  844. postDataPramas: {},
  845. Selection: 0,
  846. selectionList: [],
  847. width: 0,
  848. createExamineParm: { name: 'getPartCode', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: {}},
  849. // EAS同步
  850. easStatus: {
  851. easStatusList: [{ name: '同步成功', id: '1' }, { name: '同步失败', id: '0' }],
  852. dialogStatus: '',
  853. dialogFormVisible: false,
  854. tableKey: 0,
  855. total: 0,
  856. listLoading: true,
  857. list: [],
  858. getdataListParm: {
  859. name: 'getpartsSync',
  860. page: 1,
  861. offset: 1,
  862. pagecount: 10,
  863. returntype: 'Map',
  864. parammaps: {}
  865. }
  866. }
  867. // fileList: [],
  868. // headers1: {
  869. // optname: 'insertcustompic',
  870. // id: 1,
  871. // token: getToken() // 从cookie里获取token,并赋值token
  872. // },
  873. // uploadImageUrl: process.env.VUE_APP_BASE_API + 'authdata/uploaderimage',
  874. // showUpload: false
  875. }
  876. },
  877. computed: {
  878. // 设置请求头
  879. // headers() {
  880. // return {
  881. // token: getToken()
  882. // }
  883. // },
  884. uploadData() {
  885. return {
  886. name: 'importparts',
  887. importParams: '编码,品名,规格型号,品牌,计量单位,一级分类,二级分类,三级分类,建立人,建立时间',
  888. sheetname: 'SheetJS'
  889. }
  890. },
  891. // 设置上传地址
  892. uploadExcelUrl() {
  893. // process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
  894. return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
  895. }
  896. },
  897. created() {
  898. const that = this
  899. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  900. that.buttons = response.data.list
  901. that.get_auto_buttons()
  902. })
  903. this.get_select_list()
  904. this.getDownClassList()
  905. this.get_table_data()
  906. this.getMaxCode()
  907. this.getTypeList()
  908. this.get_table_dataSH()
  909. if (this.$route.query.tabName == undefined) {
  910. this.tabName = 'first'
  911. } else {
  912. this.tabName = this.$route.query.tabName
  913. }
  914. if (this.isBasic === false) {
  915. this.tabName = 'second'
  916. }
  917. if (this.tabName == 'first') {
  918. this.isDisplayPasture = true
  919. this.isFlowChart = false
  920. } else {
  921. this.isDisplayPasture = false
  922. this.isFlowChart = true
  923. }
  924. },
  925. methods: {
  926. tableSort(column) {
  927. sortChange(column, this.list)
  928. },
  929. get_auto_buttons() {
  930. // 新增
  931. const BasicAdd = 'customs:basic:add'
  932. const isBasicAdd = checkButtons(this.$store.state.user.buttons, BasicAdd)
  933. this.isBasicAdd = isBasicAdd
  934. // 模板
  935. const BasicTemplate = 'customs:basic:template'
  936. const isBasicTemplate = checkButtons(this.$store.state.user.buttons, BasicTemplate)
  937. this.isBasicTemplate = isBasicTemplate
  938. // 导出
  939. const BasicExport = 'customs:basic:export'
  940. const isBasicExport = checkButtons(this.$store.state.user.buttons, BasicExport)
  941. this.isBasicExport = isBasicExport
  942. // 导入
  943. const BasicImport = 'customs:basic:import'
  944. const isBasicImport = checkButtons(this.$store.state.user.buttons, BasicImport)
  945. this.isBasicImport = isBasicImport
  946. // 查看
  947. const BasicSee = 'customs:basic:see'
  948. const isBasicSee = checkButtons(this.$store.state.user.buttons, BasicSee)
  949. this.isBasicSee = isBasicSee
  950. // 编辑
  951. const BasicEdit = 'customs:basic:update'
  952. const isBasicEdit = checkButtons(this.$store.state.user.buttons, BasicEdit)
  953. this.isBasicEdit = isBasicEdit
  954. // 备件基础信息-编辑
  955. const BasicEditTab1 = 'customs:basic:update2'
  956. const isBasicEditTab1 = checkButtons(this.$store.state.user.buttons, BasicEditTab1)
  957. this.isBasicEditTab1 = isBasicEditTab1
  958. // 备件基础信息-禁用
  959. const Disable = 'customs:basic:disable'
  960. const isDisable = checkButtons(this.$store.state.user.buttons, Disable)
  961. this.isDisable = isDisable
  962. // 备件基础信息-开启
  963. const Enable = 'customs:basic:enable'
  964. const isEnable = checkButtons(this.$store.state.user.buttons, Enable)
  965. this.isEnable = isEnable
  966. // 备件基础信息删除
  967. const BasicDelete1 = 'customs:basic:enable'
  968. const isBasicDelete1 = checkButtons(this.$store.state.user.buttons, BasicDelete1)
  969. this.isBasicDelete1 = isBasicDelete1
  970. // 删除
  971. const BasicDelete = 'customs:basic:delete'
  972. const isBasicDelete = checkButtons(this.$store.state.user.buttons, BasicDelete)
  973. this.isBasicDelete = isBasicDelete
  974. // 审核
  975. const BasicExamine = 'customs:basic:shenhe'
  976. const isBasicExamine = checkButtons(this.$store.state.user.buttons, BasicExamine)
  977. this.isBasicExamine = isBasicExamine
  978. // 备件基础信息
  979. const Basic = 'customs:basic:basic'
  980. const isBasic = checkButtons(this.$store.state.user.buttons, Basic)
  981. this.isBasic = isBasic
  982. // 备件审核
  983. const BasicSH = 'customs:basic:shjm'
  984. const isBasicSH = checkButtons(this.$store.state.user.buttons, BasicSH)
  985. this.isBasicSH = isBasicSH
  986. // EAS同步
  987. const EasSynchronization = 'customs:basic:easSynchronization'
  988. const isEasSynchronization = checkButtons(this.$store.state.user.buttons, EasSynchronization)
  989. this.isEasSynchronization = isEasSynchronization
  990. // 手动同步
  991. const ManualSynchronization = 'customs:basic:manualSynchronization'
  992. const isManualSynchronization = checkButtons(this.$store.state.user.buttons, ManualSynchronization)
  993. this.isManualSynchronization = isManualSynchronization
  994. // 忽略同步
  995. const IgnoreSynchronization = 'customs:basic:ignoreSynchronization'
  996. const isIgnoreSynchronization = checkButtons(this.$store.state.user.buttons, IgnoreSynchronization)
  997. this.isIgnoreSynchronization = isIgnoreSynchronization
  998. },
  999. handleSelectionChange2(val) {
  1000. this.multipleSelection = val;
  1001. },
  1002. handleBatchDisable(){
  1003. if(this.multipleSelection.length > 0){
  1004. this.$confirm('是否确定批量禁用?', '提示', {
  1005. confirmButtonText: '确定',
  1006. cancelButtonText: '取消',
  1007. type: 'warning'
  1008. }).then(() => {
  1009. this.multipleSelection.forEach(row => {
  1010. console.log("批量禁用",row)
  1011. this.requestParam = {}
  1012. this.requestParam.name = 'updatepartsEnable'
  1013. this.requestParam.parammaps = {}
  1014. this.requestParam.parammaps.id = row.id
  1015. this.requestParam.parammaps.enable = 0
  1016. PostDataByName(this.requestParam).then(() => {
  1017. this.$notify({ title: '成功', message: '禁用成功', type: 'success', duration: 2000 })
  1018. })
  1019. });
  1020. this.get_table_data()
  1021. this.get_table_dataSH()
  1022. }).catch(() => {
  1023. this.$message({
  1024. type: 'info',
  1025. message: '已取消批量禁用'
  1026. });
  1027. });
  1028. }else{
  1029. this.$notify({ title: '提示', message: '请勾选禁用备件', type: 'error', duration: 2000 })
  1030. }
  1031. },
  1032. handleBatchEnable(){
  1033. if(this.multipleSelection.length > 0){
  1034. this.$confirm('是否确定批量启用?', '提示', {
  1035. confirmButtonText: '确定',
  1036. cancelButtonText: '取消',
  1037. type: 'warning'
  1038. }).then(() => {
  1039. this.multipleSelection.forEach(row => {
  1040. console.log("批量启用",row)
  1041. this.requestParam = {}
  1042. this.requestParam.name = 'updatepartsEnable'
  1043. this.requestParam.parammaps = {}
  1044. this.requestParam.parammaps.id = row.id
  1045. this.requestParam.parammaps.enable = 1
  1046. PostDataByName(this.requestParam).then(() => {
  1047. this.$notify({ title: '成功', message: '启用成功', type: 'success', duration: 2000 })
  1048. })
  1049. });
  1050. this.get_table_data()
  1051. this.get_table_dataSH()
  1052. }).catch(() => {
  1053. this.$message({
  1054. type: 'info',
  1055. message: '已取消批量启用'
  1056. });
  1057. });
  1058. }else{
  1059. this.$notify({ title: '提示', message: '请勾选启用备件', type: 'error', duration: 2000 })
  1060. }
  1061. },
  1062. get_select_list() {
  1063. GetDataByNames(this.requestParams).then(response => {
  1064. this.units = response.data.getDictByName.list
  1065. this.findAllProvider = response.data.findAllProvider.list
  1066. this.findAllAssetType = response.data.findAllAssetType.list
  1067. this.findAllPasture = response.data.findAllPasture.list
  1068. this.findAllDepart = response.data.findAllDepart.list
  1069. this.findAllEmploye = response.data.findAllEmploye.list
  1070. this.findAllCategory = response.data.findAllCategory.list
  1071. })
  1072. },
  1073. getDownClassList() {
  1074. getRecuData(this.getRecuListParm).then(response => {
  1075. this.parentClass = response.data
  1076. })
  1077. },
  1078. popoverHide(checkedIds, checkedData) {
  1079. console.log(checkedIds, checkedData)
  1080. if (checkedIds !== null) {
  1081. if (checkedData.childrens == 0) {
  1082. this.deptform.pid = checkedIds
  1083. console.log(checkedData)
  1084. if (checkedIds !== null) {
  1085. // this.deptform.partCode = checkedData.partClassCode
  1086. this.createTemp.partCode = checkedData.partClassCode
  1087. this.createTemp.partClass = checkedData.partClassCode
  1088. this.createTemp.partClassNameCode = checkedData.partClassNameCode
  1089. this.getMaxCode()
  1090. } else {
  1091. this.createTemp.pid = -1
  1092. }
  1093. this.getMaxCode()
  1094. } else {
  1095. this.defaultCheckedKeys = []
  1096. this.createTemp.tempPtypeCode = ''
  1097. this.createTemp.temptypeCode = ''
  1098. this.$message({
  1099. type: 'warning',
  1100. message: '请选择详细备件类别'
  1101. })
  1102. }
  1103. } else {
  1104. this.defaultCheckedKeys = []
  1105. this.createTemp.partCode = ''
  1106. this.createTemp.partClass = ''
  1107. this.createTemp.partClassNameCode = ''
  1108. }
  1109. },
  1110. getTypeList() {
  1111. // this.listLoading = true
  1112. this.getDeptListParm.parammaps = this.deptform
  1113. GetDataByName(this.getDeptListParm).then(response => {
  1114. this.listType = response.data
  1115. if (response.data.list !== null) {
  1116. this.listType = transData(response.data.list, 'id', 'pid', 'children')
  1117. console.log(this.listType,'11111')
  1118. }
  1119. this.parentDept = this.listType
  1120. })
  1121. },
  1122. getMaxCode() {
  1123. this.requestParam.name = 'getPartCode'
  1124. this.requestParam.parammaps = {}
  1125. this.requestParam.parammaps.partCode = this.createTemp.partCode
  1126. GetDataByName(this.requestParam).then(response => {
  1127. console.log('备件类别选中data', response.data.list)
  1128. if (response.data.list !== 0) {
  1129. if (response.data.list[0].preCode === '') {
  1130. this.createTemp.tempPtypeCode = this.deptform.typeCode + '.'
  1131. } else {
  1132. this.createTemp.tempPtypeCode = response.data.list[0].preCode
  1133. }
  1134. this.createTemp.temptypeCode = response.data.list[0].maxcode
  1135. this.$nextTick(() => {
  1136. // this.createTemp.partCode = this.createTemp.tempPtypeCode + this.createTemp.temptypeCode
  1137. console.log(this.createTemp.partCode)
  1138. this.$forceUpdate()
  1139. })
  1140. if (this.requestParam.parammaps.pid === -1) {
  1141. this.createTemp.partCode = this.createTemp.tempPtypeCode + this.createTemp.temptypeCode
  1142. }
  1143. }
  1144. })
  1145. },
  1146. get_table_data() {
  1147. this.listLoading = true
  1148. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  1149. this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
  1150. this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
  1151. } else {
  1152. this.getdataListParm.parammaps.startTime = ''
  1153. this.getdataListParm.parammaps.stopTime = ''
  1154. }
  1155. this.getdataListParm.parammaps.partClass = this.createTemp.partClass
  1156. GetDataByName(this.getdataListParm).then(response => {
  1157. console.log('table数据', response.data.list)
  1158. this.list = response.data.list
  1159. if (response.data.list !== null) {
  1160. for (var i = 0; i < response.data.list.length; i++) {
  1161. // console.log(response.data.list[i].srcpath)
  1162. 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) {
  1163. this.list[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1164. this.list[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1165. // console.log(111)
  1166. } else {
  1167. this.list[i].srcpath = ''
  1168. this.list[i].picpath = ''
  1169. }
  1170. }
  1171. }
  1172. this.pageNum = response.data.pageNum
  1173. this.pageSize = response.data.pageSize
  1174. if (response.data.total) {
  1175. this.total = response.data.total
  1176. }
  1177. // Just to simulate the time of the request
  1178. setTimeout(() => {
  1179. this.listLoading = false
  1180. }, 100)
  1181. })
  1182. },
  1183. statue: function(cellValue) {
  1184. // console.log(cellValue.isZeroStock)
  1185. if (cellValue.statue == 0) {
  1186. return '审核中'
  1187. } else if (cellValue.statue == 1) {
  1188. return '已通过'
  1189. } else if (cellValue.statue == 2) {
  1190. return '未通过'
  1191. } else if (cellValue.statue == 3) {
  1192. return '历史数据'
  1193. }
  1194. },
  1195. get_table_dataSH() {
  1196. this.listLoadingSH = true
  1197. if (this.$refs['inputDatetimeSH'] !== undefined && this.$refs['inputDatetimeSH'].value !== null) {
  1198. this.getdataListParmSH.parammaps.startTime = this.$refs['inputDatetimeSH'].value[0]
  1199. this.getdataListParmSH.parammaps.stopTime = this.$refs['inputDatetimeSH'].value[1]
  1200. } else {
  1201. this.getdataListParmSH.parammaps.startTime = ''
  1202. this.getdataListParmSH.parammaps.stopTime = ''
  1203. }
  1204. this.getdataListParmSH.parammaps.partClass = this.createTemp.partClass
  1205. GetDataByName(this.getdataListParmSH).then(response => {
  1206. console.log('table数据', response.data.list)
  1207. this.listSH = response.data.list
  1208. if (response.data.list !== null) {
  1209. for (var i = 0; i < response.data.list.length; i++) {
  1210. 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) {
  1211. this.listSH[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1212. this.listSH[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1213. } else {
  1214. this.listSH[i].srcpath = ''
  1215. this.listSH[i].picpath = ''
  1216. }
  1217. }
  1218. }
  1219. this.pageNumSH = response.data.pageNum
  1220. this.pageSizeSH = response.data.pageSize
  1221. if (response.data.total) {
  1222. this.totalSH = response.data.total
  1223. }
  1224. setTimeout(() => {
  1225. this.listLoadingSH = false
  1226. }, 100)
  1227. })
  1228. },
  1229. form_search() {
  1230. this.listLoading = true
  1231. if (this.getdataListParm.parammaps.inputDatetime === null) {
  1232. this.getdataListParm.parammaps.inputDatetime = ''
  1233. }
  1234. this.getdataListParm.parammaps.partClass = this.deptform.typeCode
  1235. this.getdataListParm.offset = 1
  1236. this.get_table_data()
  1237. },
  1238. form_searchSH() {
  1239. this.listLoadingSH = true
  1240. if (this.getdataListParmSH.parammaps.inputDatetimeSH === null) {
  1241. this.getdataListParmSH.parammaps.inputDatetimeSH = ''
  1242. }
  1243. this.getdataListParmSH.parammaps.partClass = this.deptform.typeCode
  1244. this.getdataListParmSH.offset = 1
  1245. this.get_table_dataSH()
  1246. },
  1247. form_see(row) {
  1248. this.activeName = 'first'
  1249. this.seeTemp = Object.assign({}, row) // copy obj
  1250. if (this.seeTemp.srcpath !== undefined) {
  1251. this.$set(this.seeTemp, 'srcpath', this.seeTemp.srcpath)
  1252. this.$set(this.seeTemp, 'picpath', this.seeTemp.picpath)
  1253. }
  1254. console.log('查看上方数据(从table读取)', this.seeTemp)
  1255. this.dialogStatus = 'see'
  1256. this.dialogFormVisible_See = true
  1257. this.getdataListSee.parammaps.partCode = row.partCode
  1258. this.getSeeList()
  1259. // 流程图
  1260. var reason = '未通过原因:' + this.seeTemp.workflowNote
  1261. if (this.seeTemp.statue === 0) {
  1262. this.activeList = [{ title: '提交信息', date: this.seeTemp.createTime, name: this.seeTemp.createPerson }, { title: '设备中心审核' }]
  1263. this.active = 1
  1264. } else if (this.seeTemp.statue === 1) {
  1265. this.activeList = [{ title: '提交信息', date: this.seeTemp.createTime, name: this.seeTemp.createPerson }, { title: '设备中心审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }]
  1266. this.active = 2
  1267. } else if (this.seeTemp.statue === 2) {
  1268. this.activeList = [{ title: '提交信息', date: this.seeTemp.createTime, name: this.seeTemp.createPerson }, { title: '设备中心审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }]
  1269. this.active = 2
  1270. }
  1271. },
  1272. getSeeList() {
  1273. this.listLoadingSee = true
  1274. GetDataByName(this.getdataListSee).then(response => {
  1275. console.log('查看牧场信息table数据', response.data.list)
  1276. this.listSee = response.data.list
  1277. this.pageNumSee = response.data.pageNum
  1278. this.pageSizeSee = response.data.pageSize
  1279. if (response.data.total) {
  1280. this.totalSee = response.data.total
  1281. }
  1282. // Just to simulate the time of the request
  1283. setTimeout(() => {
  1284. this.listLoadingSee = false
  1285. }, 100)
  1286. })
  1287. },
  1288. handleClick(tab, event) {
  1289. console.log(tab, event)
  1290. },
  1291. resetCreateTemp() {
  1292. this.requestParam = { name: 'createAssetType', parammaps: {}}
  1293. this.defaultCheckedKeys = []
  1294. this.createTemp.partClassNameCode = ''
  1295. this.createTemp.tempPtypeCode = ''
  1296. this.createTemp.temptypeCode = ''
  1297. this.createTemp.partClass = ''
  1298. this.createTemp.partCode = ''
  1299. this.createTemp.partName = ''
  1300. this.createTemp.specification = ''
  1301. this.createTemp.purpose = ''
  1302. this.createTemp.unit = ''
  1303. this.createTemp.createTime = parseTime(new Date(), '{y}-{m}-{d}')
  1304. this.createTemp.note = ''
  1305. this.createTemp.picId = ''
  1306. this.createTemp.picpath = ''
  1307. },
  1308. form_add() {
  1309. this.resetCreateTemp()
  1310. this.createTemp.createPerson = this.$store.state.user.employeid
  1311. this.partClassCreate = true
  1312. this.partClassUpdate = false
  1313. this.$nextTick(() => {
  1314. this.$refs.upload.clearFiles()
  1315. this.showUpload = false
  1316. this.$refs['createTemp'].clearValidate()
  1317. })
  1318. this.dialogStatus = 'create'
  1319. this.dialogFormVisible = true
  1320. this.fileList = []
  1321. },
  1322. handlePicChange(file, fileList) {
  1323. // console.log(response, '文件状态改变时的钩子response')
  1324. console.log(file, '文件状态改变时的钩子file')
  1325. console.log(fileList, '文件状态改变时的钩子fileList')
  1326. console.log(this.createTemp, '文件状态改变时的钩子row')
  1327. console.log(this.showUpload, '文件状态改变时的钩子row')
  1328. if (fileList.length > 0) {
  1329. this.$nextTick(() => {
  1330. // this.$set(this.createTemp, 'showUpload', true)
  1331. this.showUpload = true
  1332. })
  1333. } else {
  1334. this.$nextTick(() => {
  1335. this.showUpload = false
  1336. })
  1337. }
  1338. console.log(this.createTemp)
  1339. },
  1340. handlePicSuccess(response, file, fileList) {
  1341. if (fileList.length > 0) {
  1342. this.$nextTick(() => {
  1343. this.showUpload = true
  1344. })
  1345. } else {
  1346. this.$nextTick(() => {
  1347. this.showUpload = false
  1348. })
  1349. }
  1350. if (this.createTemp.picpath === undefined || this.createTemp.picpath === '' || this.createTemp.picpath == -1) {
  1351. this.$set(this.createTemp, 'picpath', response.execresult.LastInsertId)
  1352. }
  1353. console.log(this.createTemp, '文件上传成功时的钩子row')
  1354. },
  1355. handlePicRemove(file, fileList) {
  1356. console.log(file, '文件列表移除文件时的钩子file---')
  1357. console.log(fileList, '文件列表移除文件时的钩子fileList--')
  1358. console.log(this.createTemp, '文件列表移除文件时的钩子row---')
  1359. // console.log(this.dialogStatus)update
  1360. if (this.dialogStatus === 'create') {
  1361. if (fileList.length < 1) {
  1362. this.showUpload = false
  1363. }
  1364. for (const key in this.createTemp) {
  1365. if (this.createTemp[key] === file.response.execresult.LastInsertId) {
  1366. this.$delete(this.createTemp, key)
  1367. }
  1368. }
  1369. } else {
  1370. if (fileList.length < 1) {
  1371. this.$nextTick(() => {
  1372. this.showUpload = false
  1373. })
  1374. }
  1375. const url = file.url
  1376. console.log(url, 'url')
  1377. for (const key in this.createTemp) {
  1378. console.log(this.createTemp[key], 'createTemp[key]')
  1379. if (this.createTemp[key] === url) {
  1380. console.log(key)
  1381. if (key === 'picpath') {
  1382. this.$delete(this.createTemp, 'picpath')
  1383. this.$delete(this.createTemp, 'picId')
  1384. }
  1385. }
  1386. }
  1387. }
  1388. console.log(this.createTemp, '文件列表移除文件时的钩子row')
  1389. },
  1390. handlePicPreview(file) {
  1391. this.dialogImageUrl = file.url
  1392. this.dialogVisible = true
  1393. },
  1394. onLoad(e) {
  1395. const img = e.target
  1396. let width = 0
  1397. if (img.fileSize > 0 || (img.width > 1 && img.height > 1)) {
  1398. width = img.width + 40
  1399. }
  1400. this.width = width + 'px'
  1401. },
  1402. beforeRemove(file, fileList) {
  1403. console.log(file.response, '删除文件之前的钩子,参数为上传的文件和文件列表')
  1404. return this.$confirm('删除当前图片, 是否继续?', '提示', {
  1405. confirmButtonText: '确定',
  1406. cancelButtonText: '取消',
  1407. type: 'warning'
  1408. })
  1409. },
  1410. add_dialog_save() {
  1411. this.isokDisable = true
  1412. setTimeout(() => {
  1413. this.isokDisable = false
  1414. }, 1000)
  1415. this.$refs['createTemp'].validate(valid => {
  1416. if (valid) {
  1417. if (this.createTemp.picpath == '' || this.createTemp.picpath == undefined) {
  1418. this.$notify({ title: '', message: '请上传图片', type: 'warning', duration: 2000 })
  1419. return false
  1420. }
  1421. this.postDataPramas.common = { 'returnmap': '0' }
  1422. this.postDataPramas.data = []
  1423. this.postDataPramas.data[0] = { 'name': 'checkPartsns', 'type': 'v', 'parammaps': {
  1424. 'partName': this.createTemp.partName,
  1425. 'specification': this.createTemp.specification
  1426. }}
  1427. this.postDataPramas.data[1] = { 'name': 'insertStock', 'type': 'e', 'parammaps': {
  1428. 'picId': this.createTemp.picpath,
  1429. 'partClass': this.createTemp.partClass,
  1430. // this.requestParam.parammaps.partCode = this.createTemp.tempPtypeCode + this.createTemp.temptypeCode
  1431. 'partCode': this.createTemp.partCode,
  1432. 'partName': this.createTemp.partName,
  1433. 'specification': this.createTemp.specification,
  1434. 'unit': this.createTemp.unit,
  1435. 'purpose': this.createTemp.purpose,
  1436. 'createPerson': this.createTemp.createPerson,
  1437. 'createTime': this.createTemp.createTime,
  1438. 'note': this.createTemp.note
  1439. }}
  1440. ExecDataByConfig(this.postDataPramas).then(response => {
  1441. console.log('保存发送参数', this.postDataPramas)
  1442. if (response.msg !== 'fail') {
  1443. this.deptform.id = ''
  1444. this.deptform.typeName = ''
  1445. this.dialogFormVisible = false
  1446. this.defaultCheckedKeys = []
  1447. this.createTemp.partCode = ''
  1448. this.createTemp.partClass = ''
  1449. this.createTemp.partClassNameCode = ''
  1450. this.get_table_data()
  1451. this.getMaxCode()
  1452. this.$nextTick(() => {
  1453. this.$refs['createTemp'].clearValidate()
  1454. })
  1455. this.$notify({ title: '成功', message: '新增成功', type: 'success', duration: 2000 })
  1456. } else {
  1457. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  1458. }
  1459. })
  1460. }
  1461. })
  1462. },
  1463. add_dialog_save_again() {
  1464. this.isokDisable = true
  1465. setTimeout(() => {
  1466. this.isokDisable = false
  1467. }, 1000)
  1468. this.$refs['createTemp'].validate(valid => {
  1469. if (valid) {
  1470. if (this.createTemp.picpath == '' || this.createTemp.picpath == undefined) {
  1471. this.$notify({ title: '', message: '请上传图片', type: 'warning', duration: 2000 })
  1472. return false
  1473. }
  1474. this.postDataPramas.common = { 'returnmap': '0' }
  1475. this.postDataPramas.data = []
  1476. this.postDataPramas.data[0] = { 'name': 'checkPartsns', 'type': 'v', 'parammaps': {
  1477. 'partName': this.createTemp.partName,
  1478. 'specification': this.createTemp.specification
  1479. }}
  1480. this.postDataPramas.data[1] = { 'name': 'insertStock', 'type': 'e', 'parammaps': {
  1481. 'picId': this.createTemp.picpath,
  1482. 'partClass': this.createTemp.partClass,
  1483. // this.requestParam.parammaps.partCode = this.createTemp.tempPtypeCode + this.createTemp.temptypeCode
  1484. 'partCode': this.createTemp.partCode,
  1485. 'partName': this.createTemp.partName,
  1486. 'specification': this.createTemp.specification,
  1487. 'unit': this.createTemp.unit,
  1488. 'purpose': this.createTemp.purpose,
  1489. 'createPerson': this.createTemp.createPerson,
  1490. 'createTime': this.createTemp.createTime,
  1491. 'note': this.createTemp.note
  1492. }}
  1493. ExecDataByConfig(this.postDataPramas).then(response => {
  1494. console.log('保存发送参数', this.postDataPramas)
  1495. if (response.msg !== 'fail') {
  1496. this.resetCreateTemp()
  1497. this.get_table_data()
  1498. this.$nextTick(() => {
  1499. this.$refs['createTemp'].clearValidate()
  1500. })
  1501. this.$notify({ title: '成功', message: '新增成功', type: 'success', duration: 2000 })
  1502. this.handlePicRemove()
  1503. } else {
  1504. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  1505. }
  1506. })
  1507. }
  1508. })
  1509. },
  1510. handleDisable(row) {
  1511. MessageBox.confirm('禁用后备件不可使用,是否禁用?', {
  1512. confirmButtonText: '确认',
  1513. cancelButtonText: '取消',
  1514. type: 'warning'
  1515. }).then(() => {
  1516. this.requestParam.name = 'updatepartsEnable'
  1517. this.requestParam.parammaps = {}
  1518. this.requestParam.parammaps.id = row.id
  1519. this.requestParam.parammaps.enable = 0
  1520. PostDataByName(this.requestParam).then(() => {
  1521. this.get_table_data()
  1522. this.get_table_dataSH()
  1523. this.dialogFormVisible = false
  1524. this.$notify({ title: '成功', message: '禁用成功', type: 'success', duration: 2000 })
  1525. })
  1526. }).catch(() => {
  1527. this.$message({ type: 'info', message: '已取消禁用' })
  1528. })
  1529. },
  1530. handleEnable(row) {
  1531. this.requestParam.name = 'updatepartsEnable'
  1532. this.requestParam.parammaps = {}
  1533. this.requestParam.parammaps.id = row.id
  1534. this.requestParam.parammaps.enable = 1
  1535. PostDataByName(this.requestParam).then(() => {
  1536. this.get_table_data()
  1537. this.get_table_dataSH()
  1538. this.dialogFormVisible = false
  1539. this.$notify({ title: '成功', message: '启用成功', type: 'success', duration: 2000 })
  1540. })
  1541. },
  1542. form_edit(row) {
  1543. this.createTemp = Object.assign({}, row) // copy obj
  1544. this.createTemp.partClass = this.createTemp.eqClassName1 + '/' + this.createTemp.eqClassName2 + '/' + this.createTemp.eqClassName3
  1545. this.dialogStatus = 'update'
  1546. this.dialogFormVisible = true
  1547. this.partClassCreate = false
  1548. this.partClassUpdate = true
  1549. const urlArray = []
  1550. const fileList = []
  1551. if (row.picpath == undefined) {
  1552. urlArray.push()
  1553. } else if (row.picpath == '') {
  1554. urlArray.push()
  1555. } else {
  1556. urlArray.push(row.picpath)
  1557. }
  1558. for (let i = 0; i < urlArray.length; i++) {
  1559. const urlObj = {}
  1560. this.$set(urlObj, 'url', urlArray[i])
  1561. fileList.push(urlObj)
  1562. }
  1563. this.$set(this.createTemp, 'fileList', fileList)
  1564. console.log(this.createTemp)
  1565. if (this.createTemp.fileList.length >= 1) {
  1566. this.showUpload = true
  1567. } else {
  1568. this.showUpload = false
  1569. }
  1570. },
  1571. edit_dialog_save() {
  1572. this.$refs['createTemp'].validate(valid => {
  1573. if (valid) {
  1574. if (this.createTemp.picpath == '' || this.createTemp.picpath == undefined) {
  1575. this.$notify({ title: '', message: '请上传图片', type: 'warning', duration: 2000 })
  1576. return false
  1577. }
  1578. this.requestParam.name = 'updateParts'
  1579. this.requestParam.parammaps.partClass = this.createTemp.partClass
  1580. this.requestParam.parammaps.id = this.createTemp.id
  1581. this.requestParam.parammaps.partCode = this.createTemp.partCode
  1582. this.requestParam.parammaps.partName = this.createTemp.partName
  1583. this.requestParam.parammaps.specification = this.createTemp.specification
  1584. this.requestParam.parammaps.purpose = this.createTemp.purpose
  1585. this.requestParam.parammaps.unit = this.createTemp.unit
  1586. this.requestParam.parammaps.createPersonId = this.createTemp.createPersonId
  1587. this.requestParam.parammaps.createTime = this.createTemp.createTime
  1588. this.requestParam.parammaps.note = this.createTemp.note
  1589. this.requestParam.parammaps.statue = 0
  1590. const picpath = parseInt(this.createTemp.picpath)
  1591. if (isNaN(picpath) == false) {
  1592. this.requestParam.parammaps.picpath = this.createTemp.picpath
  1593. } else {
  1594. this.requestParam.parammaps.picpath = this.createTemp.picId
  1595. }
  1596. console.log('编辑保存发送data', this.requestParam.parammaps)
  1597. PostDataByName(this.requestParam).then(response => {
  1598. if (response.msg !== 'fail') {
  1599. this.defaultCheckedKeys = []
  1600. this.createTemp.partCode = ''
  1601. this.createTemp.partClass = ''
  1602. this.createTemp.partClassNameCode = ''
  1603. this.get_table_data()
  1604. this.get_table_dataSH()
  1605. this.getMaxCode()
  1606. this.dialogFormVisible = false
  1607. this.$nextTick(() => {
  1608. this.$refs['createTemp'].clearValidate()
  1609. })
  1610. this.$notify({
  1611. title: '成功',
  1612. message: '编辑成功',
  1613. type: 'success',
  1614. duration: 2000
  1615. })
  1616. } else {
  1617. failproccess(response, this.$notify)
  1618. }
  1619. })
  1620. }
  1621. })
  1622. },
  1623. handleDelate(row) {
  1624. MessageBox.confirm('备件编号:' + row.partCode + ' ,备件名称:' + row.partName, '确认删除?', {
  1625. confirmButtonText: '确认',
  1626. cancelButtonText: '取消',
  1627. type: 'warning'
  1628. }).then(() => {
  1629. this.requestParam.name = 'deleteStock'
  1630. this.requestParam.parammaps = {}
  1631. this.requestParam.parammaps['id'] = row.id
  1632. PostDataByName(this.requestParam).then(() => {
  1633. this.get_table_data()
  1634. this.get_table_dataSH()
  1635. this.dialogFormVisible = false
  1636. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  1637. })
  1638. }).catch(() => { this.$message({ type: 'info', message: '已取消删除' }) })
  1639. },
  1640. handleRemove(file, fileList) {
  1641. console.log(file, fileList)
  1642. this.dialogForm.imgList = fileList
  1643. if (fileList) {
  1644. this.$refs['uploadElement'].clearValidate()
  1645. }
  1646. },
  1647. handlePictureCardPreview(file) {
  1648. this.dialogImageUrl = file.url
  1649. this.dialogVisible = true
  1650. },
  1651. formatJson(filterVal, jsonData) {
  1652. return jsonData.map(v =>
  1653. filterVal.map(j => {
  1654. if (j === 'timestamp') {
  1655. return parseTime(v[j])
  1656. } else {
  1657. return v[j]
  1658. }
  1659. })
  1660. )
  1661. },
  1662. handleDownload() {
  1663. console.log('点击了基础信息导出')
  1664. console.log(this.tabName)
  1665. this.$alert('备件基础信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  1666. this.isPercentage = true
  1667. this.percentage = 1
  1668. var timer = setInterval(() => {
  1669. this.percentage += 5
  1670. if (this.percentage > 95) {
  1671. this.percentage = 99
  1672. clearInterval(timer)
  1673. }
  1674. this.percentage = this.percentage
  1675. }, 1000)
  1676. if (this.tabName == 'first') {
  1677. this.downloadParam.name = 'getStockList'
  1678. this.downloadParam.parammaps = {}
  1679. this.downloadParam.parammaps.partCode = this.getdataListParm.parammaps.partCode
  1680. this.downloadParam.parammaps.partName = this.getdataListParm.parammaps.partName
  1681. this.downloadParam.parammaps.partClass = this.getdataListParm.parammaps.partClass
  1682. this.downloadParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
  1683. this.downloadParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
  1684. this.downloadParam.parammaps.specification = this.getdataListParm.parammaps.specification
  1685. } else if (this.tabName == 'second') {
  1686. this.downloadParam.name = 'getStockListSH'
  1687. this.downloadParam.parammaps = {}
  1688. this.downloadParam.parammaps.partCode = this.getdataListParmSH.parammaps.partCode
  1689. this.downloadParam.parammaps.partName = this.getdataListParmSH.parammaps.partName
  1690. this.downloadParam.parammaps.partClass = this.getdataListParmSH.parammaps.partClass
  1691. this.downloadParam.parammaps.statue = this.getdataListParmSH.parammaps.statue
  1692. this.downloadParam.parammaps.startTime = this.getdataListParmSH.parammaps.startTime
  1693. this.downloadParam.parammaps.stopTime = this.getdataListParmSH.parammaps.stopTime
  1694. this.downloadParam.parammaps.specification = this.getdataListParmSH.parammaps.specification
  1695. }
  1696. GetAccount(this.downloadParam).then(response => {
  1697. if (response.data.list !== '') {
  1698. this.percentage = 99
  1699. setTimeout(() => {
  1700. this.isPercentage = false
  1701. }, 2000)
  1702. }
  1703. this.$nextTick(() => {
  1704. const ExcelDatas = [
  1705. {
  1706. tHeader: ['编码', '品名', '规格型号', '计量单位', '一级分类', '二级分类', '三级分类', '建立人', '建立时间'],
  1707. filterVal: ['partCode', 'partName', 'specification', 'unit', 'eqClassName1', 'eqClassName2', 'eqClassName3', 'createPerson', 'createTime'],
  1708. tableDatas: response.data.list,
  1709. sheetName: '备件基础信息'
  1710. }
  1711. ]
  1712. json2excel(ExcelDatas, '备件基础信息', true, 'xlsx')
  1713. })
  1714. })
  1715. },
  1716. handleDownloadTemp() {
  1717. this.requestParam.name = 'stockDownTemp'
  1718. GetDataByName(this.requestParam).then(response => {
  1719. this.$nextTick(() => {
  1720. const ExcelDatas = [
  1721. {
  1722. tHeader: ['编码', '品名', '规格型号', '计量单位', '一级分类', '二级分类', '三级分类', '建立人', '建立时间'],
  1723. filterVal: ['编码', '品名', '规格型号', '计量单位', '一级分类', '二级分类', '三级分类', '建立人', '建立时间'],
  1724. tableDatas: response.data.list,
  1725. sheetName: 'SheetJS'
  1726. }
  1727. ]
  1728. json2excel(ExcelDatas, '备件基础信息模板', true, 'xlsx')
  1729. })
  1730. })
  1731. },
  1732. // 导入
  1733. beforeImportExcel(file) {
  1734. const isLt2M = file.size / 1024 / 1024 < 10
  1735. if (!isLt2M) {
  1736. this.$message.error('上传文件大小不能超过 10MB!')
  1737. }
  1738. return isLt2M
  1739. },
  1740. handleImportExcelSuccess(res, file) {
  1741. if (res.msg === 'ok') {
  1742. this.$message({
  1743. title: '成功',
  1744. message: '导入成功:' + res.data.success + '条!',
  1745. type: 'success',
  1746. duration: 2000
  1747. })
  1748. if (res.data.err_count > 0) {
  1749. this.$notify({
  1750. title: '失败',
  1751. message: '导入失败:' + res.data.err_count + '条!',
  1752. type: 'danger',
  1753. duration: 2000
  1754. })
  1755. import('@/vendor/Export2Excel').then(excel => {
  1756. const list1 = res.data.result
  1757. const tHeader = [
  1758. '编码', '品名', '规格型号', '品牌', '计量单位', '一级分类', '二级分类', '三级分类', '建立人', '建立时间', 'error_msg'
  1759. ]
  1760. const filterVal = [
  1761. '编码', '品名', '规格型号', '品牌', '计量单位', '一级分类', '二级分类', '三级分类', '建立人', '建立时间', 'error_msg'
  1762. ]
  1763. const data1 = this.formatJson(filterVal, list1)
  1764. excel.export_json_to_excel({
  1765. header: tHeader,
  1766. data: data1,
  1767. filename: this.requestParam.parammaps.formType,
  1768. autoWidth: true,
  1769. bookType: 'xlsx'
  1770. })
  1771. })
  1772. }
  1773. } else {
  1774. this.$notify({
  1775. title: '失败',
  1776. message: '上传失败',
  1777. type: 'danger',
  1778. duration: 2000
  1779. })
  1780. }
  1781. },
  1782. handleTabClick(val) {
  1783. console.log('点击了基础信息/审核备件tab', val)
  1784. // isFlowChart
  1785. if (val.name == 'second') {
  1786. this.isFlowChart = true
  1787. this.isDisplayPasture = false
  1788. } else {
  1789. this.isFlowChart = false
  1790. this.isDisplayPasture = true
  1791. }
  1792. this.get_table_data()
  1793. this.get_table_dataSH()
  1794. },
  1795. handleExamine(row) {
  1796. if (row == undefined) {
  1797. this.examineTemp = this.seeTemp
  1798. this.$set(this.seeTemp, 'SHstatue', 1)
  1799. this.$set(this.seeTemp, 'workflowNote', '')
  1800. } else {
  1801. this.examineTemp = Object.assign({}, row)
  1802. this.$set(this.examineTemp, 'SHstatue', 1)
  1803. this.$set(this.examineTemp, 'workflowNote', '')
  1804. }
  1805. this.dialogStatus = 'examine'
  1806. this.dialogFormVisible_Examine = true
  1807. // this.examineTemp.statue = 1
  1808. this.statueReason = false
  1809. this.keyupSubmit()
  1810. },
  1811. changeStatue(val) {
  1812. if (val == 2) {
  1813. this.statueReason = true
  1814. } else {
  1815. this.statueReason = false
  1816. }
  1817. },
  1818. keyupSubmit() {
  1819. if (this.dialogStatus == 'examine' || this.dialogStatus == 'examines') {
  1820. document.onkeydown = e => {
  1821. const _key = window.event.keyCode
  1822. if (_key === 13) {
  1823. this.createExamineData()
  1824. }
  1825. }
  1826. }
  1827. },
  1828. createExamineData() {
  1829. this.isokDisable = true
  1830. setTimeout(() => {
  1831. this.isokDisable = false
  1832. }, 1000)
  1833. this.$refs['examineTemp'].validate(valid => {
  1834. if (valid) {
  1835. this.createExamineParm.parammaps.partCode = this.examineTemp.partCode
  1836. GetDataByName(this.createExamineParm).then(response => {
  1837. this.requestParam.name = 'partsCharge'
  1838. this.requestParam.parammaps = {}
  1839. this.requestParam.parammaps.id = this.examineTemp.id
  1840. if (this.examineTemp.SHstatue === 1) {
  1841. this.requestParam.parammaps.statue = 1
  1842. } else {
  1843. this.requestParam.parammaps.statue = 2
  1844. }
  1845. this.requestParam.parammaps.empId = Cookies.get('employeid')
  1846. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  1847. if (this.examineTemp.SHstatue === 1) {
  1848. this.requestParam.parammaps.partCode = response.data.list[0].preCode + response.data.list[0].maxcode
  1849. } else {
  1850. this.requestParam.parammaps.partCode = this.createExamineParm.parammaps.partCode
  1851. }
  1852. PostDataByName(this.requestParam).then(response => {
  1853. console.log('审核确认发送参数', this.requestParam)
  1854. if (response.msg !== 'fail') {
  1855. this.get_table_dataSH()
  1856. this.dialogFormVisible_Examine = false
  1857. this.dialogFormVisible_See = false
  1858. this.statueReason = false
  1859. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  1860. } else {
  1861. failproccess(response, this.$notify)
  1862. }
  1863. })
  1864. })
  1865. }
  1866. })
  1867. },
  1868. handleSelectionChange(val) {
  1869. console.log('选择', val.length)
  1870. this.Selection = val.length
  1871. this.selectionList = []
  1872. if (val.length > 0) {
  1873. for (let i = 0; i < val.length; i++) {
  1874. const selectionObj = {}
  1875. selectionObj.id = val[i].id
  1876. selectionObj.statue = val[i].statue
  1877. selectionObj.partCode = val[i].partCode
  1878. this.selectionList.push(selectionObj)
  1879. }
  1880. }
  1881. },
  1882. handleExamines() {
  1883. console.log('点击了批量审批', this.selectionList)
  1884. if (this.Selection > 0) {
  1885. // statue == 0
  1886. for (let i = 0; i < this.selectionList.length; i++) {
  1887. console.log(this.selectionList[i])
  1888. if (this.selectionList[i].statue !== 0) {
  1889. this.$message({ type: 'error', message: '通过审核的备件不可重复审核', duration: 2000 })
  1890. return false
  1891. }
  1892. }
  1893. this.dialogStatus = 'examines'
  1894. this.dialogFormVisible_Examines = true
  1895. this.keyupSubmit()
  1896. } else {
  1897. this.$message({ type: 'error', message: '请选择要审核的数据', duration: 2000 })
  1898. }
  1899. },
  1900. createExamineDatas() {
  1901. console.log(this.selectionList)
  1902. this.postDataPramas.common = { 'returnmap': '0' }
  1903. this.postDataPramas.data = []
  1904. this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectionList }}
  1905. this.postDataPramas.data[0].children = []
  1906. this.postDataPramas.data[0].children[0] = { 'name': 'batchPartsSH', 'type': 'e', 'parammaps': {
  1907. id: '@insertSpotList.id',
  1908. empId: Cookies.get('employeid'),
  1909. partCode: '@insertSpotList.partCode'
  1910. }}
  1911. ExecDataByConfig(this.postDataPramas).then(response => {
  1912. console.log('新增保存发送参数', this.postDataPramas)
  1913. if (response.msg === 'fail') {
  1914. this.$notify({
  1915. title: '保存失败',
  1916. message: response.data,
  1917. type: 'warning',
  1918. duration: 2000
  1919. })
  1920. } else {
  1921. this.dialogFormVisible_Examines = false
  1922. this.get_table_dataSH()
  1923. this.$notify({
  1924. title: '',
  1925. message: '保存成功',
  1926. type: 'success',
  1927. duration: 2000
  1928. })
  1929. }
  1930. })
  1931. },
  1932. handleEAS() {
  1933. this.easStatus.dialogStatus = 'easStatus'
  1934. this.easStatus.dialogFormVisible = true
  1935. this.get_table_dataEasStatusLst()
  1936. },
  1937. get_table_dataEasStatusLst() {
  1938. this.easStatus.listLoading = true
  1939. GetDataByName(this.easStatus.getdataListParm).then(response => {
  1940. if (response.data.list !== null) {
  1941. this.easStatus.list = response.data.list
  1942. } else {
  1943. this.easStatus.list = []
  1944. }
  1945. this.easStatus.pageNum = response.data.pageNum
  1946. this.easStatus.pageSize = response.data.pageSize
  1947. if (response.data.total) {
  1948. this.easStatus.total = response.data.total
  1949. }
  1950. })
  1951. setTimeout(() => {
  1952. this.easStatus.listLoading = false
  1953. }, 100)
  1954. },
  1955. handleManual(row) {
  1956. MessageBox.confirm('是否确认同步此数据至EAS?', {
  1957. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1958. }).then(() => {
  1959. this.requestParam = {}
  1960. this.requestParam.typeIn = row.typeIn
  1961. this.requestParam.billCode = row.billCode
  1962. EasSync(this.requestParam).then((response) => {
  1963. if (response.msg !== 'fail') {
  1964. this.$notify({ title: '成功', message: '手动同步成功', type: 'success', duration: 2000 })
  1965. this.get_table_dataEasStatusLst()
  1966. this.get_table_data()
  1967. } else {
  1968. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  1969. this.get_table_dataEasStatusLst()
  1970. this.get_table_data()
  1971. }
  1972. })
  1973. }).catch(() => {
  1974. this.$message({ type: 'info', message: '已取消手动同步' })
  1975. })
  1976. },
  1977. handleIgnore(row) {
  1978. MessageBox.confirm('是否确认忽略同步此数据?', {
  1979. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1980. }).then(() => {
  1981. this.requestParam = {}
  1982. this.requestParam.name = 'updatepartsSync'
  1983. this.requestParam.parammaps = {}
  1984. this.requestParam.parammaps.issync = '3'
  1985. this.requestParam.parammaps.id = row.id
  1986. PostDataByName(this.requestParam).then((response) => {
  1987. if (response.msg !== 'fail') {
  1988. this.$notify({ title: '成功', message: '忽略同步成功', type: 'success', duration: 2000 })
  1989. this.get_table_dataEasStatusLst()
  1990. this.get_table_data()
  1991. } else {
  1992. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  1993. this.get_table_dataEasStatusLst()
  1994. this.get_table_data()
  1995. }
  1996. })
  1997. }).catch(() => {
  1998. this.$message({ type: 'info', message: '已取消忽略同步' })
  1999. })
  2000. }
  2001. }
  2002. }
  2003. </script>
  2004. <style lang="scss">
  2005. .typeSelect span .el-popover__reference .el-input--suffix {
  2006. top:-3px;
  2007. .el-input__inner{
  2008. height:40px !important;
  2009. }
  2010. }
  2011. .pasture-title{
  2012. height: 50px;
  2013. b{
  2014. line-height: 50px;
  2015. margin: 0 20px;
  2016. }
  2017. }
  2018. .el-step__head.is-success {
  2019. color: #409EFF;
  2020. border-color: #409EFF;
  2021. }
  2022. .el-step__title.is-success{
  2023. color: #409EFF;
  2024. }
  2025. .el-step__head.is-process{
  2026. color: #409EFF;
  2027. border-color: #409EFF;
  2028. .el-step__icon.is-text{
  2029. background: #409EFF;
  2030. color: #fff;
  2031. }
  2032. }
  2033. .step-row{
  2034. color: #000;
  2035. }
  2036. .hide .el-upload--picture-card {
  2037. display: none;
  2038. }
  2039. </style>