index.vue 22 KB

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