index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. <!--审批流程-->
  2. <template>
  3. <div class="app-container approvalProcess">
  4. <div class="title-box">
  5. <p>化学品申购审批流程</p>
  6. <p class="inquire-button-one" @click="submitForm">提交</p>
  7. </div>
  8. <div class="approvalProcess-page scrollbar-box">
  9. <div class="process-max-box">
  10. <div class="process-big-box">
  11. <div class="process-text-box">
  12. <img src="@/assets/ZDimages/medicUniversity-3_1/icon_splc_fqr.png">
  13. <p>发起人</p>
  14. </div>
  15. <p class="process-name-p">申购人</p>
  16. <div class="process-img-box">
  17. <img v-if="dataList[0]" class="process-img-bottom" src="@/assets/ZDimages/medicUniversity-3_1/img_splc_xyb.png">
  18. <img v-if="!dataList[0]" @click="listAddButton" class="process-add-button-img" src="@/assets/ZDimages/medicUniversity-3_1/icon_splc_tj.png">
  19. </div>
  20. </div>
  21. </div>
  22. <div class="process-max-box-for" :class="index==dataList.length-1?'process-max-box-for-over':''" v-for="(item,index) in dataList" :key="index">
  23. <div class="process-big-box">
  24. <div class="process-text-box">
  25. <img src="@/assets/ZDimages/medicUniversity-3_1/icon_splc_fqr.png">
  26. <p>审批人</p>
  27. <i class="el-icon-close" @click="listDelButton(index)"></i>
  28. </div>
  29. <div class="process-name-box" @click="openDialogButton(index)">
  30. <p class="process-name-p">{{!item.actAudituserInfo[0]?'请选择审批人':(item.actAudituserInfo[0]&&!item.actAudituserInfo[1]?item.actAudituserInfo[0].nickName:(item.actAudituserInfo[1]?'已选择'+item.actAudituserInfo.length+'人':''))}}</p>
  31. <i class="el-icon-arrow-right"></i>
  32. </div>
  33. <div class="process-img-box">
  34. <img v-if="index!=dataList.length-1" class="process-img-bottom" src="@/assets/ZDimages/medicUniversity-3_1/img_splc_xyb.png">
  35. <img v-if="index==dataList.length-1" class="process-img-bottom" src="@/assets/ZDimages/medicUniversity-3_1/img_splc_lcjs.png">
  36. <img v-if="index==dataList.length-1&&dataList.length<5" @click="listAddButton" class="process-add-button-img" src="@/assets/ZDimages/medicUniversity-3_1/icon_splc_tj.png">
  37. </div>
  38. <p class="over-text-one" v-if="index==dataList.length-1">流程结束</p>
  39. <p class="over-text-two" v-if="index==dataList.length-1">审批不能超过5级</p>
  40. </div>
  41. </div>
  42. </div>
  43. <el-dialog title="选择人员" :visible.sync="userDialogType" v-if="userDialogType"
  44. width="900px" append-to-body id="approvalProcess-dialog-box">
  45. <div class="dialog-max-big-box">
  46. <div class="dialog-left-max-big-box">
  47. <p class="title-p">选择:</p>
  48. <div class="big-box">
  49. <!--input部分-->
  50. <div class="input-box">
  51. <input type="text" placeholder="搜索姓名或工号、身份"
  52. v-model="queryParamsData.nickName">
  53. <p class="el-icon-search" @click="handleQuery"></p>
  54. </div>
  55. <!--面包屑部分-->
  56. <div class="title-list-box scrollbar-box">
  57. <div class="title-for" v-for="(item,index) in titleList" :key="index" @click="titleClick(index)">
  58. <span :class="index!=titleList.length-1?'spanColor':''">{{item.label}}</span>
  59. <span v-if="index!=titleList.length-1" class="el-icon-arrow-right"></span>
  60. </div>
  61. </div>
  62. <!--可滚动数据部分-->
  63. <div class="list-max-box scrollbar-box">
  64. <!--部门部分-->
  65. <div class="dept-box" @click="deptClick(item)"
  66. v-for="(item,index) in deptList" :key="item.deptId">
  67. <img src="@/assets/ZDimages/medicUniversity-3_1/icon-mc.png">
  68. <p>{{item.label}}</p>
  69. <img src="@/assets/ZDimages/medicUniversity-3_1/icon-mc-xj.png">
  70. <p>下级</p>
  71. </div>
  72. <!--人员部分-->
  73. <div class="user-box" v-for="(item,index) in userList" :key="index" @click="addObjButton(item)">
  74. <img v-if="item.type" src="@/assets/ZDimages/personnelManagement/icon_xzqx_xz.png">
  75. <img v-if="!item.type" src="@/assets/ZDimages/personnelManagement/icon_xzqx_zc.png">
  76. <p>{{item.nickName}}</p>
  77. <p>{{item.positionName}}</p>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="dialog-right-max-big-box">
  83. <p class="title-p">已选:</p>
  84. <div class="big-box scrollbar-box">
  85. <div class="user-for-box" v-for="(item,index) in userDialogRightList.actAudituserInfo" :key="index">
  86. <img :src="item.avatar">
  87. <p>{{item.nickName}}</p>
  88. <p class="el-icon-circle-close" @click="delRightUser(index)"></p>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="dialog-bottom-box">
  94. <div class="pagination-box">
  95. <pagination :page-sizes="[20, 30, 40, 50]"
  96. v-show="total>0"
  97. :total="total"
  98. :pager-count="5"
  99. layout="total, prev, pager, next"
  100. :page.sync="queryParams.pageNum"
  101. :limit.sync="queryParams.pageSize"
  102. @pagination="getUserList()"
  103. />
  104. </div>
  105. <div class="radio-box">
  106. <el-radio-group v-model="userDialogRightList.auditType">
  107. <el-radio :label="1" style="color:#999;">依次审批</el-radio>
  108. <el-radio :label="2" style="color:#999;">或签</el-radio>
  109. </el-radio-group>
  110. </div>
  111. <div class="text-box">选择不能超过10人</div>
  112. </div>
  113. <div slot="footer" class="dialog-footer">
  114. <p class="dialog-footer-null-p"></p>
  115. <el-button @click="offDialog">取 消</el-button>
  116. <el-button type="primary" @click="upDataButton">确 定</el-button>
  117. <p class="dialog-footer-null-p"></p>
  118. </div>
  119. </el-dialog>
  120. </div>
  121. </template>
  122. <script>
  123. import { getConfigList,treeselect,listUser,auditconfig } from "@/api/medicUniversity-3_1/index";
  124. export default {
  125. name: "index",
  126. data(){
  127. return{
  128. //流程数据
  129. dataList:[],
  130. //人员选择页面开关
  131. userDialogType:false,
  132. //选中流程的index
  133. userDialogTypeIndex:null,
  134. //窗口右侧已选中人员数据
  135. userDialogRightList:{},
  136. //面包屑数据
  137. titleList:[],
  138. //院系数据
  139. deptList:[],
  140. //人员数据
  141. userList:[
  142. {name:"柴云龙1",type:true,text:"安全责任人",id:1,},
  143. {name:"柴云龙2",type:false,text:"安全责任人",id:2,},
  144. {name:"柴云龙3",type:true,text:"安全责任人",id:3,},
  145. {name:"柴云龙4",type:false,text:"安全责任人",id:4,},
  146. {name:"柴云龙5",type:true,text:"安全责任人",id:5,},
  147. {name:"柴云龙6",type:false,text:"安全责任人",id:6,},
  148. ],
  149. //查询数据
  150. queryParamsData:{
  151. pageNum:1,
  152. pageSize:20,
  153. },
  154. // 搜索实际发送数据
  155. queryParams:{
  156. pageNum:1,
  157. pageSize:20,
  158. },
  159. //数据数量
  160. total:0,
  161. deptId:"",
  162. }
  163. },
  164. created() {
  165. },
  166. mounted(){
  167. this.getConfigList();
  168. },
  169. methods: {
  170. //提交
  171. submitForm(){
  172. let self = this;
  173. if(!this.dataList[0]){
  174. this.msgError('至少添加一个审批流程')
  175. return
  176. }
  177. self.$confirm('确认要提交吗?', "警告", {
  178. confirmButtonText: "确定",
  179. cancelButtonText: "取消",
  180. type: "warning"
  181. }).then(function() {
  182. for(let i=0;i<self.dataList.length;i++){
  183. if(!self.dataList[i].actAudituserInfo[0]){
  184. self.msgError('第'+(i+1)+'个审批流程未添加人员')
  185. return
  186. }
  187. }
  188. let list = [];
  189. for(let i=0;i<self.dataList.length;i++){
  190. let bigObj = {
  191. auditType:self.dataList[i].auditType,
  192. actAudituser:[],
  193. };
  194. for(let o=0;o<self.dataList[i].actAudituserInfo.length;o++){
  195. let obj = {
  196. auditUserId:self.dataList[i].actAudituserInfo[o].userId,
  197. };
  198. bigObj.actAudituser.push(obj);
  199. }
  200. list.push(bigObj);
  201. }
  202. auditconfig(list).then(response => {
  203. self.msgSuccess(response.msg);
  204. self.getConfigList();
  205. });
  206. }).then(() => {
  207. }).catch(() => {});
  208. },
  209. //确认
  210. upDataButton(){
  211. this.dataList[this.userDialogTypeIndex] = JSON.parse(JSON.stringify(this.userDialogRightList));
  212. this.userDialogType = false;
  213. },
  214. //关闭弹窗
  215. offDialog(){
  216. this.userDialogType = false;
  217. },
  218. // 查询设置
  219. getConfigList(){
  220. getConfigList().then(response => {
  221. this.dataList = response.rows
  222. });
  223. },
  224. //添加勾选人员
  225. addObjButton(item){
  226. if(!item.type){
  227. if(this.userDialogRightList.actAudituserInfo.length<10){
  228. this.userDialogRightList.actAudituserInfo.push(item);
  229. this.checkDataProcess();
  230. }else{
  231. this.msgError('选择不能超过10人')
  232. }
  233. }
  234. },
  235. //删除选中人员
  236. delRightUser(index){
  237. this.userDialogRightList.actAudituserInfo.splice(index,1);
  238. this.checkDataProcess();
  239. },
  240. // 勾选数据处理
  241. checkDataProcess(){
  242. let self = this;
  243. for(let i=0;i<self.userList.length;i++){
  244. let num = 0;
  245. for(let o=0;o<self.userDialogRightList.actAudituserInfo.length;o++){
  246. if(self.userList[i].userId == self.userDialogRightList.actAudituserInfo[o].userId){
  247. num++
  248. }
  249. }
  250. self.userList[i].type = num != 0;
  251. }
  252. self.$forceUpdate();
  253. },
  254. //面包屑点击事件
  255. titleClick(index){
  256. let self = this;
  257. this.getCatalogListOne(this.titleList[index].id);
  258. this.$set(this.queryParams,'pageNum',1);
  259. this.$set(this,'deptId',this.titleList[index].id);
  260. this.getUserList();
  261. let list = [];
  262. let data = JSON.parse(JSON.stringify(self.titleList))
  263. for(let i=index;i>=0;i--){
  264. list.unshift(data[i]);
  265. }
  266. this.$set(this,'titleList',list);
  267. },
  268. // 目录点击事件
  269. deptClick(item){
  270. this.titleList.push(item);
  271. this.getCatalogListOne(item.id);
  272. this.$set(this.queryParams,'pageNum',1);
  273. this.$set(this,'deptId',item.id);
  274. this.getUserList();
  275. },
  276. // 查询目录
  277. getCatalogListOne(id){
  278. treeselect({parentId:id}).then(response => {
  279. this.deptList = response.data;
  280. });
  281. },
  282. // 查询目录初始化
  283. getCatalogList(id){
  284. treeselect({parentId:id}).then(response => {
  285. this.deptList = response.data[0].children;
  286. this.$set(this,'titleList',[response.data[0]]);
  287. });
  288. },
  289. // 查询人员列表
  290. getUserList(){
  291. this.queryParamsData = JSON.parse(JSON.stringify(this.queryParams));
  292. this.queryParamsData.deptId = this.deptId;
  293. listUser(this.queryParamsData).then(response => {
  294. this.userList = response.rows;
  295. this.total = response.total;
  296. this.checkDataProcess();
  297. });
  298. },
  299. handleQuery() {
  300. this.$set(this.queryParamsData,'pageNum',1);
  301. this.queryParams = JSON.parse(JSON.stringify(this.queryParamsData));
  302. this.getUserList();
  303. },
  304. // 编辑人员页面开启
  305. openDialogButton(index){
  306. let self = this;
  307. this.$set(this.queryParamsData,'nickName',"");
  308. this.$set(this.queryParams,'nickName',"");
  309. this.$set(this,'deptId',"");
  310. this.getCatalogList("");
  311. this.getUserList("");
  312. this.$set(this,'userDialogRightList',JSON.parse(JSON.stringify(this.dataList[index])));
  313. this.$set(this,'userDialogTypeIndex',index);
  314. this.$set(this,'userDialogType',true);
  315. },
  316. //添加流
  317. listAddButton(){
  318. let obj = {
  319. actAudituser:[],
  320. actAudituserInfo:[],
  321. auditType:1,
  322. };
  323. this.dataList.push(obj);
  324. },
  325. //删除流
  326. listDelButton(index){
  327. let self = this;
  328. this.$confirm('是否确认删除该流程?', "警告", {
  329. confirmButtonText: "确定",
  330. cancelButtonText: "取消",
  331. type: "warning"
  332. }).then(function() {
  333. self.dataList.splice(index,1);
  334. }).then(() => {
  335. }).catch(() => {});
  336. },
  337. }
  338. }
  339. </script>
  340. <style scoped lang="scss">
  341. .approvalProcess{
  342. flex:1;
  343. display: flex;
  344. flex-direction: column;
  345. overflow: hidden!important;
  346. p{
  347. margin:0;
  348. padding:0;
  349. }
  350. .title-box{
  351. display: flex;
  352. height:90px;
  353. border-bottom: 1px solid #D8D8D8;
  354. p:nth-child(1){
  355. flex:1;
  356. font-size:16px;
  357. line-height:90px;
  358. margin-left:18px;
  359. color:#0045AF;
  360. }
  361. p:nth-child(2){
  362. margin:25px 25px 0 0;
  363. }
  364. }
  365. .approvalProcess-page{
  366. flex:1;
  367. font-weight:500;
  368. padding:40px 0;
  369. .process-max-box{
  370. width:350px;
  371. height:215px;
  372. margin:0 auto;
  373. .process-big-box{
  374. width:350px;
  375. height:130px;
  376. .process-text-box{
  377. width:350px;
  378. height:50px;
  379. background: #0183fa;
  380. display: flex;
  381. img{
  382. width:24px;
  383. height:24px;
  384. margin:13px 8px 13px 20px;
  385. }
  386. p{
  387. flex:1;
  388. font-size:16px;
  389. color:#fff;
  390. line-height:50px;
  391. }
  392. }
  393. .process-name-p{
  394. width:350px;
  395. height:80px;
  396. border:1px solid #e0e0e0;
  397. line-height:80px;
  398. font-size:16px;
  399. padding-left:20px;
  400. }
  401. }
  402. .process-img-box{
  403. position: relative;
  404. height:85px;
  405. .process-img-bottom{
  406. display: block;
  407. width:17px;
  408. height:85px;
  409. margin:0 auto;
  410. }
  411. .process-add-button-img{
  412. cursor: pointer;
  413. position: absolute;
  414. bottom:36px;
  415. left:163px;
  416. width:24px;
  417. height:24px;
  418. }
  419. }
  420. }
  421. .process-max-box-for-over{
  422. height:300px!important;
  423. }
  424. .process-max-box-for{
  425. width:350px;
  426. height:215px;
  427. margin:0 auto;
  428. .process-big-box{
  429. width:350px;
  430. height:130px;
  431. .process-text-box{
  432. width:350px;
  433. height:50px;
  434. background: #FFA50A;
  435. display: flex;
  436. img{
  437. width:24px;
  438. height:24px;
  439. margin:13px 8px 13px 20px;
  440. }
  441. p{
  442. flex:1;
  443. font-size:16px;
  444. color:#fff;
  445. line-height:50px;
  446. }
  447. i{
  448. cursor: pointer;
  449. color:#fff;
  450. font-size:24px;
  451. line-height:50px;
  452. margin:0 18px 0 0;
  453. }
  454. }
  455. .process-name-box{
  456. display: flex;
  457. border:1px solid #e0e0e0;
  458. cursor: pointer;
  459. .process-name-p{
  460. width:350px;
  461. height:80px;
  462. line-height:80px;
  463. font-size:16px;
  464. padding-left:20px;
  465. }
  466. .el-icon-arrow-right{
  467. line-height:80px;
  468. font-size:24px;
  469. margin-right:13px;
  470. color:#999;
  471. }
  472. }
  473. .process-img-box{
  474. position: relative;
  475. height:85px;
  476. .process-img-bottom{
  477. display: block;
  478. width:17px;
  479. height:85px;
  480. margin:0 auto;
  481. }
  482. .process-add-button-img{
  483. cursor: pointer;
  484. position: absolute;
  485. bottom:36px;
  486. left:163px;
  487. width:24px;
  488. height:24px;
  489. }
  490. }
  491. .over-text-one{
  492. text-align: center;
  493. font-size:16px;
  494. line-height:20px;
  495. color:#3D3D3D;
  496. margin:15px 0 10px 0;
  497. }
  498. .over-text-two{
  499. text-align: center;
  500. font-size:14px;
  501. line-height:20px;
  502. color:#999999;
  503. }
  504. }
  505. }
  506. }
  507. }
  508. </style>
  509. <style lang="scss">
  510. #approvalProcess-dialog-box{
  511. p{
  512. margin:0;
  513. }
  514. .el-dialog__body{
  515. padding:0 30px;
  516. .dialog-max-big-box{
  517. display: flex;
  518. .dialog-left-max-big-box{
  519. flex:1;
  520. .title-p{
  521. margin:18px 0 14px 0;
  522. font-size:16px;
  523. color:#333;
  524. }
  525. .big-box{
  526. width: 400px;
  527. height:515px;
  528. background: #F5F5F5;
  529. border-radius: 6px;
  530. overflow: hidden;
  531. .input-box{
  532. width:358px;
  533. height:40px;
  534. margin:21px 21px 0;
  535. display: flex;
  536. border-radius:6px;
  537. overflow: hidden;
  538. input{
  539. border:none;
  540. outline:none;
  541. color:#333;
  542. height:40px;
  543. width:300px;
  544. padding-left:10px;
  545. }
  546. input::placeholder{
  547. color:#CCCCCC;
  548. }
  549. p{
  550. cursor: pointer;
  551. width:58px;
  552. line-height:40px;
  553. font-size:24px;
  554. background: #fff;
  555. color:#E0E0E0;
  556. text-align: center;
  557. }
  558. }
  559. .title-list-box{
  560. width:400px;
  561. padding:0 20px;
  562. height:54px;
  563. overflow-x: scroll;
  564. overflow-y: hidden;
  565. white-space: nowrap;
  566. .title-for{
  567. display: inline-block;
  568. /*display: flex;*/
  569. .spanColor{
  570. color:#0045AF;
  571. cursor: pointer;
  572. }
  573. span:nth-child(1){
  574. display: inline-block;
  575. line-height:54px;
  576. font-size:14px;
  577. }
  578. span:nth-child(2){
  579. display: inline-block;
  580. width:24px;
  581. text-align: center;
  582. line-height:54px;
  583. color:#333333;
  584. font-size:14px;
  585. }
  586. }
  587. }
  588. .list-max-box{
  589. height:400px;
  590. .dept-box:hover{
  591. background: rgba(0,69,175,0.1);
  592. }
  593. .dept-box{
  594. cursor: pointer;
  595. display: flex;
  596. img:nth-child(1){
  597. width:30px;
  598. height:30px;
  599. margin:11px 16px 0 23px;
  600. }
  601. p:nth-child(2){
  602. flex:1;
  603. line-height:52px;
  604. font-size:14px;
  605. color:#333;
  606. }
  607. img:nth-child(3){
  608. width:20px;
  609. height:20px;
  610. margin: 16px 9px;
  611. }
  612. p:nth-child(4){
  613. line-height:52px;
  614. font-size:14px;
  615. color:#0045af;
  616. margin-right:22px;
  617. }
  618. }
  619. .user-box:hover{
  620. background: rgba(0,69,175,0.1);
  621. }
  622. .user-box{
  623. cursor: pointer;
  624. display: flex;
  625. img:nth-child(1){
  626. width:14px;
  627. height:14px;
  628. margin:12px 13px 0 28px;
  629. }
  630. p:nth-child(2){
  631. line-height:40px;
  632. color:#333;
  633. font-size:14px;
  634. flex:1;
  635. }
  636. p:nth-child(3){
  637. line-height:40px;
  638. color:#333;
  639. font-size:14px;
  640. margin-right:30px;
  641. }
  642. }
  643. }
  644. }
  645. }
  646. .dialog-right-max-big-box{
  647. flex:1;
  648. .title-p{
  649. margin:18px 0 14px 20px;
  650. font-size:16px;
  651. color:#333;
  652. }
  653. .big-box{
  654. width: 400px;
  655. height:515px;
  656. background: #F5F5F5;
  657. border-radius: 6px;
  658. margin-left:20px;
  659. .user-for-box:hover{
  660. background: rgba(0,69,175,0.1);
  661. }
  662. .user-for-box{
  663. display: flex;
  664. img{
  665. width:40px;
  666. height:40px;
  667. margin:10px 23px 0 26px;
  668. border-radius:50%;
  669. }
  670. p:nth-child(2){
  671. flex:1;
  672. line-height:60px;
  673. font-size:14px;
  674. color:#333;
  675. }
  676. p:nth-child(3){
  677. cursor: pointer;
  678. line-height:60px;
  679. font-size:24px;
  680. color:#A2A2A2;
  681. margin-right:27px;
  682. }
  683. }
  684. }
  685. }
  686. }
  687. }
  688. .dialog-bottom-box{
  689. height:56px;
  690. display: flex;
  691. .pagination-box{
  692. width:400px;
  693. }
  694. .radio-box{
  695. flex:1;
  696. font-size:14px;
  697. margin-left:50px;
  698. margin-top:22px;
  699. }
  700. .text-box{
  701. margin-top:20px;
  702. font-size:14px;
  703. color:#999999;
  704. }
  705. }
  706. .dialog-footer{
  707. display: flex;
  708. .dialog-footer-null-p{
  709. flex:1;
  710. }
  711. }
  712. }
  713. </style>