index.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="10" class="mb8">
  4. <el-col :span="1.5">
  5. <el-button
  6. type="primary"
  7. plain
  8. icon="el-icon-plus"
  9. size="mini"
  10. @click="handleAdd"
  11. v-hasPermi="['peopleChuRu:bdglLeave:add']"
  12. >新增</el-button
  13. >
  14. </el-col>
  15. <el-col :span="1.5">
  16. <el-button
  17. type="success"
  18. plain
  19. icon="el-icon-edit"
  20. size="mini"
  21. :disabled="single"
  22. @click="handleUpdate"
  23. v-hasPermi="['peopleChuRu:bdglLeave:edit']"
  24. >修改</el-button
  25. >
  26. </el-col>
  27. <el-col :span="1.5">
  28. <el-button
  29. type="danger"
  30. plain
  31. icon="el-icon-delete"
  32. size="mini"
  33. :disabled="multiple"
  34. @click="handleDelete"
  35. v-hasPermi="['peopleChuRu:bdglLeave:remove']"
  36. >删除</el-button
  37. >
  38. </el-col>
  39. <el-col :span="1.5">
  40. <el-button
  41. type="warning"
  42. plain
  43. icon="el-icon-download"
  44. size="mini"
  45. :loading="exportLoading"
  46. @click="handleExport"
  47. v-hasPermi="['peopleChuRu:bdglLeave:export']"
  48. >导出</el-button
  49. >
  50. </el-col>
  51. <!-- <right-toolbar
  52. :showSearch.sync="showSearch"
  53. @queryTable="getList"
  54. ></right-toolbar> -->
  55. </el-row>
  56. <el-table
  57. v-loading="loading"
  58. :data="bdglLeaveList"
  59. @selection-change="handleSelectionChange"
  60. :header-cell-style="{ background: '#003C69', color: 'white' }"
  61. >
  62. <el-table-column type="selection" width="55" align="center" />
  63. <el-table-column label="序号" align="center" prop="id" />
  64. <el-table-column label="单位" align="center" prop="unitName" />
  65. <el-table-column label="请假人员" align="center" prop="peopleName" />
  66. <el-table-column
  67. label="请假开始时间"
  68. align="center"
  69. prop="startTime"
  70. width="100"
  71. >
  72. <template slot-scope="scope">
  73. <span>{{ parseTime(scope.row.startTime, "{y}-{m}-{d}") }}</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column
  77. label="请假结束时间"
  78. align="center"
  79. prop="endTime"
  80. width="100"
  81. >
  82. <template slot-scope="scope">
  83. <span>{{ parseTime(scope.row.endTime, "{y}-{m}-{d}") }}</span>
  84. </template>
  85. </el-table-column>
  86. <el-table-column label="请假类型" align="center" prop="leaveType" :formatter="qingJia"
  87. >
  88. <template slot-scope="scope">
  89. <dict-tag
  90. :options="dict.type.Leave_type"
  91. :value="scope.row.leaveType"
  92. />
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="请假原因" align="center" prop="leaveReason" />
  96. <el-table-column
  97. label="离队时间"
  98. align="center"
  99. prop="departureTime"
  100. width="100"
  101. />
  102. <el-table-column
  103. label="归队时间"
  104. align="center"
  105. prop="returnTime"
  106. width="100"
  107. />
  108. <el-table-column label="是否归队" align="center" prop="isReturn" >
  109. <template slot-scope="scope">
  110. <dict-tag
  111. :options="dict.type.sys_is"
  112. :value="scope.row.isReturn"
  113. />
  114. </template>
  115. </el-table-column>
  116. <el-table-column
  117. label="一级审批人"
  118. align="center"
  119. prop="peopleName1"
  120. width="100"
  121. />
  122. <el-table-column
  123. label="一级审批状态"
  124. align="center"
  125. prop="peopleId2"
  126. width="100"
  127. >
  128. <template slot-scope="scope">
  129. <el-col v-if="scope.row.status1 == 0" style="color: #ffba00"
  130. >未审批</el-col
  131. >
  132. <el-col v-if="scope.row.status1 == 1" style="color: #13ce66"
  133. >已通过</el-col
  134. >
  135. <el-col
  136. v-if="scope.row.status1 == 2"
  137. :title="scope.row.reasons"
  138. style="color: #ff4949"
  139. >已驳回</el-col
  140. >
  141. <el-col
  142. v-if="scope.row.status1 == 3"
  143. :title="scope.row.bdglLeaveFus[0].specialApproval"
  144. style="color: #1f73d7"
  145. >特殊审批</el-col
  146. >
  147. </template></el-table-column
  148. >
  149. <el-table-column
  150. label="二级审批人"
  151. align="center"
  152. prop="peopleName2"
  153. width="100"
  154. />
  155. <el-table-column
  156. label="二级审批状态"
  157. align="center"
  158. prop="peopleId4"
  159. width="100"
  160. >
  161. <template slot-scope="scope">
  162. <el-col v-if="scope.row.status2 == 0" style="color: #ffba00"
  163. >未审批</el-col
  164. >
  165. <el-col v-if="scope.row.status2 == 1" style="color: #13ce66"
  166. >已通过</el-col
  167. >
  168. <el-col
  169. v-if="scope.row.status2 == 2"
  170. :title="scope.row.reasons"
  171. style="color: #ff4949"
  172. >已驳回</el-col
  173. >
  174. <el-col
  175. v-if="scope.row.status2 == 3"
  176. :title="scope.row.bdglLeaveFus[1].specialApproval"
  177. style="color: #1f73d7"
  178. >特殊审批</el-col
  179. >
  180. </template>
  181. </el-table-column>
  182. <el-table-column
  183. label="三级审批人"
  184. align="center"
  185. prop="peopleName3"
  186. width="100"
  187. />
  188. <el-table-column
  189. label="三级审批状态"
  190. align="center"
  191. prop="status2"
  192. width="100"
  193. >
  194. <template slot-scope="scope">
  195. <el-col v-if="scope.row.status3 == 0" style="color: #ffba00"
  196. >未审批</el-col
  197. >
  198. <el-col v-if="scope.row.status3 == 1" style="color: #13ce66"
  199. >已通过</el-col
  200. >
  201. <el-col
  202. v-if="scope.row.status3 == 2"
  203. :title="scope.row.reasons"
  204. style="color: #ff4949"
  205. >已驳回</el-col
  206. >
  207. <el-col v-if="scope.row.status3 == 3" style="color: #1f73d7"
  208. >特殊审批</el-col
  209. >
  210. </template>
  211. <!-- :title="scope.row.bdglLeaveFus[2].specialApproval" -->
  212. </el-table-column>
  213. <el-table-column
  214. label="四级审批人"
  215. align="center"
  216. prop="peopleName4"
  217. width="100"
  218. />
  219. <el-table-column
  220. label="四级审批状态"
  221. align="center"
  222. prop="status4"
  223. width="100"
  224. >
  225. <template slot-scope="scope">
  226. <el-col v-if="scope.row.status4 == 0" style="color: #ffba00"
  227. >未审批</el-col
  228. >
  229. <el-col v-if="scope.row.status4 == 1" style="color: #13ce66"
  230. >已通过</el-col
  231. >
  232. <el-col
  233. v-if="scope.row.status4 == 2"
  234. :title="scope.row.reasons"
  235. style="color: #ff4949"
  236. >已驳回</el-col
  237. >
  238. <el-col v-if="scope.row.status4 == 3" style="color: #1f73d7"
  239. >特殊审批</el-col
  240. >
  241. <!-- :title="scope.row.bdglLeaveFus[3].specialApproval" -->
  242. </template>
  243. </el-table-column>
  244. <el-table-column
  245. label="总审批状态"
  246. align="center"
  247. prop="contents"
  248. width="100"
  249. />
  250. <el-table-column
  251. label="操作"
  252. align="center"
  253. class-name="small-padding fixed-width"
  254. width="210"
  255. >
  256. <template slot-scope="scope">
  257. <el-button
  258. v-if="scope.row.common == '1'"
  259. size="btc"
  260. type="text"
  261. @click="handleUpdates(scope.row)"
  262. v-hasPermi="['peopleChuRu:bdglLeave:edit']"
  263. >审批</el-button
  264. >
  265. <el-button
  266. v-else-if="scope.row.common == '2'"
  267. size="mini"
  268. type="text"
  269. @click="handleUpdatess(scope.row)"
  270. v-hasPermi="['peopleChuRu:bdglLeave:edit']"
  271. >特殊审批</el-button
  272. >
  273. <el-button
  274. size="btu"
  275. type="text"
  276. @click="handleUpdate(scope.row)"
  277. v-hasPermi="['peopleChuRu:bdglLeave:edit']"
  278. >修改</el-button
  279. >
  280. <el-button
  281. size="btd"
  282. type="text"
  283. @click="handleDelete(scope.row)"
  284. v-hasPermi="['peopleChuRu:bdglLeave:remove']"
  285. >删除</el-button
  286. >
  287. <el-button
  288. v-if="scope.row.common == '3'"
  289. size="btc"
  290. type="text"
  291. @click="handleGuiDui(scope.row)"
  292. v-hasPermi="['peopleChuRu:bdglLeave:edit']"
  293. >归队</el-button
  294. >
  295. </template>
  296. </el-table-column>
  297. </el-table>
  298. <!-- 添加或修改人员请假对话框 -->
  299. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  300. <el-form
  301. ref="form"
  302. :model="form"
  303. :rules="rules"
  304. label-width="80px"
  305. inline
  306. >
  307. <div class="jiben">基本信息</div>
  308. <el-form-item label="单位" prop="unitId">
  309. <treeselect
  310. v-model="form.unitId"
  311. :options="deptOptions"
  312. placeholder="请选择单位"
  313. @select="selectPeo"
  314. @open="blurSelect"
  315. />
  316. </el-form-item>
  317. <el-form-item label="请假人员" prop="peopleId">
  318. <!-- <el-input v-model="form.peopleId" placeholder="请输入请假人员" /> -->
  319. <el-select
  320. v-model="form.peopleId"
  321. placeholder="请输入请假人员"
  322. ref="headerSearchSelect"
  323. >
  324. <el-option
  325. v-for="(item, i) in renYuan"
  326. :key="i"
  327. :label="item.name"
  328. :value="item.id"
  329. @click.native="qingRen(item.name)"
  330. class="input_xiala"
  331. >
  332. </el-option>
  333. </el-select>
  334. </el-form-item>
  335. <el-form-item label="请假开始时间" prop="startTime">
  336. <el-date-picker
  337. clearable
  338. size="small"
  339. v-model="form.startTime"
  340. type="date"
  341. value-format="yyyy-MM-dd"
  342. placeholder="选择请假开始时间"
  343. >
  344. </el-date-picker>
  345. </el-form-item>
  346. <el-form-item label="请假结束时间" prop="endTime">
  347. <el-date-picker
  348. clearable
  349. size="small"
  350. v-model="form.endTime"
  351. type="date"
  352. value-format="yyyy-MM-dd"
  353. placeholder="选择请假结束时间"
  354. >
  355. </el-date-picker>
  356. </el-form-item>
  357. <el-form-item label="请假类型" prop="leaveType">
  358. <el-select v-model="form.leaveType" placeholder="请选择请假类型">
  359. <!-- <el-option label="请选择字典生成" value="" /> -->
  360. <el-option
  361. v-for="item in ziDian"
  362. :key="item.dictCode"
  363. :label="item.dictLabel"
  364. :value="item.dictValue"
  365. class="input_xiala"
  366. ></el-option>
  367. </el-select>
  368. </el-form-item>
  369. <el-form-item label="离队时间" prop="departureTime">
  370. <!-- <el-input v-model="form.departureTime" placeholder="请输入离队时间" /> -->
  371. <el-date-picker
  372. clearable
  373. size="small"
  374. v-model="form.departureTime"
  375. type="date"
  376. value-format="yyyy-MM-dd"
  377. placeholder="请输入离队时间"
  378. >
  379. </el-date-picker>
  380. </el-form-item>
  381. <el-form-item label="归队时间" prop="returnTime">
  382. <!-- <el-input v-model="form.returnTime" placeholder="请输入归队时间" /> -->
  383. <el-date-picker
  384. clearable
  385. size="small"
  386. v-model="form.returnTime"
  387. type="date"
  388. value-format="yyyy-MM-dd"
  389. placeholder="请输入归队时间"
  390. >
  391. </el-date-picker>
  392. </el-form-item>
  393. <el-form-item label="一级审批人" prop="peopleId2">
  394. <!-- <el-input v-model="form.peopleId2" placeholder="请输入二级审批人" /> -->
  395. <el-select
  396. v-model="form.peopleId1"
  397. filterable
  398. placeholder="请输入一级审批人"
  399. ref="abcdef"
  400. >
  401. <el-option
  402. v-for="(item, i) in yongHu"
  403. :key="i"
  404. :label="item.userName"
  405. :value="item.userId"
  406. @click.native="oneRen(item.userName)"
  407. class="input_xiala"
  408. >
  409. </el-option>
  410. </el-select>
  411. </el-form-item>
  412. <el-form-item label="二级审批人" prop="peopleId2">
  413. <!-- <el-input v-model="form.peopleId2" placeholder="请输入二级审批人" /> -->
  414. <el-select
  415. v-model="form.peopleId2"
  416. filterable
  417. placeholder="请输入二级审批人"
  418. ref="abcde"
  419. >
  420. <el-option
  421. v-for="(item, i) in yongHu"
  422. :key="i"
  423. :label="item.userName"
  424. :value="item.userId"
  425. @click.native="twoRen(item.userName)"
  426. class="input_xiala"
  427. >
  428. </el-option>
  429. </el-select>
  430. </el-form-item>
  431. <el-form-item label="三级审批人" prop="peopleId3">
  432. <!-- <el-input v-model="form.peopleId3" placeholder="请输入三级审批人" /> -->
  433. <el-select
  434. v-model="form.peopleId3"
  435. filterable
  436. placeholder="请输入三级审批人"
  437. ref="abcd"
  438. >
  439. <el-option
  440. v-for="(item, i) in yongHu"
  441. :key="i"
  442. :label="item.userName"
  443. :value="item.userId"
  444. @click.native="thereRen(item.userName)"
  445. class="input_xiala"
  446. >
  447. </el-option>
  448. </el-select>
  449. </el-form-item>
  450. <el-form-item label="四级审批人" prop="peopleId4">
  451. <!-- <el-input v-model="form.peopleId4" placeholder="请输入四级审批人" /> -->
  452. <el-select
  453. v-model="form.peopleId4"
  454. filterable
  455. placeholder="请输入四级审批人"
  456. ref="abc"
  457. >
  458. <el-option
  459. v-for="(item, i) in yongHu"
  460. :key="i"
  461. :label="item.userName"
  462. :value="item.userId"
  463. @click.native="fourRen(item.userName)"
  464. class="input_xiala"
  465. >
  466. </el-option>
  467. </el-select>
  468. </el-form-item>
  469. <div class="jiben">请假原因</div>
  470. <el-form-item prop="leaveReason">
  471. <el-input
  472. v-model="form.leaveReason"
  473. type="textarea"
  474. placeholder="请输入内容"
  475. />
  476. </el-form-item>
  477. <div class="jiben" v-if="statussp == '1'">驳回原因</div>
  478. <el-form-item v-if="statussp == '1'" prop="reasons">
  479. <el-input
  480. v-model="form.reasons"
  481. type="textarea"
  482. placeholder="请输入内容"
  483. />
  484. </el-form-item>
  485. <div class="jiben" v-if="statussp == '2'">驳回原因</div>
  486. <el-form-item v-if="statussp == '2'" prop="reasons">
  487. <el-input
  488. v-model="form.reasons"
  489. type="textarea"
  490. placeholder="请输入内容"
  491. />
  492. </el-form-item>
  493. <div class="jiben" v-if="statussp == '2'">特殊审批原因</div>
  494. <el-form-item v-if="statussp == '2'" prop="reasons">
  495. <el-input
  496. v-model="form.specialApproval"
  497. type="textarea"
  498. placeholder="请输入内容"
  499. />
  500. </el-form-item>
  501. </el-form>
  502. <div slot="footer" class="dialog-footer" v-if="statussp == '0'">
  503. <el-button type="primary" @click="submitForm">确 定</el-button>
  504. <el-button @click="cancel">取 消</el-button>
  505. </div>
  506. <div v-if="statussp == '1'" class="dialog-footer" slot="footer">
  507. <el-button type="primary" @click="submitForms">通过</el-button>
  508. <el-button @click="boHui">驳回</el-button>
  509. </div>
  510. </el-dialog>
  511. <!--特殊审批对话框 -->
  512. <el-dialog
  513. :title="title"
  514. :visible.sync="opens"
  515. width="500px"
  516. append-to-body
  517. >
  518. <el-form
  519. ref="forms"
  520. :model="form"
  521. :rules="rulesform"
  522. label-width="80px"
  523. inline
  524. >
  525. <el-form-item label="单位" prop="unitId">
  526. <treeselect
  527. v-model="form.unitId"
  528. :options="deptOptions"
  529. placeholder="选择单位"
  530. @select="selectPeo"
  531. @open="blurSelect"
  532. />
  533. </el-form-item>
  534. <el-form-item label="请假人员" prop="peopleId">
  535. <el-select
  536. v-model="form.peopleId"
  537. placeholder="请输入请假人员"
  538. ref="headerSearchSelect"
  539. >
  540. <el-option
  541. v-for="(item, i) in renYuan"
  542. :key="i"
  543. :label="item.name"
  544. :value="item.id"
  545. @click.native="qingRen(item.name)"
  546. >
  547. </el-option>
  548. </el-select>
  549. </el-form-item>
  550. <el-form-item label="请假开始时间" prop="startTime">
  551. <el-date-picker
  552. clearable
  553. size="small"
  554. v-model="form.startTime"
  555. type="date"
  556. value-format="yyyy-MM-dd"
  557. placeholder="选择请假开始时间"
  558. >
  559. </el-date-picker>
  560. </el-form-item>
  561. <el-form-item label="请假结束时间" prop="endTime">
  562. <el-date-picker
  563. clearable
  564. size="small"
  565. v-model="form.endTime"
  566. type="date"
  567. value-format="yyyy-MM-dd"
  568. placeholder="选择请假结束时间"
  569. >
  570. </el-date-picker>
  571. </el-form-item>
  572. <el-form-item label="请假类型" prop="leaveType">
  573. <el-select v-model="form.leaveType" placeholder="请选择请假类型">
  574. <el-option
  575. v-for="item in ziDian"
  576. :key="item.dictCode"
  577. :label="item.dictLabel"
  578. :value="item.dictValue"
  579. ></el-option>
  580. </el-select>
  581. </el-form-item>
  582. <el-form-item label="离队时间" prop="departureTime">
  583. <el-date-picker
  584. clearable
  585. size="small"
  586. v-model="form.departureTime"
  587. type="date"
  588. value-format="yyyy-MM-dd"
  589. placeholder="请输入离队时间"
  590. >
  591. </el-date-picker>
  592. </el-form-item>
  593. <el-form-item label="归队时间" prop="returnTime">
  594. <el-date-picker
  595. clearable
  596. size="small"
  597. v-model="form.returnTime"
  598. type="date"
  599. value-format="yyyy-MM-dd"
  600. placeholder="请输入归队时间"
  601. >
  602. </el-date-picker>
  603. </el-form-item>
  604. <el-form-item label="一级审批人" prop="peopleId2">
  605. <el-select
  606. v-model="form.peopleId1"
  607. filterable
  608. placeholder="请输入一级审批人"
  609. ref="abcdef"
  610. >
  611. <el-option
  612. v-for="(item, i) in yongHu"
  613. :key="i"
  614. :label="item.nickName"
  615. :value="item.userId"
  616. @click.native="oneRen(item.nickName)"
  617. >
  618. </el-option>
  619. </el-select>
  620. </el-form-item>
  621. <el-form-item label="二级审批人" prop="peopleId2">
  622. <el-select
  623. v-model="form.peopleId2"
  624. filterable
  625. placeholder="请输入二级审批人"
  626. ref="abcde"
  627. >
  628. <el-option
  629. v-for="(item, i) in yongHu"
  630. :key="i"
  631. :label="item.nickName"
  632. :value="item.userId"
  633. @click.native="twoRen(item.nickName)"
  634. >
  635. </el-option>
  636. </el-select>
  637. </el-form-item>
  638. <el-form-item label="三级审批人" prop="peopleId3">
  639. <el-select
  640. v-model="form.peopleId3"
  641. filterable
  642. placeholder="请输入三级审批人"
  643. ref="abcd"
  644. >
  645. <el-option
  646. v-for="(item, i) in yongHu"
  647. :key="i"
  648. :label="item.nickName"
  649. :value="item.userId"
  650. @click.native="thereRen(item.nickName)"
  651. >
  652. </el-option>
  653. </el-select>
  654. </el-form-item>
  655. <el-form-item label="四级审批人" prop="peopleId4">
  656. <el-select
  657. v-model="form.peopleId4"
  658. filterable
  659. placeholder="请输入四级审批人"
  660. ref="abc"
  661. >
  662. <el-option
  663. v-for="(item, i) in yongHu"
  664. :key="i"
  665. :label="item.nickName"
  666. :value="item.userId"
  667. @click.native="fourRen(item.nickName)"
  668. >
  669. </el-option>
  670. </el-select>
  671. </el-form-item>
  672. <div class="jiben">请假原因</div>
  673. <el-form-item prop="leaveReason">
  674. <el-input
  675. v-model="form.leaveReason"
  676. type="textarea"
  677. placeholder="请输入内容"
  678. />
  679. </el-form-item>
  680. <div class="jiben">驳回原因</div>
  681. <el-form-item prop="reasons">
  682. <el-input
  683. v-model="form.reasons"
  684. type="textarea"
  685. placeholder="请输入内容"
  686. />
  687. </el-form-item>
  688. <div class="jiben">特殊审批原因</div>
  689. <el-form-item prop="specialApproval">
  690. <el-input
  691. v-model="form.specialApproval"
  692. type="textarea"
  693. placeholder="请输入内容"
  694. />
  695. </el-form-item>
  696. </el-form>
  697. <div class="dialog-footer" slot="footer">
  698. <el-button type="primary" @click="TSsubmitForms">通过</el-button>
  699. <el-button @click="TSboHui">驳回</el-button>
  700. </div>
  701. </el-dialog>
  702. </div>
  703. </template>
  704. <script>
  705. import {
  706. listBdglLeave,
  707. getBdglLeave,
  708. delBdglLeave,
  709. addBdglLeave,
  710. updateBdglLeave,
  711. exportBdglLeave,
  712. } from "@/api/peopleChuRu/bdglLeave";
  713. import {
  714. getUser,
  715. getDept,
  716. getQuanBu,
  717. } from "@/api/grassrootsregistration/bdglmeeting";
  718. // 导入树形结构
  719. import Treeselect from "@riophae/vue-treeselect";
  720. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  721. // 查询字典
  722. import { getDicts } from "@/api/system/dict/data";
  723. export default {
  724. name: "BdglLeave",
  725. components: {
  726. Treeselect,
  727. },
  728. dicts: ["Leave_type", "sys_is"],
  729. data() {
  730. return {
  731. // 审批按钮状态 审批按钮状态1 修改为0,超级审批状态2
  732. statussp: "1",
  733. // 遮罩层
  734. loading: true,
  735. // 导出遮罩层
  736. exportLoading: false,
  737. // 选中数组
  738. ids: [],
  739. // 非单个禁用
  740. single: true,
  741. // 非多个禁用
  742. multiple: true,
  743. // 显示搜索条件
  744. showSearch: true,
  745. // 总条数
  746. total: 0,
  747. // 人员请假表格数据
  748. bdglLeaveList: [],
  749. // 弹出层标题
  750. title: "",
  751. // 是否显示弹出层
  752. open: false,
  753. // 是否显示特殊权限弹出层
  754. opens: false,
  755. // 查询参数
  756. queryParams: {
  757. pageNum: 1,
  758. pageSize: 10,
  759. peopleId: null,
  760. unitId: null,
  761. startTime: null,
  762. endTime: null,
  763. leaveType: null,
  764. leaveReason: null,
  765. departureTime: null,
  766. returnTime: null,
  767. returnStatus: null,
  768. isReturn: null,
  769. updatetime: null,
  770. adminId: null,
  771. createtime: null,
  772. peopleId1: null,
  773. postId: null,
  774. peopleId2: null,
  775. peopleId3: null,
  776. peopleId4: null,
  777. status1: null,
  778. status2: null,
  779. status3: null,
  780. status4: null,
  781. contents: null,
  782. statusd: null,
  783. rejoin: null,
  784. },
  785. // 表单参数
  786. form: {},
  787. // 表单校验
  788. rules: {
  789. unitId: [{ required: true, message: "单位不能为空", trigger: "blur" }],
  790. peopleId: [
  791. { required: true, message: "人员不能为空", trigger: "blur" },
  792. ],
  793. reasons: [
  794. { required: true, message: "请填写驳回原因", trigger: "blur" },
  795. ],
  796. leaveType: [
  797. { required: true, message: "请假类型不能为空", trigger: "blur" },
  798. ],
  799. },
  800. // 特殊审批表单验证
  801. rulesform: {
  802. reasons: [
  803. { required: true, message: "请填写驳回原因", trigger: "blur" },
  804. ],
  805. specialApproval: [
  806. {
  807. required: true,
  808. message: "审批原因不能为空",
  809. trigger: "blur",
  810. },
  811. ],
  812. },
  813. // 树形结构列表
  814. deptOptions: [],
  815. // 用户列表
  816. yongHu: [],
  817. // 人员列表
  818. renYuan: [],
  819. // 查询字典
  820. dictType: {
  821. dictType: "Leave_type",
  822. },
  823. // 字典的列表
  824. ziDian: [],
  825. // 审批状态
  826. ziDians: [],
  827. // 特殊审批通过验证
  828. trueng: true,
  829. // 归队数据
  830. guidui: {},
  831. };
  832. },
  833. created() {
  834. this.getList();
  835. // 字典查询数据
  836. this.getDicts("approve").then((response) => {
  837. this.ziDians = response.data;
  838. });
  839. },
  840. methods: {
  841. // 归队按钮
  842. handleGuiDui(row) {
  843. const id = row.id || this.ids;
  844. getBdglLeave(id).then((response) => {
  845. this.form = response.data;
  846. });
  847. this.$modal
  848. .confirm("是否确认归队人员的数据项?")
  849. .then(() => {
  850. if (this.form.id != null) {
  851. this.form.rejoin = "1";
  852. console.log(this.form, 1);
  853. updateBdglLeave(this.form).then((response) => {
  854. this.$modal.msgSuccess("归队成功");
  855. this.getList();
  856. });
  857. }
  858. })
  859. .catch(() => {});
  860. },
  861. // // 特殊审批按钮触发
  862. handleUpdatess(row) {
  863. this.statussp = "2";
  864. this.getBuMeng();
  865. // 获取字典类型
  866. this.getdict();
  867. this.reset();
  868. const id = row.id || this.ids;
  869. getBdglLeave(id).then((response) => {
  870. this.form = response.data;
  871. this.getYong(this.form.unitId);
  872. this.getRen(this.form.unitId);
  873. this.opens = true;
  874. this.title = "审批人员请假";
  875. });
  876. },
  877. // 审批按钮操作
  878. handleUpdates(row) {
  879. this.statussp = "1";
  880. this.getBuMeng();
  881. // 获取字典类型
  882. this.getdict();
  883. this.reset();
  884. const id = row.id || this.ids;
  885. getBdglLeave(id).then((response) => {
  886. this.form = response.data;
  887. this.getYong(this.form.unitId);
  888. this.getRen(this.form.unitId);
  889. this.open = true;
  890. this.title = "审批人员请假";
  891. });
  892. },
  893. // 让单位失去焦点
  894. blurSelect() {
  895. this.$refs.headerSearchSelect.blur();
  896. this.$refs.abc.blur();
  897. this.$refs.abcd.blur();
  898. this.$refs.abcde.blur();
  899. this.$refs.abcdef.blur();
  900. },
  901. // 重置表单人员
  902. ChongZhiRen() {
  903. (this.form.peopleId = null), (this.form.peopleId1 = null);
  904. this.form.peopleId2 = null;
  905. this.form.peopleId3 = null;
  906. this.form.peopleId4 = null;
  907. },
  908. // 查询请假类型
  909. getdict() {
  910. getDicts(this.dictType.dictType).then((res) => {
  911. this.ziDian = res.data;
  912. });
  913. },
  914. // 请假人选中
  915. qingRen(name) {
  916. this.form.peopleName = name;
  917. },
  918. // 一级审批人选中
  919. oneRen(name) {
  920. this.form.peopleName1 = name;
  921. },
  922. //二级审批人选中
  923. twoRen(name) {
  924. this.form.peopleName2 = name;
  925. },
  926. // 三级审批人选中
  927. thereRen(name) {
  928. this.form.peopleName3 = name;
  929. },
  930. // 四级审批人选中
  931. fourRen(name) {
  932. this.form.peopleName4 = name;
  933. },
  934. // 获取部门列表
  935. getBuMeng() {
  936. getDept().then((res) => {
  937. this.deptOptions = res.data;
  938. });
  939. },
  940. // 选择部门单位触发
  941. selectPeo(data) {
  942. this.ChongZhiRen();
  943. this.form.unitId = data.id;
  944. this.getYong(this.form.unitId);
  945. this.getRen(this.form.unitId, 0);
  946. },
  947. // 获取用户列表
  948. getYong(id) {
  949. getUser(id).then((res) => {
  950. this.yongHu = res.data;
  951. });
  952. },
  953. // 获取人员
  954. getRen(id, num) {
  955. getQuanBu(id, num).then((response) => {
  956. this.renYuan = response.data;
  957. });
  958. },
  959. /** 查询人员请假列表 */
  960. getList() {
  961. this.loading = true;
  962. listBdglLeave(this.queryParams).then((response) => {
  963. console.log(response);
  964. this.bdglLeaveList = response.rows;
  965. this.total = response.total;
  966. this.loading = false;
  967. });
  968. },
  969. // 取消按钮
  970. cancel() {
  971. this.open = false;
  972. this.reset();
  973. },
  974. //审批通过按钮
  975. submitForms() {
  976. this.bdglLeaveList.forEach((item) => {
  977. if (item.shenPiJiBie == "一级") {
  978. this.form.status1 = 1;
  979. this.form.contents = "一级审批通过";
  980. } else if (item.shenPiJiBie == "二级") {
  981. this.form.status2 = 1;
  982. this.form.contents = "二级审批通过";
  983. } else if (item.shenPiJiBie == "三级") {
  984. this.form.status3 = 1;
  985. this.form.contents = "三级审批通过";
  986. } else if (item.shenPiJiBie == "四级") {
  987. this.form.status4 = 1;
  988. this.form.contents = "四级审批通过";
  989. }
  990. });
  991. updateBdglLeave(this.form).then((response) => {
  992. this.$modal.msgSuccess("审批成功");
  993. this.open = false;
  994. this.getList();
  995. });
  996. },
  997. // 审批驳回按钮
  998. boHui() {
  999. this.$refs["form"].validate((valid) => {
  1000. if (valid) {
  1001. this.bdglLeaveList.forEach((item) => {
  1002. if (item.shenPiJiBie == "一级") {
  1003. this.form.status1 = 2;
  1004. return (this.form.contents = "一级审批驳回");
  1005. } else if (item.shenPiJiBie == "二级") {
  1006. this.form.status2 = 2;
  1007. return (this.form.contents = "二级审批驳回");
  1008. } else if (item.shenPiJiBie == "三级") {
  1009. this.form.status3 = 2;
  1010. return (this.form.contents = "三级审批驳回");
  1011. } else if (item.shenPiJiBie == "四级") {
  1012. this.form.status4 = 2;
  1013. return (this.form.contents = "四级审批驳回");
  1014. }
  1015. });
  1016. console.log(this.form);
  1017. updateBdglLeave(this.form).then((response) => {
  1018. this.$modal.msgSuccess("审批成功");
  1019. this.open = false;
  1020. this.getList();
  1021. });
  1022. }
  1023. });
  1024. },
  1025. //超级审批通过按钮
  1026. TSsubmitForms() {
  1027. this.$refs["forms"].validateField("specialApproval", (valid) => {
  1028. if (!valid) {
  1029. this.bdglLeaveList.forEach((item) => {
  1030. if (item.shenPiJiBie == "一级") {
  1031. this.form.status1 = 3;
  1032. this.form.common = "1";
  1033. this.form.contents = "一级审批通过";
  1034. } else if (item.shenPiJiBie == "二级") {
  1035. this.form.status2 = 3;
  1036. this.form.common = "2";
  1037. this.form.contents = "二级审批通过";
  1038. } else if (item.shenPiJiBie == "三级") {
  1039. this.form.status3 = 3;
  1040. this.form.common = "3";
  1041. this.form.contents = "三级审批通过";
  1042. } else if (item.shenPiJiBie == "四级") {
  1043. this.form.status4 = 3;
  1044. this.form.common = "4";
  1045. this.form.contents = "四级审批通过";
  1046. }
  1047. });
  1048. if (this.form.id != null) {
  1049. updateBdglLeave(this.form).then((response) => {
  1050. this.$modal.msgSuccess("审批成功");
  1051. this.opens = false;
  1052. this.getList();
  1053. });
  1054. }
  1055. }
  1056. });
  1057. },
  1058. // 超级审批驳回按钮
  1059. TSboHui() {
  1060. this.$refs["forms"].validate((valid) => {
  1061. if (valid) {
  1062. this.bdglLeaveList.forEach((item) => {
  1063. if (item.shenPiJiBie == "一级") {
  1064. this.form.status1 = 2;
  1065. this.form.common = "1";
  1066. return (this.form.contents = "一级审批驳回");
  1067. } else if (item.shenPiJiBie == "二级") {
  1068. this.form.status2 = 2;
  1069. this.form.common = "2";
  1070. return (this.form.contents = "二级审批驳回");
  1071. } else if (item.shenPiJiBie == "三级") {
  1072. this.form.status3 = 2;
  1073. this.form.common = "3";
  1074. return (this.form.contents = "三级审批驳回");
  1075. } else if (item.shenPiJiBie == "四级") {
  1076. this.form.status4 = 2;
  1077. this.form.common = "4";
  1078. return (this.form.contents = "四级审批驳回");
  1079. }
  1080. });
  1081. if (this.form.id != null) {
  1082. updateBdglLeave(this.form).then((response) => {
  1083. this.$modal.msgSuccess("审批成功");
  1084. this.opens = false;
  1085. this.getList();
  1086. });
  1087. }
  1088. }
  1089. });
  1090. },
  1091. // 表单重置
  1092. reset() {
  1093. this.form = {
  1094. id: null,
  1095. peopleId: null,
  1096. unitId: null,
  1097. startTime: null,
  1098. endTime: null,
  1099. leaveType: null,
  1100. leaveReason: null,
  1101. departureTime: null,
  1102. returnTime: null,
  1103. returnStatus: "0",
  1104. isReturn: null,
  1105. updatetime: null,
  1106. adminId: null,
  1107. createtime: null,
  1108. peopleId1: null,
  1109. postId: null,
  1110. peopleId2: null,
  1111. peopleId3: null,
  1112. peopleId4: null,
  1113. status1: null,
  1114. status2: null,
  1115. status3: null,
  1116. status4: null,
  1117. contents: null,
  1118. statusd: null,
  1119. rejoin: null,
  1120. specialApproval: null,
  1121. };
  1122. this.resetForm("form");
  1123. },
  1124. /** 搜索按钮操作 */
  1125. handleQuery() {
  1126. this.queryParams.pageNum = 1;
  1127. this.getList();
  1128. },
  1129. /** 重置按钮操作 */
  1130. resetQuery() {
  1131. this.resetForm("queryForm");
  1132. this.handleQuery();
  1133. },
  1134. // 多选框选中数据
  1135. handleSelectionChange(selection) {
  1136. this.ids = selection.map((item) => item.id);
  1137. this.single = selection.length !== 1;
  1138. this.multiple = !selection.length;
  1139. },
  1140. /** 新增按钮操作 */
  1141. handleAdd() {
  1142. this.statussp = "0";
  1143. (this.renYuan = []),
  1144. // 获取单位树形
  1145. this.getBuMeng();
  1146. // 获取字典类型
  1147. this.getdict();
  1148. this.reset();
  1149. this.open = true;
  1150. this.title = "添加人员请假";
  1151. },
  1152. /** 修改按钮操作 */
  1153. handleUpdate(row) {
  1154. this.statussp = "0";
  1155. this.getBuMeng();
  1156. // 获取字典类型
  1157. this.getdict();
  1158. this.reset();
  1159. const id = row.id || this.ids;
  1160. getBdglLeave(id).then((response) => {
  1161. this.form = response.data;
  1162. this.getYong(this.form.unitId);
  1163. this.getRen(this.form.unitId);
  1164. this.open = true;
  1165. this.title = "修改人员请假";
  1166. });
  1167. },
  1168. /** 提交按钮 */
  1169. submitForm() {
  1170. this.$refs["form"].validate((valid) => {
  1171. if (valid) {
  1172. if (this.form.id != null) {
  1173. updateBdglLeave(this.form).then((response) => {
  1174. this.$modal.msgSuccess("修改成功");
  1175. this.open = false;
  1176. this.getList();
  1177. });
  1178. } else if (this.form.common != null) {
  1179. } else {
  1180. addBdglLeave(this.form).then((response) => {
  1181. this.$modal.msgSuccess("新增成功");
  1182. this.open = false;
  1183. this.getList();
  1184. });
  1185. }
  1186. }
  1187. });
  1188. },
  1189. /** 删除按钮操作 */
  1190. handleDelete(row) {
  1191. const ids = row.id || this.ids;
  1192. this.$modal
  1193. .confirm('是否确认删除人员请假编号为"' + ids + '"的数据项?')
  1194. .then(function () {
  1195. return delBdglLeave(ids);
  1196. })
  1197. .then(() => {
  1198. this.getList();
  1199. this.$modal.msgSuccess("删除成功");
  1200. })
  1201. .catch(() => {});
  1202. },
  1203. /** 导出按钮操作 */
  1204. handleExport() {
  1205. const queryParams = this.queryParams;
  1206. this.$modal
  1207. .confirm("是否确认导出所有人员请假数据项?")
  1208. .then(() => {
  1209. this.exportLoading = true;
  1210. return exportBdglLeave(queryParams);
  1211. })
  1212. .then((response) => {
  1213. this.$download.name(response.msg);
  1214. this.exportLoading = false;
  1215. })
  1216. .catch(() => {});
  1217. },
  1218. },
  1219. };
  1220. </script>
  1221. <style scoped>
  1222. /* 对话框背景颜色 */
  1223. ::v-deep .el-dialog {
  1224. background: #004d86 !important;
  1225. width: 800px !important;
  1226. }
  1227. ::v-deep .el-textarea__inner {
  1228. width: 920px;
  1229. height: 104px;
  1230. margin: auto;
  1231. }
  1232. ::v-deep .el-dialog__header {
  1233. border-bottom: 1px solid #718a9d;
  1234. }
  1235. ::v-deep .el-dialog__title {
  1236. color: #fff;
  1237. font: 18px;
  1238. }
  1239. ::v-deep .el-dialog__headerbtn .el-dialog__close {
  1240. color: #fff;
  1241. }
  1242. ::v-deep .el-form-item__label {
  1243. font: 16px;
  1244. color: #fff;
  1245. width: 100px !important;
  1246. }
  1247. ::v-deep .el-input__inner {
  1248. /* width: 200px !important;
  1249. height: 36px; */
  1250. background: transparent;
  1251. color: #fff;
  1252. }
  1253. /* 单位框背景颜色 */
  1254. ::v-deep .vue-treeselect__control {
  1255. background: #004d86 !important;
  1256. }
  1257. /* 基本信息背景 */
  1258. .jiben {
  1259. width: 920px;
  1260. height: 32px;
  1261. background-image: url(../../../images/小标题底.png);
  1262. margin-bottom: 25px;
  1263. color: #fff;
  1264. padding-left: 16px;
  1265. line-height: 32px;
  1266. }
  1267. /*调整表单间距 */
  1268. ::v-deep .el-form-item__content {
  1269. width: 200px;
  1270. }
  1271. ::v-deep .el-input__inner {
  1272. cursor: pointer !important;
  1273. }
  1274. /* 底部确定取消按钮 */
  1275. ::v-deep .el-dialog__footer {
  1276. padding: 30px 50px;
  1277. }
  1278. ::v-deep .el-dialog__body {
  1279. margin: 10px 30px 20px 30px;
  1280. padding-top: 20px !important;
  1281. box-sizing: border-box;
  1282. /* padding: 30px 12px 30px 28px; */
  1283. }
  1284. .contents {
  1285. padding: 0px 40px !important;
  1286. }
  1287. /* 下拉菜单 */
  1288. .el-dropdown-link {
  1289. cursor: pointer;
  1290. color: #409eff;
  1291. }
  1292. .el-icon-arrow-down {
  1293. font-size: 12px;
  1294. }
  1295. /* 下拉菜单字体/背景颜色 */
  1296. .el-select-dropdown__item.hover,
  1297. .el-select-dropdown__item:hover {
  1298. background-color: #004d86;
  1299. color: #fff;
  1300. }
  1301. .el-select-dropdown__item {
  1302. color: #fff;
  1303. }
  1304. /* 时间选择 */
  1305. ::v-deep .el-input--small .el-input__inner {
  1306. width: 200px;
  1307. height: 36px;
  1308. line-height: 36px;
  1309. }
  1310. .el-date-editor.el-input {
  1311. width: 200px;
  1312. height: 36px;
  1313. line-height: 36px;
  1314. }
  1315. ::v-deep .el-date-editor.el-input .el-input__inner {
  1316. height: 36px;
  1317. line-height: 36px;
  1318. }
  1319. /* 单位框背景颜色 */
  1320. ::v-deep .vue-treeselect__control {
  1321. background: #004d86 !important;
  1322. color: #fff;
  1323. }
  1324. /* 单位下拉菜单选中字体颜色 */
  1325. ::v-deep .vue-treeselect__single-value {
  1326. color: #fff !important;
  1327. }
  1328. /* 分页按钮 */
  1329. ::v-deep .el-pagination.is-background .el-pager li {
  1330. background-color: #004d86;
  1331. color: #fff;
  1332. }
  1333. ::v-deep .el-pagination.is-background .btn-next {
  1334. background-color: #004d86;
  1335. color: #fff;
  1336. }
  1337. /* 底部确定取消按钮 */
  1338. ::v-deep .el-dialog__footer {
  1339. padding: 18px 50px;
  1340. margin-right: 42px;
  1341. }
  1342. /* 增加按钮弹框 */
  1343. ::v-deep .el-dialog {
  1344. width: 1060px !important;
  1345. }
  1346. ::v-deep .el-dialog__body {
  1347. padding: none !important;
  1348. }
  1349. /* 小手样式 */
  1350. ::v-deep .el-table__cell {
  1351. cursor: pointer;
  1352. }
  1353. .el-button--mini {
  1354. width: 80px !important;
  1355. border: 1px solid transparent;
  1356. padding: 3px 8px;
  1357. font-size: 14px;
  1358. line-height: 1.5;
  1359. border-radius: 3px;
  1360. color: #fff;
  1361. background-color: #1890ff;
  1362. }
  1363. </style>