approvalPage.vue 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153
  1. <template>
  2. <div class="approvalPage">
  3. <div class="approvalPage-min" v-if="pageType == 1">
  4. <div class="title-box">
  5. <p>化学品申购</p>
  6. <p class="reset-button-one button-p" @click="backPage(0)">返回</p>
  7. <!--已拒绝/已撤销时显示-->
  8. <p class="inquire-button-one button-p" v-if="dataInfo.approvalStatus==2||dataInfo.approvalStatus==3" @click="goEditPage">编辑</p>
  9. </div>
  10. <div class="page-max-box scrollbar-box">
  11. <div class="text-box-one">
  12. <p>编号:</p>
  13. <p>{{dataInfo.applyNum}}</p>
  14. <p>申购人:{{dataInfo.applyUserName}}</p>
  15. <p :class="dataInfo.approvalStatus==0?'colorA':(dataInfo.approvalStatus==1?'colorB':(dataInfo.approvalStatus==2?'colorC':(dataInfo.approvalStatus==3?'colorD':'')))"
  16. >{{dataInfo.approvalStatus==0&&approvalPagePropsData.userType==1?'等待我审批':(dataInfo.approvalStatus==0&&approvalPagePropsData.userType!=1?'等待审批':(dataInfo.approvalStatus==1?'已通过':(dataInfo.approvalStatus==2?'已拒绝':(dataInfo.approvalStatus==3?'已撤销':''))))}}</p>
  17. </div>
  18. <div class="text-box-two">
  19. <p>申购原因:</p>
  20. <p>{{dataInfo.applyReason}}</p>
  21. </div>
  22. <div class="text-box-one">
  23. <p>实验室:</p>
  24. <p style="flex:1;">{{dataInfo.subName}}</p>
  25. </div>
  26. <div class="text-box-three">
  27. <p class="el-icon-info"></p>
  28. <p>勾选的化学品为已同意申购</p>
  29. </div>
  30. <!--审批单-->
  31. <div class="table-title-box-one" v-if="approvalPagePropsData.type == 2">
  32. <!--<img @click="allCheckClick" :class="approvalPagePropsData.type==1?'cursor-img':''" v-if="!allCheckType" src="@/assets/ZDimages/medicUniversity-3_1/icon_sp_wxz.png">-->
  33. <!--<img @click="allCheckClick" :class="approvalPagePropsData.type==1?'cursor-img':''" v-if="allCheckType" src="@/assets/ZDimages/medicUniversity-3_1/icon_ytg_xz.png">-->
  34. <p></p>
  35. <p></p>
  36. <p>化学品名</p>
  37. <p>化学品柜</p>
  38. <p>位置</p>
  39. <p>申购人剩余可存放量</p>
  40. <p>本次申购量</p>
  41. </div>
  42. <div class="table-list-box-one" v-if="approvalPagePropsData.type == 2" v-for="(item,index) in dataInfo.actHxpapplyDetailList" :key="index">
  43. <img @click="checkClick(item)" v-if="item.tickStatus != 1" src="@/assets/ZDimages/medicUniversity-3_1/icon_sp_wxz.png">
  44. <img @click="checkClick(item)" v-if="item.tickStatus == 1" src="@/assets/ZDimages/medicUniversity-3_1/icon_ytg_xz.png">
  45. <p></p>
  46. <el-tooltip class="item" effect="dark" :content="item.chemicalName" placement="top">
  47. <p>{{item.chemicalName}}</p>
  48. </el-tooltip>
  49. <el-tooltip class="item" effect="dark" :content="item.cabinetName" placement="top">
  50. <p>{{item.cabinetName}}</p>
  51. </el-tooltip>
  52. <el-tooltip class="item" effect="dark" :content="item.posi" placement="top">
  53. <p>{{item.posi}}</p>
  54. </el-tooltip>
  55. <p>{{item.remainingStorage}}g</p>
  56. <p>{{item.applyNum}}</p>
  57. </div>
  58. <p class="approval-title-p">审批流程</p>
  59. <!--审批流程-->
  60. <div class="approval-list-max-box">
  61. <div class="approval-for-box">
  62. <div class="approval-for-box-min">
  63. <div class="left-max-box">
  64. <div class="left-top-box">
  65. <img src="">
  66. <!--<img src="">-->
  67. <div class="left-top-text-box">
  68. <p>发起申请</p>
  69. <p>{{dataInfo.applyUserName}}</p>
  70. </div>
  71. </div>
  72. <p class="left-bottom-p"></p>
  73. <img class="left-position-img" src="@/assets/ZDimages/medicUniversity-3_1/icon_cgsq_ytg.png">
  74. </div>
  75. <div class="right-max-box" style="border:none;">
  76. </div>
  77. <p class="right-right-time-p">{{dataInfo.createTime}}</p>
  78. </div>
  79. </div>
  80. <div class="approval-for-box" v-if="dataInfo.approvalStatus!=3" v-for="(item,index) in dataInfo.configInfoList" :key="index">
  81. <div class="approval-for-box-min">
  82. <div class="left-max-box">
  83. <div class="left-top-box" v-if="item.auditType == 1">
  84. <img v-if="item.actApplytaskNodeList[1]" src="@/assets/ZDimages/medicUniversity-3_1/icon_cgsq_ycsp.png">
  85. <img v-if="!item.actApplytaskNodeList[1]" :src="item.actApplytaskNodeList[0].applyUserList[0].avatar">
  86. <div class="left-top-text-box">
  87. <p>{{item.actApplytaskNodeList[1]?'依次审批':item.actApplytaskNodeList[0].applyUserList[0].postName}}</p>
  88. <p>{{item.approvalName}}</p>
  89. </div>
  90. </div>
  91. <div class="left-top-box" v-if="item.auditType == 2">
  92. <img v-if="item.actApplytaskNodeList[0].applyUserList[1]" src="@/assets/ZDimages/medicUniversity-3_1/icon_cgsq_ycsp.png">
  93. <img v-if="!item.actApplytaskNodeList[0].applyUserList[1]" :src="item.actApplytaskNodeList[0].applyUserList[0].avatar">
  94. <div class="left-top-text-box">
  95. <p>{{item.actApplytaskNodeList[0].applyUserList[1]?'或签':item.actApplytaskNodeList[0].applyUserList[0].postName}}</p>
  96. <p>{{item.approvalName}}</p>
  97. </div>
  98. </div>
  99. <p class="left-bottom-p" v-if="index!=dataInfo.configInfoList.length-1"></p>
  100. <img class="left-position-img" v-if="item.applyTaskStatus == 1" src="@/assets/ZDimages/medicUniversity-3_1/icon_cgsq_ytg.png">
  101. <img class="left-position-img" v-if="item.applyTaskStatus == 2" src="@/assets/ZDimages/medicUniversity-3_1/icon_cgsq_yjj.png">
  102. </div>
  103. <!--依次审批-->
  104. <div class="right-max-box" v-if="item.auditType == 1">
  105. <div class="right-for-name-box" v-for="(minItem,minIndex) in item.actApplytaskNodeList" :key="minIndex">
  106. <div class="right-for-name-box-min">
  107. <img :src="minItem.applyUserList[0].avatar">
  108. <p>{{minItem.applyUserList[0].name}}</p>
  109. <img class="right-min-img" src="@/assets/ZDimages/medicUniversity-3_1/icon_bz_1.png" v-if="minItem.nodeStatus == 1&&minIndex!=item.actApplytaskNodeList.length-1">
  110. <img class="right-min-img" src="@/assets/ZDimages/medicUniversity-3_1/icon_bz_2.png" v-if="!minItem.nodeStatus == 1&&minIndex!=item.actApplytaskNodeList.length-1">
  111. <img class="position-min-img" src="@/assets/ZDimages/medicUniversity-3_1/icon_cgsq_ytg.png" v-if="minItem.nodeStatus == 1">
  112. <img class="position-min-img" src="@/assets/ZDimages/medicUniversity-3_1/icon_cgsq_yjj.png" v-if="minItem.nodeStatus == 2">
  113. </div>
  114. </div>
  115. </div>
  116. <!--或审-->
  117. <div class="right-max-box" v-if="item.auditType == 2">
  118. <div class="right-for-name-box" v-for="(minItem,minIndex) in item.actApplytaskNodeList[0].applyUserList" :key="minIndex">
  119. <div class="right-for-name-box-min">
  120. <img :src="minItem.avatar">
  121. <p>{{minItem.name}}</p>
  122. <img class="right-min-img" src="@/assets/ZDimages/medicUniversity-3_1/icon_bz_1.png" v-if="item.actApplytaskNodeList[0].applyUserid == minItem.id&&minIndex!=item.actApplytaskNodeList[0].applyUserList.length-1">
  123. <img class="right-min-img" src="@/assets/ZDimages/medicUniversity-3_1/icon_bz_2.png" v-if="item.actApplytaskNodeList[0].applyUserid != minItem.id&&minIndex!=item.actApplytaskNodeList[0].applyUserList.length-1">
  124. <img class="position-min-img" src="@/assets/ZDimages/medicUniversity-3_1/icon_cgsq_ytg.png" v-if="item.actApplytaskNodeList[0].applyUserid == minItem.id&&item.actApplytaskNodeList[0].nodeStatus == 1">
  125. <img class="position-min-img" src="@/assets/ZDimages/medicUniversity-3_1/icon_cgsq_yjj.png" v-if="item.actApplytaskNodeList[0].applyUserid == minItem.id&&item.actApplytaskNodeList[0].nodeStatus == 2">
  126. </div>
  127. </div>
  128. </div>
  129. <p class="right-right-time-p">{{item.applyTaskTime}}</p>
  130. </div>
  131. </div>
  132. <div class="approval-for-box" v-if="dataInfo.approvalStatus==3">
  133. <div class="approval-for-box-min">
  134. <div class="left-max-box">
  135. <div class="left-top-box">
  136. <img src="">
  137. <!--<img src="">-->
  138. <div class="left-top-text-box">
  139. <p>已撤销</p>
  140. <p>{{dataInfo.applyUserName}}</p>
  141. </div>
  142. </div>
  143. </div>
  144. <div class="right-max-box" style="border:none;">
  145. </div>
  146. <p class="right-right-time-p">{{dataInfo.actApplytask.overTime}}</p>
  147. </div>
  148. </div>
  149. <p class="approval-for-min-p" v-if="dataInfo.approvalStatus==2">{{refuseContentText}}</p>
  150. </div>
  151. </div>
  152. </div>
  153. <el-dialog title="化学品详情" :visible.sync="infoDialogType" v-if="infoDialogType" width="900px" append-to-body class="approvalPage-info-dialog-box">
  154. <div class="approvalPage-info-dialog-text-big-box">
  155. <div class="approvalPage-info-dialog-box-text-box">
  156. <p>化学品名:</p>
  157. <p>{{infoDialogData.chemicalName}}</p>
  158. </div>
  159. <div class="approvalPage-info-dialog-box-text-box">
  160. <p>化学品ID:</p>
  161. <p>{{infoDialogData.id}}</p>
  162. </div>
  163. </div>
  164. <div class="approvalPage-info-dialog-text-big-box">
  165. <div class="approvalPage-info-dialog-box-text-box">
  166. <p>CAS:</p>
  167. <p>{{infoDialogData.casNum}}</p>
  168. </div>
  169. <div class="approvalPage-info-dialog-box-text-box">
  170. <p>别名:</p>
  171. <p>{{infoDialogData.anotherName}}</p>
  172. </div>
  173. </div>
  174. <div class="approvalPage-info-dialog-text-big-box">
  175. <div class="approvalPage-info-dialog-box-text-box">
  176. <p>分类:</p>
  177. <p>{{infoDialogData.chemicalClassify}}</p>
  178. </div>
  179. <div class="approvalPage-info-dialog-box-text-box">
  180. <p>属性:</p>
  181. <p>{{infoDialogData.classifyAttribute}}</p>
  182. </div>
  183. </div>
  184. <div class="approvalPage-info-dialog-text-big-box">
  185. <div class="approvalPage-info-dialog-box-text-box">
  186. <p>纯度:</p>
  187. <p>{{infoDialogData.purity}}</p>
  188. </div>
  189. <div class="approvalPage-info-dialog-box-text-box">
  190. <p>形态:</p>
  191. <p>{{infoDialogData.chemicalShape}}</p>
  192. </div>
  193. </div>
  194. <div slot="footer" class="dialog-footer">
  195. <el-button type="primary" @click="getHxpChemicalInfoOff">确 定</el-button>
  196. </div>
  197. </el-dialog>
  198. <el-dialog title="拒绝审批意见" :visible.sync="approvalTextType" v-if="approvalTextType" width="900px" append-to-body class="approvalPage-info-dialog-box">
  199. <el-form :model="formData" ref="form" :inline="true" label-width="120px">
  200. <el-form-item label="拒绝意见:" prop="refuseContent">
  201. <el-input
  202. maxlength="50"
  203. style="width:500px;"
  204. v-model="refuseContent"
  205. placeholder="请输入拒绝意见"
  206. clearable
  207. size="small"/>
  208. </el-form-item>
  209. </el-form>
  210. <div slot="footer" class="dialog-footer">
  211. <el-button @click="rejectButton">取 消</el-button>
  212. <el-button type="primary" @click="rejectDialogButton">确 定</el-button>
  213. </div>
  214. </el-dialog>
  215. </div>
  216. </template>
  217. <script>
  218. import { getHxpapply,getHxpChemicalInfo } from "@/api/studentApi/chemicalManagement/index";
  219. import { classifyList,hxpapplyAudit,approvalTask,approvalRefuse } from "@/api/medicUniversity-3_1/index";
  220. export default {
  221. name: "approvalPage",
  222. props:{
  223. approvalPagePropsData:{},
  224. },
  225. data(){
  226. return{
  227. //页面状态
  228. pageType:0,
  229. //详情展示弹窗开关
  230. infoDialogType:false,
  231. //拒绝审批开关
  232. approvalTextType:false,
  233. formData:{},
  234. refuseContent:"",
  235. dataInfo:{},
  236. //全选状态
  237. allCheckType:false,
  238. refuseContentText:"",
  239. //化学品详情
  240. infoDialogData:{},
  241. //化学品形态
  242. optionsList:[],
  243. //化学品分类列表
  244. optionsListOne:[],
  245. //属性列表
  246. optionsListTwo:[],
  247. //机柜页面传参
  248. listPropsData:{}
  249. }
  250. },
  251. created() {
  252. },
  253. mounted(){
  254. this.classifyList();
  255. this.getDicts("chemical_shape").then(response => {
  256. this.optionsList = response.data;
  257. })
  258. this.getDicts("hxp_classifyattribute").then(response => {
  259. this.optionsListTwo = response.data;
  260. })
  261. this.hxpapplyAudit();
  262. },
  263. methods: {
  264. //同意审批
  265. agreeButton(){
  266. let self = this;
  267. let list = [];
  268. for(let i=0;i<self.dataInfo.actHxpapplyDetailList.length;i++){
  269. if(self.dataInfo.actHxpapplyDetailList[i].checkType){
  270. let obj = {
  271. // cabinetId:self.dataInfo.actHxpapplyDetailList[i].cabinetId,
  272. // chemicalId:self.dataInfo.actHxpapplyDetailList[i].chemicalId,
  273. id:self.dataInfo.actHxpapplyDetailList[i].id,
  274. remainingStorage:self.dataInfo.actHxpapplyDetailList[i].remainingStorage
  275. };
  276. list.push(obj);
  277. }
  278. }
  279. if(!list[0]){
  280. this.msgError('请选择通过审批的化学品')
  281. return
  282. }
  283. self.$confirm(`是否确认审批通过?`, "提示", {
  284. confirmButtonText: "确定",
  285. cancelButtonText: "取消",
  286. type: "warning"
  287. }).then(async () => {
  288. let obj = {
  289. taskId:self.dataInfo.id,
  290. actHxpapplyDetailList:list,
  291. };
  292. approvalTask(obj).then(response => {
  293. this.msgSuccess(response.msg);
  294. this.backPage(1);
  295. });
  296. }).catch(() => {})
  297. },
  298. //拒绝审批
  299. rejectButton(){
  300. this.approvalTextType = !this.approvalTextType;
  301. },
  302. rejectDialogButton(){
  303. let self = this;
  304. // self.$confirm(`是否确认拒绝通过?`, "提示", {
  305. // confirmButtonText: "确定",
  306. // cancelButtonText: "取消",
  307. // type: "warning"
  308. // }).then(async () => {
  309. // let obj = {
  310. // taskId:self.dataInfo.id,
  311. // refuseContent:self.refuseContent,
  312. // };
  313. // approvalRefuse(obj).then(response => {
  314. // this.msgSuccess(response.msg);
  315. // this.backPage(1);
  316. // });
  317. // }).catch(() => {})
  318. let obj = {
  319. taskId:self.dataInfo.id,
  320. refuseContent:self.refuseContent,
  321. };
  322. approvalRefuse(obj).then(response => {
  323. this.msgSuccess(response.msg);
  324. this.backPage(1);
  325. });
  326. },
  327. //获取审批详情
  328. hxpapplyAudit(){
  329. let userId = localStorage.getItem('userId')
  330. if(this.approvalPagePropsData.type == 1){
  331. hxpapplyAudit(this.approvalPagePropsData.id).then(response => {
  332. //处理添加勾选状态
  333. for(let i=0;i<response.data.actHxpapplyDetailList.length;i++){
  334. response.data.actHxpapplyDetailList[i].checkType = false;
  335. }
  336. for(let i=0;i<response.data.configInfoList.length;i++){
  337. if(response.data.configInfoList[i].auditType == 1){
  338. //依次审批
  339. for(let o=0;o<response.data.configInfoList[i].actApplytaskNodeList.length;o++){
  340. if(response.data.configInfoList[i].applyTaskStatus == 0){
  341. if(response.data.actApplytask.nowStep == response.data.configInfoList[i].actApplytaskNodeList[o].id){
  342. //进行中
  343. if(response.data.configInfoList[i].actApplytaskNodeList[o].nodeStatus == 0){
  344. if(userId == response.data.configInfoList[i].actApplytaskNodeList[o].id){
  345. response.data.configInfoList[i].approvalName = '我(审批中)'
  346. break
  347. }else{
  348. response.data.configInfoList[i].approvalName = response.data.configInfoList[i].actApplytaskNodeList[o].applyUserList[0].name+'(审批中)'
  349. break
  350. }
  351. }
  352. }else{
  353. //未进行的
  354. if(response.data.configInfoList[i].actApplytaskNodeList[o].nodeStatus == 0){
  355. if(userId == response.data.configInfoList[i].actApplytaskNodeList[o].id){
  356. response.data.configInfoList[i].approvalName = '我(审批人)'
  357. break
  358. }else{
  359. response.data.configInfoList[i].approvalName = response.data.configInfoList[i].actApplytaskNodeList[o].applyUserList[0].name+'(审批人)'
  360. break
  361. }
  362. }
  363. }
  364. }else if(response.data.configInfoList[i].applyTaskStatus == 1){
  365. if(response.data.configInfoList[i].actApplytaskNodeList[1]){
  366. response.data.configInfoList[i].approvalName = '已通过'
  367. break
  368. }else{
  369. response.data.configInfoList[i].approvalName = response.data.configInfoList[i].actApplytaskNodeList[o].applyUserList[0].name+'(已通过)'
  370. break
  371. }
  372. }else if(response.data.configInfoList[i].applyTaskStatus == 2){
  373. if(userId == response.data.configInfoList[i].actApplytaskNodeList[o].applyUserList[0].id){
  374. response.data.configInfoList[i].approvalName = '我(已拒绝)'
  375. break
  376. }else{
  377. response.data.configInfoList[i].approvalName = response.data.configInfoList[i].actApplytaskNodeList[o].applyUserList[0].name+'(已拒绝)'
  378. break
  379. }
  380. }
  381. }
  382. }else if(response.data.configInfoList[i].auditType == 2){
  383. //或签审批
  384. for(let o=0;o<response.data.configInfoList[i].actApplytaskNodeList.length;o++) {
  385. let minNum = 0;
  386. for(let x=0;x<response.data.configInfoList[i].actApplytaskNodeList[o].applyUserList.length;x++){
  387. if(userId == response.data.configInfoList[i].actApplytaskNodeList[o].applyUserList[x].id){
  388. minNum++
  389. }
  390. }
  391. if(minNum == 0){
  392. //没自己
  393. if(response.data.configInfoList[i].applyTaskStatus == 0){
  394. //未审批
  395. if(response.data.actApplytask.nowStep == response.data.configInfoList[i].actApplytaskNodeList[o].id){
  396. response.data.configInfoList[i].approvalName = "审批中";
  397. }else{
  398. response.data.configInfoList[i].approvalName = "待审批";
  399. }
  400. }else if(response.data.configInfoList[i].applyTaskStatus == 1){
  401. //已通过
  402. response.data.configInfoList[i].approvalName = "已通过";
  403. }else if(response.data.configInfoList[i].applyTaskStatus == 2){
  404. //已拒绝
  405. response.data.configInfoList[i].approvalName = "已拒绝";
  406. }
  407. }else{
  408. //有自己
  409. if(response.data.configInfoList[i].applyTaskStatus == 0){
  410. //未审批
  411. if(response.data.actApplytask.nowStep == response.data.configInfoList[i].actApplytaskNodeList[o].id){
  412. response.data.configInfoList[i].approvalName = "我(审批中)";
  413. }else{
  414. response.data.configInfoList[i].approvalName = "我(审批人)";
  415. }
  416. }else if(response.data.configInfoList[i].applyTaskStatus == 1){
  417. //已通过
  418. response.data.configInfoList[i].approvalName = "我(已通过)";
  419. }else if(response.data.configInfoList[i].applyTaskStatus == 2){
  420. //已拒绝
  421. response.data.configInfoList[i].approvalName = "我(已拒绝)";
  422. }
  423. }
  424. }
  425. }
  426. }
  427. let type = true;
  428. let configInfoList = [];
  429. for(let i=0;i<response.data.configInfoList.length;i++){
  430. if(type){
  431. configInfoList.push(response.data.configInfoList[i]);
  432. }
  433. if(response.data.configInfoList[i].applyTaskStatus == 2){
  434. type = false;
  435. }
  436. }
  437. this.$set(response.data,'configInfoList',configInfoList);
  438. this.$set(this,'dataInfo',response.data);
  439. this.$set(this,'pageType',1);
  440. });
  441. }else if(this.approvalPagePropsData.type == 2){
  442. getHxpapply(this.approvalPagePropsData.id).then(response => {
  443. //处理添加勾选状态
  444. for(let i=0;i<response.data.actHxpapplyDetailList.length;i++){
  445. if(response.data.actHxpapplyDetailList[i].tickStatus == 1){
  446. response.data.actHxpapplyDetailList[i].checkType = true;
  447. }else{
  448. response.data.actHxpapplyDetailList[i].checkType = false;
  449. }
  450. }
  451. for(let i=0;i<response.data.configInfoList.length;i++){
  452. if(response.data.configInfoList[i].auditType == 1){
  453. //依次审批
  454. for(let o=0;o<response.data.configInfoList[i].actApplytaskNodeList.length;o++){
  455. if(response.data.configInfoList[i].applyTaskStatus == 0){
  456. if(response.data.actApplytask.nowStep == response.data.configInfoList[i].actApplytaskNodeList[o].id){
  457. //进行中
  458. if(response.data.configInfoList[i].actApplytaskNodeList[o].nodeStatus == 0){
  459. if(userId == response.data.configInfoList[i].actApplytaskNodeList[o].id){
  460. response.data.configInfoList[i].approvalName = '我(审批中)'
  461. break
  462. }else{
  463. response.data.configInfoList[i].approvalName = response.data.configInfoList[i].actApplytaskNodeList[o].applyUserList[0].name+'(审批中)'
  464. break
  465. }
  466. }
  467. }else{
  468. //未进行的
  469. if(response.data.configInfoList[i].actApplytaskNodeList[o].nodeStatus == 0){
  470. if(userId == response.data.configInfoList[i].actApplytaskNodeList[o].id){
  471. response.data.configInfoList[i].approvalName = '我(审批人)'
  472. break
  473. }else{
  474. response.data.configInfoList[i].approvalName = response.data.configInfoList[i].actApplytaskNodeList[o].applyUserList[0].name+'(审批人)'
  475. break
  476. }
  477. }
  478. }
  479. }else if(response.data.configInfoList[i].applyTaskStatus == 1){
  480. if(response.data.configInfoList[i].actApplytaskNodeList[1]){
  481. response.data.configInfoList[i].approvalName = '已通过'
  482. break
  483. }else{
  484. response.data.configInfoList[i].approvalName = response.data.configInfoList[i].actApplytaskNodeList[o].applyUserList[0].name+'(已通过)'
  485. break
  486. }
  487. }else if(response.data.configInfoList[i].applyTaskStatus == 2){
  488. this.refuseContentText = response.data.configInfoList[i].refuseContent;
  489. if(userId == response.data.configInfoList[i].actApplytaskNodeList[o].applyUserList[0].id){
  490. response.data.configInfoList[i].approvalName = '我(已拒绝)'
  491. break
  492. }else{
  493. response.data.configInfoList[i].approvalName = response.data.configInfoList[i].actApplytaskNodeList[o].applyUserList[0].name+'(已拒绝)'
  494. break
  495. }
  496. }
  497. }
  498. }else if(response.data.configInfoList[i].auditType == 2){
  499. //或签审批
  500. for(let o=0;o<response.data.configInfoList[i].actApplytaskNodeList.length;o++) {
  501. let minNum = 0;
  502. for(let x=0;x<response.data.configInfoList[i].actApplytaskNodeList[o].applyUserList.length;x++){
  503. if(userId == response.data.configInfoList[i].actApplytaskNodeList[o].applyUserList[x].id){
  504. minNum++
  505. }
  506. }
  507. if(minNum == 0){
  508. //没自己
  509. if(response.data.configInfoList[i].applyTaskStatus == 0){
  510. //未审批
  511. if(response.data.actApplytask.nowStep == response.data.configInfoList[i].actApplytaskNodeList[o].id){
  512. response.data.configInfoList[i].approvalName = "审批中";
  513. }else{
  514. response.data.configInfoList[i].approvalName = "待审批";
  515. }
  516. }else if(response.data.configInfoList[i].applyTaskStatus == 1){
  517. //已通过
  518. response.data.configInfoList[i].approvalName = "已通过";
  519. }else if(response.data.configInfoList[i].applyTaskStatus == 2){
  520. //已拒绝
  521. this.refuseContentText = response.data.configInfoList[i].refuseContent;
  522. response.data.configInfoList[i].approvalName = "已拒绝";
  523. }
  524. }else{
  525. //有自己
  526. if(response.data.configInfoList[i].applyTaskStatus == 0){
  527. //未审批
  528. if(response.data.actApplytask.nowStep == response.data.configInfoList[i].actApplytaskNodeList[o].id){
  529. response.data.configInfoList[i].approvalName = "我(审批中)";
  530. }else{
  531. response.data.configInfoList[i].approvalName = "我(审批人)";
  532. }
  533. }else if(response.data.configInfoList[i].applyTaskStatus == 1){
  534. //已通过
  535. response.data.configInfoList[i].approvalName = "我(已通过)";
  536. }else if(response.data.configInfoList[i].applyTaskStatus == 2){
  537. //已拒绝
  538. this.refuseContentText = response.data.configInfoList[i].refuseContent;
  539. response.data.configInfoList[i].approvalName = "我(已拒绝)";
  540. }
  541. }
  542. }
  543. }
  544. }
  545. let type = true;
  546. let configInfoList = [];
  547. for(let i=0;i<response.data.configInfoList.length;i++){
  548. if(type){
  549. configInfoList.push(response.data.configInfoList[i]);
  550. }
  551. if(response.data.configInfoList[i].applyTaskStatus == 2){
  552. type = false;
  553. }
  554. }
  555. this.$set(response.data,'configInfoList',configInfoList);
  556. this.$set(this,'dataInfo',response.data);
  557. this.$set(this,'pageType',1);
  558. });
  559. }
  560. },
  561. //返回
  562. backPage(type){
  563. if(type == 0){
  564. this.$parent.pageToggle(0);
  565. }else if(type == 1){
  566. this.$parent.pageToggle(1);
  567. }
  568. },
  569. goEditPage(){
  570. let obj = {
  571. id:this.approvalPagePropsData.id
  572. }
  573. this.$parent.pageToggle(5,obj);
  574. },
  575. //勾选处理
  576. checkClick(item){
  577. let self = this;
  578. if(self.approvalPagePropsData.type != 1){
  579. return
  580. }
  581. item.checkType = !item.checkType;
  582. let num = 0;
  583. for(let i=0;i<self.dataInfo.actHxpapplyDetailList.length;i++){
  584. if(self.dataInfo.actHxpapplyDetailList[i].checkType){
  585. num++
  586. }
  587. }
  588. this.allCheckType = num == self.dataInfo.actHxpapplyDetailList.length;
  589. },
  590. //全选
  591. allCheckClick(){
  592. let self = this;
  593. if(self.approvalPagePropsData.type != 1){
  594. return
  595. }
  596. if(this.allCheckType){
  597. this.allCheckType = false;
  598. for(let i=0;i<self.dataInfo.actHxpapplyDetailList.length;i++){
  599. self.dataInfo.actHxpapplyDetailList[i].checkType = false;
  600. }
  601. }else{
  602. this.allCheckType = true;
  603. for(let i=0;i<self.dataInfo.actHxpapplyDetailList.length;i++){
  604. self.dataInfo.actHxpapplyDetailList[i].checkType = true;
  605. }
  606. }
  607. },
  608. //化学品详情
  609. getHxpChemicalInfo(id){
  610. let self = this;
  611. getHxpChemicalInfo(id).then(response => {
  612. //化学品形态
  613. for(let i=0;i<self.optionsList.length;i++){
  614. if(response.data.chemicalShape == self.optionsList[i].dictValue){
  615. this.$set(response.data,'chemicalShape',self.optionsList[i].dictLabel);
  616. }
  617. }
  618. //化学品分类列表
  619. for(let i=0;i<self.optionsListOne.length;i++){
  620. if(response.data.chemicalClassify == self.optionsListOne[i].id){
  621. this.$set(response.data,'chemicalClassify',self.optionsListOne[i].classifyName);
  622. }
  623. }
  624. //属性列表
  625. let list = response.data.classifyAttribute.split(',');
  626. console.log("list",list);
  627. let newText = '';
  628. for(let o=0;o<list.length;o++){
  629. for(let i=0;i<self.optionsListTwo.length;i++){
  630. if(list[o] == self.optionsList[i].dictValue){
  631. if(o == 0){
  632. newText = self.optionsList[i].dictLabel
  633. }else{
  634. newText = newText + ',' +self.optionsList[i].dictLabel
  635. }
  636. }
  637. }
  638. }
  639. this.$set(response.data,'classifyAttribute',newText);
  640. this.infoDialogData = response.data;
  641. this.infoDialogType = true;
  642. });
  643. },
  644. getHxpChemicalInfoOff(){
  645. this.infoDialogType = false;
  646. },
  647. //获取化学品分类列表
  648. classifyList(){
  649. classifyList().then(response => {
  650. this.optionsListOne = response.rows;
  651. });
  652. },
  653. pageToggle(type,item){
  654. if(type == 1){
  655. this.pageType = 1;
  656. }else if(type == 2){
  657. let obj = {
  658. cabinetName:item.chemicalName,
  659. posi:item.posi,
  660. safeUserName:item.safeUserNames,
  661. id:item.cabinetId,
  662. };
  663. this.$set(this,'listPropsData',obj);
  664. this.pageType = 2;
  665. }
  666. }
  667. }
  668. }
  669. </script>
  670. <style scoped lang="scss">
  671. .approvalPage{
  672. flex:1;
  673. display: flex;
  674. flex-direction: column;
  675. overflow: hidden;
  676. font-weight: 500;
  677. p{
  678. margin:0;
  679. padding:0;
  680. }
  681. .approvalPage-min{
  682. flex:1;
  683. display: flex;
  684. flex-direction: column;
  685. overflow: hidden;
  686. .title-box{
  687. display: flex;
  688. height:90px;
  689. border-bottom: 1px solid #D8D8D8;
  690. p:nth-child(1){
  691. flex:1;
  692. font-size:16px;
  693. line-height:90px;
  694. margin-left:18px;
  695. color:#0045AF;
  696. }
  697. .button-p{
  698. margin:25px 25px 0 0;
  699. }
  700. }
  701. .page-max-box{
  702. flex:1;
  703. display: flex;
  704. flex-direction: column;
  705. padding:20px 80px;
  706. .text-box-one{
  707. display: flex;
  708. margin-bottom:10px;
  709. font-size:16px;
  710. p{
  711. color:#333;
  712. line-height:50px;
  713. }
  714. p:nth-child(1){
  715. width:85px;
  716. text-align: right;
  717. }
  718. p:nth-child(2){
  719. width:205px;
  720. padding-left:10px;
  721. }
  722. p:nth-child(3){
  723. flex:1;
  724. }
  725. p:nth-child(4){
  726. }
  727. .colorA{
  728. color:#FF8C00;
  729. }
  730. .colorB{
  731. color:#25C402;
  732. }
  733. .colorC{
  734. color:#FA5151;
  735. }
  736. .colorD{
  737. color:#666666;
  738. }
  739. }
  740. .text-box-two{
  741. display: flex;
  742. margin-bottom:10px;
  743. font-size:16px;
  744. p{
  745. color:#333;
  746. line-height:50px;
  747. }
  748. p:nth-child(1){
  749. width:85px;
  750. text-align: right;
  751. }
  752. p:nth-child(2){
  753. padding-left:10px;
  754. flex:1;
  755. background: #F5F5F5;
  756. border-radius:4px;
  757. }
  758. }
  759. .text-box-three{
  760. display: flex;
  761. font-size:14px;
  762. p:nth-child(1){
  763. font-size:14px;
  764. width:14px;
  765. height:14px;
  766. margin:14px 11px 14px 14px;
  767. text-align: center;
  768. color:#ffb400;
  769. border-radius:50%;
  770. }
  771. p:nth-child(2){
  772. flex:1;
  773. line-height:42px;
  774. }
  775. }
  776. .table-title-box-one{
  777. display: flex;
  778. background: #f5f5f5;
  779. margin-bottom:10px;
  780. .cursor-img{
  781. cursor: pointer;
  782. }
  783. p:nth-child(1){
  784. width:16px;
  785. height:16px;
  786. margin:17px 17px 0 29px;
  787. }
  788. p{
  789. line-height: 50px;
  790. font-size:16px;
  791. }
  792. p:nth-child(2){
  793. width:130px;
  794. }
  795. p:nth-child(3){
  796. width:184px;
  797. }
  798. p:nth-child(4){
  799. width:299px;
  800. }
  801. p:nth-child(5){
  802. width:288px;
  803. }
  804. p:nth-child(6){
  805. flex:1;
  806. }
  807. p:nth-child(7){
  808. width:145px;
  809. }
  810. }
  811. .table-list-box-one{
  812. display: flex;
  813. .cursor-img{
  814. cursor: pointer;
  815. }
  816. img:nth-child(1){
  817. width:16px;
  818. height:16px;
  819. margin:13px 17px 0 29px;
  820. }
  821. p{
  822. line-height: 42px;
  823. font-size:14px;
  824. }
  825. p:nth-child(2){
  826. width:130px;
  827. }
  828. p:nth-child(3){
  829. width:184px;
  830. padding-right:20px;
  831. display:block;
  832. overflow:hidden;
  833. text-overflow:ellipsis;
  834. white-space:nowrap;
  835. }
  836. p:nth-child(4){
  837. width:299px;
  838. padding-right:20px;
  839. display:block;
  840. overflow:hidden;
  841. text-overflow:ellipsis;
  842. white-space:nowrap;
  843. }
  844. p:nth-child(5){
  845. width:288px;
  846. padding-right:20px;
  847. display:block;
  848. overflow:hidden;
  849. text-overflow:ellipsis;
  850. white-space:nowrap;
  851. }
  852. p:nth-child(6){
  853. flex:1;
  854. }
  855. p:nth-child(7){
  856. width:145px;
  857. color: #0045AF;
  858. }
  859. }
  860. .table-title-box-two{
  861. display: flex;
  862. background: #f5f5f5;
  863. margin-bottom:10px;
  864. .cursor-img{
  865. cursor: pointer;
  866. }
  867. img:nth-child(1){
  868. width:16px;
  869. height:16px;
  870. margin:17px 17px 0 18px;
  871. }
  872. p{
  873. line-height: 50px;
  874. font-size:16px;
  875. }
  876. p:nth-child(2){
  877. width:72px;
  878. }
  879. p:nth-child(3){
  880. width:113px;
  881. }
  882. p:nth-child(4){
  883. width:121px;
  884. }
  885. p:nth-child(5){
  886. width:165px;
  887. }
  888. p:nth-child(6){
  889. width:121px;
  890. }
  891. p:nth-child(7){
  892. width:136px;
  893. }
  894. p:nth-child(8){
  895. width:132px;
  896. }
  897. p:nth-child(9){
  898. width:169px;
  899. }
  900. p:nth-child(10){
  901. flex:1;
  902. }
  903. p:nth-child(11){
  904. width:145px;
  905. margin-left:55px;
  906. }
  907. }
  908. .table-list-box-two{
  909. display: flex;
  910. .cursor-img{
  911. cursor: pointer;
  912. }
  913. img:nth-child(1){
  914. width:16px;
  915. height:16px;
  916. margin:17px 17px 0 18px;
  917. }
  918. p{
  919. line-height: 50px;
  920. font-size:14px;
  921. }
  922. p:nth-child(2){
  923. width:72px;
  924. }
  925. p:nth-child(3){
  926. width:113px;
  927. padding-right:20px;
  928. display:block;
  929. overflow:hidden;
  930. text-overflow:ellipsis;
  931. white-space:nowrap;
  932. }
  933. p:nth-child(4){
  934. width:121px;
  935. padding-right:20px;
  936. display:block;
  937. overflow:hidden;
  938. text-overflow:ellipsis;
  939. white-space:nowrap;
  940. }
  941. p:nth-child(5){
  942. width:165px;
  943. padding-right:20px;
  944. display:block;
  945. overflow:hidden;
  946. text-overflow:ellipsis;
  947. white-space:nowrap;
  948. }
  949. p:nth-child(6){
  950. width:121px;
  951. }
  952. p:nth-child(7){
  953. width:136px;
  954. }
  955. p:nth-child(8){
  956. width:132px;
  957. }
  958. p:nth-child(9){
  959. width:169px;
  960. }
  961. p:nth-child(10){
  962. flex:1;
  963. }
  964. p:nth-child(11){
  965. width:80px;
  966. height:28px;
  967. line-height:28px;
  968. margin-right:14px;
  969. color:#0045af;
  970. border:1px solid #0045af;
  971. border-radius:4px;
  972. text-align: center;
  973. margin-top:11px;
  974. cursor: pointer;
  975. }
  976. p:nth-child(12){
  977. width:100px;
  978. height:28px;
  979. line-height:28px;
  980. margin-right:14px;
  981. color:#0045af;
  982. border:1px solid #0045af;
  983. border-radius:4px;
  984. text-align: center;
  985. margin-top:11px;
  986. cursor: pointer;
  987. }
  988. }
  989. .approval-title-p{
  990. font-size:16px;
  991. background: #f5f5f5;
  992. line-height: 50px;
  993. margin-bottom:23px;
  994. padding-left:20px;
  995. margin-top:10px;
  996. }
  997. .approval-list-max-box{
  998. .approval-for-box{
  999. .approval-for-box-min{
  1000. display: flex;
  1001. .left-max-box{
  1002. display: flex;
  1003. flex-direction: column;
  1004. width:219px;
  1005. position: relative;
  1006. .left-top-box{
  1007. display: flex;
  1008. img{
  1009. width:60px;
  1010. height:60px;
  1011. border-radius:4px;
  1012. margin-right:30px;
  1013. }
  1014. .left-top-text-box{
  1015. p{
  1016. line-height:30px;
  1017. font-size:14px;
  1018. color:#333;
  1019. }
  1020. }
  1021. }
  1022. .left-bottom-p{
  1023. width:2px;
  1024. flex:1;
  1025. background: #e0e0e0;
  1026. margin-left:29px;
  1027. }
  1028. .left-position-img{
  1029. width:20px;
  1030. height:20px;
  1031. position: absolute;
  1032. top:50px;
  1033. left:50px;
  1034. }
  1035. }
  1036. .right-max-box{
  1037. flex:1;
  1038. min-height:80px;
  1039. border:1px solid #e0e0e0;
  1040. margin-bottom:27px;
  1041. padding:19px 14px 0;
  1042. .right-for-name-box{
  1043. display: inline-block;
  1044. margin-bottom:17px;
  1045. .right-for-name-box-min{
  1046. display: flex;
  1047. position: relative;
  1048. img:nth-child(1){
  1049. width:40px;
  1050. height:40px;
  1051. border-radius:4px;
  1052. margin-right:8px;
  1053. }
  1054. p:nth-child(2){
  1055. line-height:44px;
  1056. font-size:14px;
  1057. }
  1058. .right-min-img{
  1059. width:12px;
  1060. height:10px;
  1061. margin:16px 17px 0 13px;
  1062. }
  1063. .position-min-img{
  1064. width:20px;
  1065. height:20px;
  1066. position: absolute;
  1067. top:30px;
  1068. left:30px;
  1069. }
  1070. }
  1071. }
  1072. }
  1073. .right-max-box-border-none{
  1074. border:none;
  1075. }
  1076. .right-max-end{
  1077. margin-bottom:0;
  1078. }
  1079. .right-right-time-p{
  1080. font-size:14px;
  1081. color: #666666;
  1082. width:160px;
  1083. text-align: right;
  1084. padding-top:10px;
  1085. }
  1086. }
  1087. }
  1088. .approval-for-min-p{
  1089. margin:20px 95px;
  1090. font-size:14px;
  1091. line-height:20px;
  1092. color:#666666;
  1093. background: #F5F5F5;
  1094. padding:10px 35px;
  1095. word-wrap:break-word;
  1096. word-break:break-all;
  1097. overflow: hidden;
  1098. }
  1099. }
  1100. .bottom-button-box{
  1101. display: flex;
  1102. width:217px;
  1103. margin:30px auto;
  1104. p{
  1105. width:100px;
  1106. }
  1107. p:nth-child(1){
  1108. margin-right:17px;
  1109. }
  1110. }
  1111. }
  1112. }
  1113. }
  1114. </style>
  1115. <style lang="scss">
  1116. .approvalPage-info-dialog-box{
  1117. p{
  1118. margin:0;
  1119. }
  1120. .approvalPage-info-dialog-text-big-box{
  1121. display: flex;
  1122. .approvalPage-info-dialog-box-text-box:nth-child(1){
  1123. margin-right:100px;
  1124. margin-left:20px;
  1125. }
  1126. .approvalPage-info-dialog-box-text-box{
  1127. width:357px;
  1128. display: flex;
  1129. p{
  1130. line-height:50px;
  1131. color:#333;
  1132. font-size:16px;
  1133. }
  1134. p:nth-child(1){
  1135. width:80px;
  1136. text-align: right;
  1137. }
  1138. p:nth-child(2){
  1139. flex:1;
  1140. text-align: right;
  1141. }
  1142. }
  1143. }
  1144. .el-dialog__footer{
  1145. text-align:center;
  1146. }
  1147. }
  1148. </style>