index.vue 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="员工姓名" prop="name">
  5. <el-input
  6. v-model="queryParams.name"
  7. placeholder="请输入员工姓名"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="性别" prop="sexs">
  14. <el-select v-model="queryParams.sex" placeholder="请选择" size="small">
  15. <el-option
  16. v-for="dict in dict.type.sys_user_sex"
  17. :key="dict.value"
  18. :label="dict.label"
  19. :value="dict.value"
  20. />
  21. </el-select>
  22. </el-form-item>
  23. <el-form-item label="部门" prop="units">
  24. <el-select v-model="units" placeholder="请选择部门" clearable size="small" multiple>
  25. <el-option
  26. v-for="dict in dict.type.staff_unit"
  27. :key="dict.value"
  28. :label="dict.label"
  29. :value="dict.value"
  30. />
  31. </el-select>
  32. </el-form-item>
  33. <el-form-item label="班值" prop="teams">
  34. <el-select v-model="teams" placeholder="请选择班值" clearable size="small" multiple>
  35. <el-option
  36. v-for="dict in dict.type.team_divide"
  37. :key="dict.value"
  38. :label="dict.label"
  39. :value="dict.value"
  40. />
  41. </el-select>
  42. </el-form-item>
  43. <el-form-item label="实际岗位" prop="actualposts" label-width="200">
  44. <el-select v-model="actualposts" placeholder="请选择实际岗位" clearable size="small" multiple>
  45. <el-option
  46. v-for="dict in dict.type.actualpost"
  47. :key="dict.value"
  48. :label="dict.value+dict.label"
  49. :value="dict.value"
  50. />
  51. </el-select>
  52. </el-form-item>
  53. <el-form-item label="学历" prop="educations" label-width="200">
  54. <el-select v-model="educations" placeholder="请选择学历" clearable size="small" multiple>
  55. <el-option
  56. v-for="dict in dict.type.education"
  57. :key="dict.value"
  58. :label="dict.label"
  59. :value="dict.value"
  60. />
  61. </el-select>
  62. </el-form-item>
  63. <el-form-item label="特殊职能" prop="specialDuty" label-width="200">
  64. <el-select v-model="queryParams.specialDuty" placeholder="请选择特殊职能" clearable
  65. size="small">
  66. <el-option
  67. v-for="dict in dict.type.special_duty"
  68. :key="dict.value"
  69. :label="dict.label"
  70. :value="dict.value"
  71. />
  72. </el-select>
  73. </el-form-item>
  74. <el-form-item>
  75. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  76. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  77. </el-form-item>
  78. </el-form>
  79. <el-row :gutter="10" class="mb8">
  80. <el-col :span="1.5">
  81. <el-button
  82. type="primary"
  83. icon="el-icon-plus"
  84. size="mini"
  85. @click="handleAdd"
  86. v-hasPermi="['plant:staffmgr:add']"
  87. >新增
  88. </el-button>
  89. </el-col>
  90. <el-col :span="1.5">
  91. <el-button
  92. type="success"
  93. icon="el-icon-edit"
  94. size="mini"
  95. :disabled="single"
  96. @click="handleUpdate"
  97. v-hasPermi="['plant:staffmgr:edit']"
  98. >修改
  99. </el-button>
  100. </el-col>
  101. <el-col :span="1.5">
  102. <el-button
  103. type="danger"
  104. icon="el-icon-delete"
  105. size="mini"
  106. :disabled="multiple"
  107. @click="handleDelete"
  108. v-hasPermi="['plant:staffmgr:remove']"
  109. >删除
  110. </el-button>
  111. </el-col>
  112. <el-col :span="1.5">
  113. <el-button
  114. type="info"
  115. icon="el-icon-upload2"
  116. size="mini"
  117. @click="handleImport"
  118. v-hasPermi="['plant:staffmgr:edit']"
  119. >导入
  120. </el-button>
  121. </el-col>
  122. <el-col :span="1.5">
  123. <el-button
  124. type="warning"
  125. icon="el-icon-download"
  126. size="mini"
  127. @click="handleExport"
  128. v-hasPermi="['plant:staffmgr:export']"
  129. >导出
  130. </el-button>
  131. </el-col>
  132. <el-col :span="1.5">
  133. <el-button
  134. type="primary"
  135. icon="el-icon-s-data"
  136. size="mini"
  137. @click="handleData"
  138. >数据分析
  139. </el-button>
  140. </el-col>
  141. <el-col :span="1.5">
  142. <el-button
  143. type="success"
  144. icon="el-icon-s-release"
  145. size="mini"
  146. @click="handleLeft"
  147. >离岗名单
  148. </el-button>
  149. </el-col>
  150. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  151. </el-row>
  152. <el-table v-loading="loading" :data="staffmgrList" @selection-change="handleSelectionChange" :height="clientHeight"
  153. border>
  154. <el-table-column type="selection" width="55" align="center"/>
  155. <el-table-column label="部门" align="center" prop="unit" fixed="left" width="180">
  156. <template slot-scope="scope">
  157. <dict-tag :options="dict.type.staff_unit" :value="scope.row.unit"/>
  158. </template>
  159. </el-table-column>
  160. <el-table-column label="员工编号" align="center" prop="staffid" :show-overflow-tooltip="true" fixed="left"
  161. width="100"/>
  162. <el-table-column label="员工姓名" align="center" prop="name" :show-overflow-tooltip="true" fixed="left"
  163. width="100"/>
  164. <el-table-column label="性别" align="center" prop="sex">
  165. <template slot-scope="scope">
  166. <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex" width="230"/>
  167. </template>
  168. </el-table-column>
  169. <el-table-column label="身份证号" align="center" prop="idCard" v-hasPermi="['plant:staffmgr:detail']"
  170. width="230"/>
  171. <el-table-column label="联系方式" align="center" prop="contact" :show-overflow-tooltip="true" width="230"/>
  172. <el-table-column label="岗位" align="center" prop="actualpost" width="230">
  173. <template slot-scope="scope">
  174. <dict-tag :options="dict.type.actualpost" :value="scope.row.actualpost"/>
  175. </template>
  176. </el-table-column>
  177. <el-table-column label="邮箱" align="center" prop="mail" :show-overflow-tooltip="true" width="230"/>
  178. <el-table-column label="班组" align="center" prop="team" width="230">
  179. <template slot-scope="scope">
  180. <dict-tag :options="dict.type.team_divide" :value="scope.row.team"/>
  181. </template>
  182. </el-table-column>
  183. <el-table-column label="住址" align="center" prop="address" v-hasPermi="['plant:staffmgr:detail']"
  184. :show-overflow-tooltip="true" width="230"/>
  185. <el-table-column label="学历" align="center" prop="education" width="230">
  186. <template slot-scope="scope">
  187. <dict-tag :options="dict.type.education" :value="scope.row.education"/>
  188. </template>
  189. </el-table-column>
  190. <el-table-column label="专业" align="center" prop="speciality" v-hasPermi="['plant:staffmgr:detail']"
  191. width="230"/>
  192. <el-table-column label="特殊职能" align="center" prop="specialDuty" :show-overflow-tooltip="true" width="230">
  193. <template slot-scope="scope">
  194. <dict-tag :options="dict.type.special_duty" :value="scope.row.specialDuty"/>
  195. </template>
  196. </el-table-column>
  197. <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true" width="230"/>
  198. <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" width="250">
  199. <template slot-scope="scope">
  200. <el-button
  201. size="mini"
  202. type="text"
  203. icon="el-icon-edit"
  204. @click="handleUpdate(scope.row)"
  205. v-hasPermi="['plant:staffmgr:edit']"
  206. >修改
  207. </el-button>
  208. <el-button
  209. size="mini"
  210. type="text"
  211. icon="el-icon-delete"
  212. @click="handleDelete(scope.row)"
  213. v-hasPermi="['plant:staffmgr:remove']"
  214. >删除
  215. </el-button>
  216. <el-button
  217. size="mini"
  218. type="text"
  219. icon="el-icon-s-release"
  220. @click="openRecord(scope.row,false)"
  221. v-hasPermi="['plant:staffmgr:remove']"
  222. >变更记录
  223. </el-button>
  224. <el-button
  225. size="mini"
  226. type="text"
  227. icon="el-icon-document"
  228. @click="handleDoc(scope.row)"
  229. >附件
  230. </el-button>
  231. </template>
  232. </el-table-column>
  233. </el-table>
  234. <pagination
  235. v-show="total>0"
  236. :total="total"
  237. :page.sync="queryParams.pageNum"
  238. :limit.sync="queryParams.pageSize"
  239. @pagination="getList"
  240. />
  241. <!-- 添加或修改人员管理对话框 -->
  242. <el-dialog :close-on-click-modal="false" v-dialogDrag ref="dialog__wrapper" :title="title" :visible.sync="open"
  243. width="700px" append-to-body>
  244. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  245. <el-row>
  246. <el-col :span="12">
  247. <el-form-item label="装置名称" prop="plantCode">
  248. <el-select v-model="form.plantCode" placeholder="请选择装置名称">
  249. <el-option
  250. v-for="dict in dict.type.plant_divide"
  251. :key="dict.value"
  252. :label="dict.label"
  253. :value="dict.value"
  254. ></el-option>
  255. </el-select>
  256. </el-form-item>
  257. </el-col>
  258. <el-col :span="12">
  259. <el-form-item label="员工编号" prop="staffid">
  260. <el-input v-model="form.staffid" placeholder="请输入员工编号"/>
  261. </el-form-item>
  262. </el-col>
  263. </el-row>
  264. <el-row>
  265. <el-col :span="12">
  266. <el-form-item label="员工姓名" prop="name">
  267. <el-input v-model="form.name" placeholder="请输入员工姓名"/>
  268. </el-form-item>
  269. </el-col>
  270. <el-col :span="12">
  271. <el-form-item label="性别" prop="sex">
  272. <el-select v-model="form.sex" placeholder="请选择性别">
  273. <el-option
  274. v-for="dict in dict.type.sys_user_sex"
  275. :key="dict.value"
  276. :label="dict.label"
  277. :value="dict.value"
  278. ></el-option>
  279. </el-select>
  280. </el-form-item>
  281. </el-col>
  282. </el-row>
  283. <el-row>
  284. <el-col :span="12">
  285. <el-form-item label="部门" prop="unit">
  286. <el-select v-model="form.unit" placeholder="请选择部门">
  287. <el-option
  288. v-for="dict in dict.type.staff_unit"
  289. :key="dict.value"
  290. :label="dict.label"
  291. :value="dict.value"
  292. ></el-option>
  293. </el-select>
  294. </el-form-item>
  295. </el-col>
  296. </el-row>
  297. <el-row>
  298. <el-col :span="12">
  299. <el-form-item label="身份证号" prop="idCard">
  300. <el-input v-model="form.idCard" placeholder="请输入身份证号"/>
  301. </el-form-item>
  302. </el-col>
  303. <el-col :span="12">
  304. <el-form-item label="家庭住址" prop="address">
  305. <el-input v-model="form.address" placeholder="请输入家庭住址"/>
  306. </el-form-item>
  307. </el-col>
  308. </el-row>
  309. <el-row>
  310. <el-col :span="12">
  311. <el-form-item label="班组" prop="team">
  312. <el-select v-model="form.team" placeholder="请选择班组" :disabled="isEidt">
  313. <el-option
  314. v-for="dict in dict.type.team_divide"
  315. :key="dict.value"
  316. :label="dict.label"
  317. :value="dict.value"
  318. ></el-option>
  319. </el-select>
  320. </el-form-item>
  321. </el-col>
  322. <el-col :span="12">
  323. <el-form-item label="岗位" prop="actualpost">
  324. <el-select v-model="form.actualpost" placeholder="请选择岗位" :disabled="isEidt">
  325. <el-option
  326. v-for="dict in dict.type.actualpost"
  327. :key="dict.value"
  328. :label="dict.label"
  329. :value="dict.value"
  330. ></el-option>
  331. </el-select>
  332. </el-form-item>
  333. </el-col>
  334. </el-row>
  335. <el-row>
  336. <el-col :span="12">
  337. <el-form-item label="联系方式" prop="contact">
  338. <el-input v-model="form.contact" placeholder="请输入联系方式"/>
  339. </el-form-item>
  340. </el-col>
  341. <el-col :span="12">
  342. <el-form-item label="学历" prop="educations">
  343. <el-select v-model="form.education" placeholder="请选择学历">
  344. <el-option
  345. v-for="dict in dict.type.education"
  346. :key="dict.value"
  347. :label="dict.label"
  348. :value="dict.value"
  349. ></el-option>
  350. </el-select>
  351. </el-form-item>
  352. </el-col>
  353. </el-row>
  354. <el-row>
  355. <el-col :span="12">
  356. <el-form-item label="专业" prop="speciality">
  357. <el-input v-model="form.speciality" placeholder="请输入专业"/>
  358. </el-form-item>
  359. </el-col>
  360. <el-col :span="12">
  361. <el-form-item label="邮箱" prop="mail">
  362. <el-input v-model="form.mail" placeholder="请输入邮箱"/>
  363. </el-form-item>
  364. </el-col>
  365. </el-row>
  366. <el-row>
  367. <el-col :span="12">
  368. <el-form-item label="上级领导" prop="pId">
  369. <treeselect v-model="form.pId" :options="pIdOptions" :normalizer="normalizer"
  370. placeholder="请选择上级领导"/>
  371. </el-form-item>
  372. </el-col>
  373. <el-col :span="12">
  374. <el-form-item label="归属部门" prop="deptId">
  375. <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true"
  376. placeholder="请选择归属部门"/>
  377. </el-form-item>
  378. </el-col>
  379. </el-row>
  380. <el-row>
  381. <el-col :span="12">
  382. <el-form-item label="备注" prop="remarks">
  383. <el-input v-model="form.remarks" placeholder="请输入备注" type="textarea"/>
  384. </el-form-item>
  385. </el-col>
  386. <el-col :span="12">
  387. <!--<el-form-item label="证件照" prop="photo">
  388. <el-upload
  389. ref="photo"
  390. class="avatar-uploader"
  391. :headers="photo.headers"
  392. :action="photo.url + '?pType=' + photo.pType + '&pId=' + photo.pId"
  393. :show-file-list="false"
  394. :on-progress="handleAvatarProgress"
  395. :on-success="handleAvatarSuccess"
  396. :auto-upload="false"
  397. >
  398. <img v-if="form.photo" :src="photoUrl" class="avatar">
  399. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  400. </el-upload>
  401. </el-form-item>-->
  402. <el-form-item label="证件照" prop="photo" v-if="notPhoto === true">
  403. <el-upload
  404. ref="photo"
  405. :headers="photo.headers"
  406. :action="photo.url + '?pType=' + photo.pType + '&pId=' + photo.pId"
  407. :show-file-list="false"
  408. :on-success="handleAvatarSuccess"
  409. list-type="picture-card">
  410. <img v-if="photoUrl" :src="photoUrl" class="avatar">
  411. <i v-else class="el-icon-plus "></i>
  412. </el-upload>
  413. <el-dialog :close-on-click-modal="false" v-dialogDrag :visible.sync="dialogVisible" append-to-body>
  414. <img width="100%" :src="dialogImageUrl" alt="">
  415. </el-dialog>
  416. </el-form-item>
  417. </el-col>
  418. </el-row>
  419. <el-row>
  420. <el-col :span="12">
  421. <el-form-item label="特殊职能" prop="specialDuty">
  422. <el-select v-model="specialDutys" multiple placeholder="请选择特殊职能">
  423. <el-option
  424. v-for="dict in dict.type.special_duty"
  425. :key="dict.value"
  426. :label="dict.label"
  427. :value="dict.value"
  428. ></el-option>
  429. </el-select>
  430. </el-form-item>
  431. </el-col>
  432. <el-col :span="12" v-if="form.delFlag == 9">
  433. <el-form-item label="离岗日期" prop="leftDate">
  434. <el-date-picker clearable size="small" style="width: 200px"
  435. v-model="form.leftDate"
  436. type="date"
  437. value-format="yyyy-MM-dd"
  438. placeholder="请选择离岗日期">
  439. </el-date-picker>
  440. </el-form-item>
  441. </el-col>
  442. </el-row>
  443. </el-form>
  444. <div slot="footer" class="dialog-footer">
  445. <el-button type="primary" @click="submitForm">确 定</el-button>
  446. <el-button @click="cancel">取 消</el-button>
  447. </div>
  448. </el-dialog>
  449. <!-- 用户导入对话框 -->
  450. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open"
  451. width="400px" append-to-body>
  452. <el-upload
  453. ref="upload"
  454. :limit="1"
  455. accept=".xlsx, .xls"
  456. :headers="upload.headers"
  457. :action="upload.url"
  458. :disabled="upload.isUploading"
  459. :on-progress="handleFileUploadProgress"
  460. :on-success="handleFileSuccess"
  461. :auto-upload="false"
  462. drag
  463. >
  464. <i class="el-icon-upload"></i>
  465. <div class="el-upload__text">
  466. 将文件拖到此处,或
  467. <em>点击上传</em>
  468. </div>
  469. <div class="el-upload__tip" slot="tip">
  470. <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
  471. <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
  472. </div>
  473. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  474. <input name="type" :value="upload.type" hidden/>
  475. </form>
  476. <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  477. </el-upload>
  478. <div slot="footer" class="dialog-footer">
  479. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  480. <el-button @click="upload.open = false">取 消</el-button>
  481. </div>
  482. </el-dialog>
  483. <!-- 报告附件对话框 -->
  484. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="700px"
  485. append-to-body>
  486. <el-upload
  487. ref="doc"
  488. :limit="50"
  489. :headers="doc.headers"
  490. :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
  491. :disabled="doc.isUploading"
  492. :on-progress="handleFileDocProgress"
  493. :on-success="handleFileDocSuccess"
  494. :auto-upload="true"
  495. drag
  496. >
  497. <i class="el-icon-upload"></i>
  498. <div class="el-upload__text">
  499. 将文件拖到此处,或
  500. <em>点击上传</em>
  501. </div>
  502. </el-upload>
  503. <el-table :data="doc.commonfileList" border>
  504. <el-table-column label="文件名" align="center" prop="fileName" :show-overflow-tooltip="true">
  505. <template slot-scope="scope">
  506. <a class="link-type" @click="handleDownload(scope.row)">
  507. <span>{{ scope.row.fileName }}</span>
  508. </a>
  509. </template>
  510. </el-table-column>
  511. <el-table-column label="大小(Kb)" align="center" prop="fileSize" :show-overflow-tooltip="true"
  512. width="80"/>
  513. <el-table-column label="上传人" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  514. <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width">
  515. <template slot-scope="scope">
  516. <el-button
  517. v-if="scope.row.fileName.endsWith('pdf')"
  518. size="mini"
  519. type="text"
  520. icon="el-icon-view"
  521. @click="handleSee(scope.row)"
  522. >预览
  523. </el-button>
  524. <el-button
  525. size="mini"
  526. type="text"
  527. icon="el-icon-download"
  528. @click="handleDownload(scope.row)"
  529. >下载
  530. </el-button>
  531. <el-button
  532. size="mini"
  533. type="text"
  534. icon="el-icon-delete"
  535. @click="handleDeleteDoc(scope.row)"
  536. >删除
  537. </el-button>
  538. </template>
  539. </el-table-column>
  540. </el-table>
  541. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px"
  542. append-to-body>
  543. <div style="margin-top: -60px;float: right;margin-right: 40px;">
  544. <el-button size="mini" type="text" @click="openPdf">新页面打开PDF</el-button>
  545. </div>
  546. <div style="margin-top: -30px">
  547. <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
  548. </div>
  549. </el-dialog>
  550. <div slot="footer" class="dialog-footer">
  551. <!-- <el-button type="primary" @click="submitFileForm">确 定</el-button>-->
  552. <el-button @click="doc.open = false">返 回</el-button>
  553. </div>
  554. </el-dialog>
  555. <!-- 离岗人员对话框 -->
  556. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="left.title" :visible.sync="left.open" width="700px"
  557. append-to-body>
  558. <el-table :data="left.staffmgrList" border>
  559. <el-table-column label="员工编号" align="center" prop="staffid" :show-overflow-tooltip="true"/>
  560. <el-table-column label="员工姓名" align="center" prop="name" :show-overflow-tooltip="true"/>
  561. <el-table-column label="离岗日期" align="center" prop="leftDate" :show-overflow-tooltip="true">
  562. <template slot-scope="scope">
  563. <span>{{ parseTime(scope.row.leftDate, '{y}-{m}-{d}') }}</span>
  564. </template>
  565. </el-table-column>
  566. <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width">
  567. <template slot-scope="scope">
  568. <el-button
  569. size="mini"
  570. type="text"
  571. icon="el-icon-s-promotion"
  572. @click="openRecord(scope.row,true)"
  573. >离岗详情
  574. </el-button>
  575. <el-button
  576. size="mini"
  577. type="text"
  578. icon="el-icon-edit"
  579. @click="handleUpdate(scope.row)"
  580. v-hasPermi="['plant:staffmgr:edit']"
  581. >修改
  582. </el-button>
  583. <el-button
  584. size="mini"
  585. type="text"
  586. @click="handleReLeft(scope.row)"
  587. >复职
  588. </el-button>
  589. </template>
  590. </el-table-column>
  591. </el-table>
  592. <div slot="footer" class="dialog-footer">
  593. <!-- <el-button type="primary" @click="submitFileForm">确 定</el-button>-->
  594. <el-button @click="left.open = false">返 回</el-button>
  595. </div>
  596. </el-dialog>
  597. <el-drawer
  598. title="数据分析"
  599. size="600px"
  600. :visible.sync="drawer"
  601. :direction="direction">
  602. <el-row>
  603. <el-col>
  604. <el-card class="box-card" shadow="hover">
  605. <div slot="header" class="clearfix">
  606. <span>学历统计</span>
  607. </div>
  608. <div class="text item">
  609. <edu-chart></edu-chart>
  610. </div>
  611. </el-card>
  612. </el-col>
  613. </el-row>
  614. <el-row>
  615. <el-col>
  616. <el-card class="box-card" shadow="hover">
  617. <div slot="header" class="clearfix">
  618. <span>班值统计</span>
  619. </div>
  620. <div class="text item">
  621. <team-chart></team-chart>
  622. </div>
  623. </el-card>
  624. </el-col>
  625. </el-row>
  626. </el-drawer>
  627. <el-dialog :close-on-click-modal="false" :visible.sync="record.open" v-dialogDrag width="60%" append-to-body>
  628. <el-row class="mb8">
  629. <el-button
  630. size="mini"
  631. type="primary"
  632. v-if="!record.flag"
  633. icon="el-icon-plus"
  634. @click="handleAddRecord()"
  635. >新增
  636. </el-button>
  637. </el-row>
  638. <el-table v-loading="record.loading" :data="record.recordList" border>
  639. <el-table-column label="类型" align="center" prop="type">
  640. <template slot-scope="scope">
  641. <el-select v-if="scope.row.isEdit" v-model="scope.row.type" placeholder="请选择类型"
  642. @change="selectChange(scope.row)">
  643. <el-option
  644. v-for="dict in dict.type.reassignment"
  645. :key="dict.value"
  646. :label="dict.label"
  647. :value="dict.value"
  648. ></el-option>
  649. </el-select>
  650. <span v-else>{{ scope.row.type }}</span>
  651. </template>
  652. </el-table-column>
  653. <el-table-column label="record.columnName" align="center" prop="change" v-if="record.columnFlag">
  654. <template slot-scope="scope">
  655. <el-select v-if="scope.row.isEdit&&scope.row.type=='调班'" v-model="scope.row.change"
  656. placeholder="请选择班组">
  657. <el-option
  658. v-for="dict in dict.type.team_divide"
  659. :key="dict.value"
  660. :label="dict.label"
  661. :value="dict.value"
  662. ></el-option>
  663. </el-select>
  664. <el-select v-if="scope.row.isEdit&&scope.row.type=='调岗'" v-model="scope.row.change"
  665. placeholder="请选择岗位">
  666. <el-option
  667. v-for="dict in dict.type.actualpost"
  668. :key="dict.value"
  669. :label="dict.label"
  670. :value="dict.value"
  671. ></el-option>
  672. </el-select>
  673. </template>
  674. </el-table-column>
  675. <el-table-column label="日期" align="center" prop="actionDate" width="180">
  676. <template slot-scope="scope">
  677. <el-date-picker style="width: auto"
  678. v-if="scope.row.isEdit"
  679. v-model="scope.row.actionDate"
  680. type="date"
  681. value-format="yyyy-MM-dd"
  682. placeholder="日期">
  683. </el-date-picker>
  684. <span v-else>{{ parseTime(scope.row.actionDate, '{y}-{m}-{d}') }}</span>
  685. </template>
  686. </el-table-column>
  687. <el-table-column label="操作原因" align="center" prop="content">
  688. <template slot-scope="scope">
  689. <el-input v-if="scope.row.isEdit" type="textarea" v-model="scope.row.content"
  690. placeholder="请输入操作原因"/>
  691. <span v-else>{{ scope.row.content }}</span>
  692. </template>
  693. </el-table-column>
  694. <el-table-column label="备注" align="center" prop="remarks">
  695. <template slot-scope="scope">
  696. <el-input v-if="scope.row.isEdit" type="textarea" v-model="scope.row.remarks" placeholder="请输入备注"/>
  697. <span v-else>{{ scope.row.remarks }}</span>
  698. </template>
  699. </el-table-column>
  700. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  701. <template slot-scope="scope">
  702. <el-button v-if="scope.row.isEdit"
  703. size="mini"
  704. type="text"
  705. icon="el-icon-check"
  706. @click="save(scope.row)"
  707. >保存
  708. </el-button>
  709. <el-button v-if="scope.row.isEdit"
  710. size="mini"
  711. type="text"
  712. icon="el-icon-close"
  713. @click="cancelRecord(scope.row,scope.$index)"
  714. >取消
  715. </el-button>
  716. </template>
  717. </el-table-column>
  718. </el-table>
  719. </el-dialog>
  720. </div>
  721. </template>
  722. <script>
  723. import {
  724. listStaffmgr,
  725. listpIdStaffmgr,
  726. listLeftStaffmgr,
  727. getStaffmgr,
  728. delStaffmgr,
  729. delLeftStaffmgr,
  730. reLeftStaffmgr,
  731. addStaffmgr,
  732. updateStaffmgr,
  733. exportStaffmgr
  734. } from "@/api/plant/staffmgr";
  735. import {listDept, treeselect} from "@/api/system/dept";
  736. import {getToken} from "@/utils/auth";
  737. import Treeselect from "@riophae/vue-treeselect";
  738. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  739. import EduChart from "./eduChart.vue";
  740. import TeamChart from "./teamChart.vue";
  741. import {addRecord, listRecord, updateRecord} from "@/api/plant/record";
  742. import {deptTreeSelect} from "@/api/system/user";
  743. export default {
  744. dicts: ['sys_user_sex', 'staff_unit', 'team_divide', 'actualpost', 'education', 'special_duty', 'plant_divide', 'reassignment'],
  745. name: "Staffmgr",
  746. components: {TeamChart, EduChart, Treeselect},
  747. data() {
  748. return {
  749. record: {
  750. open: false,
  751. flag: false,
  752. recordList: [],
  753. loading: false,
  754. isEdit: false,
  755. staffmgrId: null,
  756. columnName: '',
  757. columnFlag: false,
  758. },
  759. isEidt: false,
  760. drawer: false,
  761. direction: 'rtl',
  762. // 遮罩层
  763. loading: true,
  764. // 选中数组
  765. ids: [],
  766. // 非单个禁用
  767. single: true,
  768. // 非多个禁用
  769. multiple: true,
  770. // 显示搜索条件
  771. showSearch: false,
  772. // 总条数
  773. total: 0,
  774. // 人员管理表格数据
  775. staffmgrList: [],
  776. //目标措施树选项
  777. pIdOptions: [],
  778. // 弹出层标题
  779. title: "",
  780. // 部门树选项
  781. deptOptions: undefined,
  782. clientHeight: 300,
  783. // 是否显示弹出层
  784. open: false,
  785. // 装置名称字典
  786. plantCodeOptions: [],
  787. // 性别字典
  788. sexOptions: [],
  789. // 部门字典
  790. unitOptions: [],
  791. // 班值字典
  792. teamOptions: [],
  793. // 实际岗位字典
  794. actualpostOptions: [],
  795. // 学历字典
  796. educationOptions: [],
  797. // 英语能力字典
  798. enAbilityOptions: [],
  799. // 特殊职能字典
  800. specialDutyOptions: [],
  801. // 职位变更类型字典
  802. reassignmentOptions: [],
  803. //照片url
  804. photoUrl: '',
  805. //新增不可上传照片
  806. notPhoto: false,
  807. // 用户导入参数
  808. upload: {
  809. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  810. //下载模板类型
  811. type: "staffmgr",
  812. // 是否显示弹出层(用户导入)
  813. open: false,
  814. // 弹出层标题(用户导入)
  815. title: "",
  816. // 是否禁用上传
  817. isUploading: false,
  818. // 是否更新已经存在的用户数据
  819. updateSupport: 0,
  820. // 设置上传的请求头部
  821. headers: {Authorization: "Bearer " + getToken()},
  822. // 上传的地址
  823. url: process.env.VUE_APP_BASE_API + "/plant/staffmgr/importData"
  824. },
  825. // 报告附件参数
  826. doc: {
  827. file: "",
  828. // 是否显示弹出层(报告附件)
  829. open: false,
  830. // 弹出层标题(报告附件)
  831. title: "",
  832. // 是否禁用上传
  833. isUploading: false,
  834. // 是否更新已经存在的用户数据
  835. updateSupport: 0,
  836. // 报告附件上传位置编号
  837. ids: 0,
  838. // 设置上传的请求头部
  839. headers: {Authorization: "Bearer " + getToken()},
  840. // 上传的地址
  841. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  842. commonfileList: null,
  843. queryParams: {
  844. pId: null,
  845. pType: 'staffmgr'
  846. },
  847. pType: 'staffmgr',
  848. pId: null
  849. },
  850. // 人员证件照参数
  851. photo: {
  852. file: "",
  853. // 报告附件上传位置编号
  854. ids: 0,
  855. // 设置上传的请求头部
  856. headers: {Authorization: "Bearer " + getToken()},
  857. // 上传的地址
  858. url: process.env.VUE_APP_BASE_API + "/plant/staffmgr/uploadPhoto",
  859. pType: 'staffmgrPhoto',
  860. pId: null
  861. },
  862. //证件照回显
  863. dialogImageUrl: '',
  864. dialogVisible: false,
  865. pdf: {
  866. title: '',
  867. pdfUrl: '',
  868. numPages: null,
  869. open: false,
  870. pageNum: 1,
  871. pageTotalNum: 1,
  872. loadedRatio: 0,
  873. },
  874. // 离岗人员
  875. left: {
  876. file: "",
  877. // 是否显示弹出层(报告附件)
  878. open: false,
  879. // 弹出层标题(报告附件)
  880. title: "",
  881. staffmgrList: []
  882. },
  883. // 查询参数
  884. queryParams: {
  885. pageNum: 1,
  886. pageSize: 20,
  887. name: null,
  888. sexs: null,
  889. sex: [],
  890. unit: null,
  891. team: null,
  892. actualpost: null,
  893. education: null,
  894. enAbility: null,
  895. educations: null,
  896. units: null,
  897. teams: null,
  898. actualposts: null,
  899. enAbilitys: null,
  900. photo: null,
  901. specialDuty: null
  902. },
  903. querypIdParams: {
  904. units: '1',
  905. },
  906. educations: [],
  907. units: [],
  908. teams: [],
  909. actualposts: [],
  910. enAbilitys: [],
  911. specialDutys: [],
  912. // 表单参数
  913. form: {},
  914. // 表单校验
  915. rules: {
  916. plantCode: [
  917. {required: true, message: '装置名称不能为空', trigger: "change"}
  918. ],
  919. staffid: [
  920. {required: true, message: '员工编号不能为空', trigger: "blur"}
  921. ],
  922. name: [
  923. {required: true, message: '员工姓名不能为空', trigger: "blur"}
  924. ],
  925. sex: [
  926. {required: true, message: '性别不能为空', trigger: "change"}
  927. ],
  928. unit: [
  929. {required: true, message: '部门不能为空', trigger: "change"}
  930. ],
  931. team: [
  932. {required: true, message: '班值不能为空', trigger: "change"}
  933. ],
  934. actualpost: [
  935. {required: true, message: '实际岗位不能为空', trigger: "change"}
  936. ],
  937. pId: [
  938. {required: true, message: '上级领导不能为空', trigger: "change"}
  939. ],
  940. deptId: [
  941. {required: true, message: '归属部门不能为空', trigger: "change"}
  942. ],
  943. }
  944. };
  945. },
  946. watch: {
  947. // 根据名称筛选部门树
  948. deptName(val) {
  949. this.$refs.tree.filter(val);
  950. }
  951. },
  952. created() {
  953. //设置表格高度对应屏幕高度
  954. this.$nextTick(() => {
  955. this.clientHeight = (document.body.clientHeight - 80) * 0.8
  956. })
  957. this.getList();
  958. this.getpIdTreeselect();
  959. this.getTreeselect();
  960. },
  961. methods: {
  962. selectChange(row) {
  963. if (row.type == '调班') {
  964. this.record.columnName = '班组';
  965. this.record.columnFlag = true;
  966. } else if (row.type == '调岗') {
  967. this.record.columnName = '岗位';
  968. this.record.columnFlag = true;
  969. } else {
  970. this.record.columnFlag = false;
  971. }
  972. },
  973. handleAddRecord() {
  974. this.record.columnFlag = false;
  975. this.record.recordList.push({
  976. type: null,
  977. isEdit: true,
  978. isAdd: true,
  979. content: null,
  980. change: null,
  981. actionDate: new Date(),
  982. remarks: null,
  983. staffmgrId: this.record.staffmgrId
  984. })
  985. },
  986. handleUpdateRecord(row) {
  987. console.log(row)
  988. // 备份原始数据
  989. row['oldRow'] = JSON.parse(JSON.stringify(row));
  990. if (row.type == '调班') {
  991. this.record.columnName = '班组';
  992. this.record.columnFlag = true;
  993. } else if (row.type == '调岗') {
  994. this.record.columnName = '岗位';
  995. this.record.columnFlag = true;
  996. } else {
  997. this.record.columnFlag = false;
  998. }
  999. row.isEdit = true;
  1000. },
  1001. cancelRecord(row, index) {
  1002. // 如果是新增的数据
  1003. if (row.isAdd) {
  1004. this.record.recordList.splice(index, 1)
  1005. } else {
  1006. // 不是新增的数据 还原数据
  1007. for (const i in row.oldRow) {
  1008. row[i] = row.oldRow[i]
  1009. }
  1010. row.isEdit = false;
  1011. }
  1012. this.record.columnFlag = false;
  1013. },
  1014. save(row) {
  1015. if (row.type == null) {
  1016. this.$message.warning("类型不能为空")
  1017. return
  1018. }
  1019. if (row.type === '离岗')
  1020. this.handleLeftDelete(row.staffmgrId);
  1021. if (row.isAdd) {
  1022. let data = {
  1023. type: row.type,
  1024. content: row.content,
  1025. change: row.change,
  1026. actionDate: row.actionDate,
  1027. remarks: row.remarks,
  1028. staffmgrId: row.staffmgrId
  1029. }
  1030. addRecord(data).then(res => {
  1031. this.$message.success("保存成功")
  1032. row.isEdit = false;
  1033. row.isAdd = false;
  1034. this.getRecordList({staffmgrId: row.staffmgrId});
  1035. this.record.columnFlag = false;
  1036. this.getList();
  1037. })
  1038. } else {
  1039. let data = {
  1040. recordId: row.recordId,
  1041. type: row.type,
  1042. content: row.content,
  1043. change: row.change,
  1044. actionDate: row.actionDate,
  1045. remarks: row.remarks,
  1046. staffmgrId: row.staffmgrId
  1047. }
  1048. updateRecord(data).then(res => {
  1049. this.$message.success("保存成功")
  1050. row.isEdit = false;
  1051. row.isAdd = false;
  1052. this.getRecordList({staffmgrId: row.staffmgrId});
  1053. this.record.columnFlag = false;
  1054. this.getList();
  1055. })
  1056. }
  1057. },
  1058. openRecord(row, flag) {
  1059. this.record.open = true;
  1060. this.record.flag = flag;
  1061. this.record.staffmgrId = row.id;
  1062. let data = {staffmgrId: row.id}
  1063. if (flag) {
  1064. data.type = '离岗'
  1065. }
  1066. this.getRecordList(data);
  1067. },
  1068. /** 查询人员操作记录列表 */
  1069. getRecordList(data) {
  1070. this.record.loading = true;
  1071. listRecord(data).then(response => {
  1072. this.record.recordList = response.data;
  1073. this.record.loading = false;
  1074. });
  1075. },
  1076. /** 查询人员管理列表 */
  1077. getList() {
  1078. this.loading = true;
  1079. this.queryParams.educations = this.educations.join()
  1080. this.queryParams.units = this.units.join()
  1081. this.queryParams.teams = this.teams.join()
  1082. this.queryParams.actualposts = this.actualposts.join()
  1083. this.queryParams.enAbilitys = this.enAbilitys.join()
  1084. listStaffmgr(this.queryParams).then(response => {
  1085. this.staffmgrList = response.rows;
  1086. this.total = response.total;
  1087. this.loading = false;
  1088. });
  1089. },
  1090. /** 查询部门下拉树结构 */
  1091. getTreeselect() {
  1092. treeselect().then(response => {
  1093. this.deptOptions = response.data;
  1094. });
  1095. },
  1096. /** 转换目标录入数据结构 */
  1097. normalizer(node) {
  1098. if (node.children && !node.children.length) {
  1099. delete node.children;
  1100. }
  1101. return {
  1102. id: node.id,
  1103. label: node.name,
  1104. children: node.children
  1105. };
  1106. },
  1107. /** 查询列表下拉树结构 */
  1108. getpIdTreeselect() {
  1109. listpIdStaffmgr(this.querypIdParams).then(response => {
  1110. this.pIdOptions = [];
  1111. const data = {id: 0, name: '顶级节点', children: []};
  1112. data.children = this.handleTree(response.data, "id", "pId");
  1113. this.pIdOptions.push(data);
  1114. });
  1115. },
  1116. // 取消按钮
  1117. cancel() {
  1118. this.open = false;
  1119. this.reset();
  1120. },
  1121. // 表单重置
  1122. reset() {
  1123. this.photoUrl = '';
  1124. this.specialDutys = [];
  1125. this.form = {
  1126. id: null,
  1127. plantCode: '1',
  1128. staffid: null,
  1129. name: null,
  1130. sex: null,
  1131. birthday: null,
  1132. unit: null,
  1133. team: null,
  1134. actualpost: null,
  1135. contact: null,
  1136. education: null,
  1137. enAbility: null,
  1138. accidentNum: null,
  1139. mail: null,
  1140. delFlag: null,
  1141. createrCode: null,
  1142. photoUrl: '',
  1143. createdate: null,
  1144. updaterCode: null,
  1145. updatedate: null,
  1146. deptId: null,
  1147. skillScore: null,
  1148. remarks: null,
  1149. photo: null,
  1150. pId: null,
  1151. speciality: null,
  1152. address: null,
  1153. idCard: null,
  1154. specialDuty: null
  1155. };
  1156. this.resetForm("form");
  1157. },
  1158. /** 搜索按钮操作 */
  1159. handleQuery() {
  1160. this.queryParams.pageNum = 1;
  1161. this.getList();
  1162. },
  1163. /** 重置按钮操作 */
  1164. resetQuery() {
  1165. this.resetForm("queryForm");
  1166. this.educations = []
  1167. this.units = []
  1168. this.teams = []
  1169. this.actualposts = []
  1170. this.enAbilitys = []
  1171. this.handleQuery();
  1172. },
  1173. // 多选框选中数据
  1174. handleSelectionChange(selection) {
  1175. this.ids = selection.map(item => item.id)
  1176. this.single = selection.length !== 1
  1177. this.multiple = !selection.length
  1178. },
  1179. /** 新增按钮操作 */
  1180. handleAdd() {
  1181. this.reset();
  1182. this.isEidt = false;
  1183. this.open = true;
  1184. this.notPhoto = false;
  1185. this.title = '新增 人员管理';
  1186. },
  1187. /** 修改按钮操作 */
  1188. handleUpdate(row) {
  1189. this.reset();
  1190. this.isEidt = true;
  1191. const id = row.id || this.ids
  1192. getStaffmgr(id).then(response => {
  1193. this.form = response.data;
  1194. if (response.data.photo) {
  1195. this.photoUrl = process.env.VUE_APP_BASE_API + response.data.photo;
  1196. }
  1197. if (response.data.specialDuty) {
  1198. this.specialDutys = response.data.specialDuty.split(',');
  1199. } else {
  1200. this.specialDutys = [];
  1201. }
  1202. this.open = true;
  1203. this.notPhoto = true;
  1204. this.title = '修改 人员管理';
  1205. });
  1206. this.photo.pId = row.id;
  1207. },
  1208. /** 提交按钮 */
  1209. submitForm() {
  1210. this.$refs["form"].validate(valid => {
  1211. if (valid) {
  1212. /*this.$refs.photo.submit();*/
  1213. this.form.specialDuty = this.specialDutys.join();
  1214. if (this.form.id != null) {
  1215. updateStaffmgr(this.form).then(response => {
  1216. this.$modal.msgSuccess('修改成功');
  1217. this.open = false;
  1218. this.getList();
  1219. this.getpIdTreeselect();
  1220. });
  1221. } else {
  1222. addStaffmgr(this.form).then(response => {
  1223. this.$modal.msgSuccess('新增成功');
  1224. this.open = false;
  1225. this.getList();
  1226. });
  1227. }
  1228. }
  1229. });
  1230. },
  1231. /** 删除按钮操作 */
  1232. handleDelete(row) {
  1233. const ids = row.id || this.ids;
  1234. this.$confirm('是否确认删除?', '警告', {
  1235. confirmButtonText: '确定',
  1236. cancelButtonText: '取消',
  1237. type: "warning"
  1238. }).then(function () {
  1239. return delStaffmgr(ids);
  1240. }).then(() => {
  1241. this.getList();
  1242. this.$modal.msgSuccess('删除成功');
  1243. })
  1244. },
  1245. /** 删除按钮操作 */
  1246. handleLeftDelete(id) {
  1247. delLeftStaffmgr(id).then(() => {
  1248. this.getList();
  1249. this.$modal.msgSuccess('离岗成功');
  1250. })
  1251. },
  1252. /** 导出按钮操作 */
  1253. handleExport() {
  1254. const queryParams = this.queryParams;
  1255. this.$confirm('是否确认导出所有人员管理数据项?', '提示', {
  1256. confirmButtonText: '确定',
  1257. cancelButtonText: '取消',
  1258. type: "warning"
  1259. }).then(function () {
  1260. return exportStaffmgr(queryParams);
  1261. }).then(response => {
  1262. this.download(response.msg);
  1263. })
  1264. },
  1265. /** 导入按钮操作 */
  1266. handleImport() {
  1267. this.upload.title = '用户导入';
  1268. this.upload.open = true;
  1269. },
  1270. /** 下载模板操作 */
  1271. importTemplate() {
  1272. this.$refs['downloadFileForm'].submit()
  1273. },
  1274. // 文件上传中处理
  1275. handleFileUploadProgress(event, file, fileList) {
  1276. this.upload.isUploading = true;
  1277. },
  1278. // 文件上传成功处理
  1279. handleFileSuccess(response, file, fileList) {
  1280. this.upload.open = false;
  1281. this.upload.isUploading = false;
  1282. this.$refs.upload.clearFiles();
  1283. if (response.data[0] != null) {
  1284. this.$alert('成功导入' + response.msg + '条数据' + "," + '第' + response.data + '行数据出现错误导入失败' + "。", '导入结果', {dangerouslyUseHTMLString: true});
  1285. } else {
  1286. this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
  1287. }
  1288. this.getList();
  1289. },
  1290. // 提交上传文件
  1291. submitFileForm() {
  1292. this.$refs.upload.submit();
  1293. },
  1294. /** 报告附件按钮操作 */
  1295. handleDoc(row) {
  1296. /*this.doc.id = row.id;
  1297. this.doc.title = row.name + this.附件;
  1298. this.doc.open = true;
  1299. this.doc.queryParams.pId = row.id
  1300. this.doc.pId = row.id
  1301. this.getFileList()
  1302. this.$nextTick(() => {
  1303. this.$refs.doc.clearFiles()
  1304. })*/
  1305. this.$router.push({path: '/system/file', query: {linkId: row.id, linkName: 'shiftMgr'}})
  1306. },
  1307. getFileList() {
  1308. allFileList(this.doc.queryParams).then(response => {
  1309. this.doc.commonfileList = response;
  1310. });
  1311. },
  1312. //附件上传中处理
  1313. handleFileDocProgress(event, file, fileList) {
  1314. this.doc.file = file;
  1315. this.doc.isUploading = true;
  1316. },
  1317. //附件上传成功处理
  1318. handleFileDocSuccess(response, file, fileList) {
  1319. this.doc.isUploading = false;
  1320. this.$alert(response.msg, '导入结果', {dangerouslyUseHTMLString: true});
  1321. this.getFileList()
  1322. },
  1323. /** 删除按钮操作 */
  1324. handleDeleteDoc(row) {
  1325. const ids = row.id || this.ids;
  1326. this.$confirm('是否确认删除?', '警告', {
  1327. confirmButtonText: '确定',
  1328. cancelButtonText: '取消',
  1329. type: "warning"
  1330. }).then(function () {
  1331. return delCommonfile(ids);
  1332. }).then(() => {
  1333. this.getFileList()
  1334. this.$modal.msgSuccess('删除成功');
  1335. })
  1336. },
  1337. // 文件下载处理
  1338. handleDownload(row) {
  1339. var name = row.fileName;
  1340. var url = row.fileUrl;
  1341. var suffix = url.substring(url.lastIndexOf("."), url.length);
  1342. const a = document.createElement('a')
  1343. a.setAttribute('download', name)
  1344. a.setAttribute('target', '_blank')
  1345. a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
  1346. a.click()
  1347. },
  1348. openPdf() {
  1349. window.open(this.pdf.pdfUrl);//path是文件的全路径地址
  1350. },
  1351. handleSee(row) {
  1352. this.pdf.open = true
  1353. this.pdf.title = row.fileName
  1354. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
  1355. },
  1356. handleLeft() {
  1357. this.left.open = true;
  1358. this.left.title = '离岗人员信息';
  1359. this.getLeftData();
  1360. },
  1361. getLeftData() {
  1362. listLeftStaffmgr().then(response => {
  1363. this.left.staffmgrList = response;
  1364. });
  1365. },
  1366. handleReLeft(row) {
  1367. const ids = row.id;
  1368. this.$confirm('是否确认复职?', '警告', {
  1369. confirmButtonText: '确定',
  1370. cancelButtonText: '取消',
  1371. type: "warning"
  1372. }).then(function () {
  1373. return reLeftStaffmgr(ids);
  1374. }).then(() => {
  1375. this.getLeftData();
  1376. this.getList();
  1377. this.$modal.msgSuccess('复职成功');
  1378. })
  1379. },
  1380. //数据分析
  1381. handleData() {
  1382. this.drawer = true
  1383. },
  1384. handleAvatarProgress(event, file, fileList) {
  1385. this.photo.file = file;
  1386. this.photoUrl = file;
  1387. },
  1388. handleAvatarSuccess(res, file, fileList) {
  1389. this.photoUrl = URL.createObjectURL(file.raw);
  1390. this.$alert(res.msg, '导入结果', {dangerouslyUseHTMLString: true});
  1391. },
  1392. handlePictureCardPreview(file) {
  1393. this.dialogImageUrl = file.url;
  1394. this.dialogVisible = true;
  1395. },
  1396. }
  1397. };
  1398. </script>
  1399. <style>
  1400. .text {
  1401. font-size: 14px;
  1402. }
  1403. .item {
  1404. margin-bottom: 18px;
  1405. }
  1406. .clearfix {
  1407. color: #1e1e1e;
  1408. }
  1409. .clearfix:before,
  1410. .clearfix:after {
  1411. display: table;
  1412. content: "";
  1413. }
  1414. .clearfix:after {
  1415. clear: both
  1416. }
  1417. .box-card {
  1418. width: 100%;
  1419. }
  1420. .el-drawer__body {
  1421. overflow: auto;
  1422. }
  1423. .el-drawer__container ::-webkit-scrollbar {
  1424. display: none;
  1425. }
  1426. .avatar-uploader .el-upload {
  1427. border: 1px dashed #d9d9d9;
  1428. border-radius: 6px;
  1429. cursor: pointer;
  1430. position: relative;
  1431. overflow: hidden;
  1432. }
  1433. .avatar-uploader .el-upload:hover {
  1434. border-color: #409EFF;
  1435. }
  1436. .avatar-uploader-icon {
  1437. font-size: 28px;
  1438. color: #8c939d;
  1439. width: 178px;
  1440. height: 178px;
  1441. line-height: 178px;
  1442. text-align: center;
  1443. }
  1444. .avatar {
  1445. width: 120px;
  1446. height: 140px;
  1447. }
  1448. </style>