platForm.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. <template>
  2. <div class="workBench">
  3. <div class="topBody">
  4. <p class="breadcrumb">工作台</p>
  5. <div class="bottom">
  6. <div class="touxiang">
  7. <img src="@/assets/touxiang.png" alt="">
  8. </div>
  9. <div class='tip'>
  10. <p class="greet">{{getTimeState()}},{{roleInfo.realname}},祝你开心每一天!</p>
  11. <p class="descPosition">
  12. <span>{{roleInfo.roleName}}</span>
  13. <a-divider type="vertical" />
  14. <span>{{roleInfo.area}}地区-{{roleInfo.departName}}</span>
  15. </p>
  16. </div>
  17. </div>
  18. </div>
  19. <div class="section">
  20. <div class="sectionBody">
  21. <div class="sectionLeftBox">
  22. <div class="leftTop">
  23. <div class="sectionHead">
  24. 我的工作内容
  25. </div>
  26. <div class="zhanshiBox">
  27. <div class="item" @click="goMaterialList(1)">
  28. <div class="title">
  29. <img src="@/assets/work.png" alt="" class="iconImg">
  30. <span>指派给我的物料</span>
  31. </div>
  32. <div class="itemBody">
  33. <p class="count">{{countInfo.myMaterial || 0}} <span>个</span></p>
  34. </div>
  35. </div>
  36. <div class="item" @click="goMaterialList(2)">
  37. <div class="title">
  38. <img src="@/assets/work.png" alt="" class="iconImg">
  39. <span>被驳回的物料</span>
  40. </div>
  41. <div class="itemBody">
  42. <p class="count">{{countInfo.rejectMaterial || 0}} <span>个</span></p>
  43. </div>
  44. </div>
  45. <div class="item" @click="goMaterialList(3)">
  46. <div class="title">
  47. <img src="@/assets/work.png" alt="" class="iconImg">
  48. <span>已完成的物料</span>
  49. </div>
  50. <div class="itemBody">
  51. <p class="count">{{countInfo.finishMaterial || 0}} <span>个</span></p>
  52. </div>
  53. </div>
  54. <div class="item" @click="goMaterialList(4)">
  55. <div class="title">
  56. <img src="@/assets/work.png" alt="" class="iconImg">
  57. <span>全部物料</span>
  58. </div>
  59. <div class="itemBody">
  60. <p class="count" >{{countInfo.allMaterial || 0}} <span>个</span></p>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="leftBottom">
  66. <div class="sectionHead">
  67. 订单进度
  68. <!-- <a-button type="link" class="allOrder" @click="goOrderList(4)">全部订单</a-button> -->
  69. </div>
  70. <a-spin :spinning="orderProgressSpinning">
  71. <div class="orderProgress">
  72. <ul class="orderProgress-list" v-if="orderProgressList.length>0">
  73. <li v-for="(item,index) in orderProgressList" :key="index" >
  74. <div style="display:flex;align-items: center;" class="orderProgress-list-item" @click="orderDetail(item)">
  75. <div style="display:flex;width:80%; align-items: center;" >
  76. <span class="item-icon"></span>
  77. <div class="content">
  78. <p class="name">{{item.orderTitle}}</p>
  79. <p class="desc">{{item.orderRemark}}</p>
  80. </div>
  81. </div>
  82. <div class="progress" v-if="item.orderStatus==1||item.orderStatus==3">
  83. <a-progress type="circle" :percent="(item.materialFinishAmount/item.materialAmount)*100" :width='30' :showInfo='false' :strokeWidth='10' />
  84. <span style="margin-left:15px">{{(item.materialFinishAmount/item.materialAmount)*100}}%</span>
  85. </div>
  86. <div class="progress" v-else>
  87. {{item.orderStatus|handleOrderStatus}}
  88. </div>
  89. </div>
  90. </li>
  91. </ul>
  92. <div v-else style="width:100%;height:585px;line-height:585px;text-align:center">
  93. <img src="@/assets/nodata.png" alt="" style="width:300px;text-align:center">
  94. </div>
  95. <!-- hideOnSinglePage -->
  96. <a-pagination size="small" :total="totalPage" :current='currentPage' :pageSize='8' class="fenye" @change='pageChange' show-quick-jumper hideOnSinglePage />
  97. </div>
  98. </a-spin>
  99. </div>
  100. </div>
  101. <div class="sectionRightBox">
  102. <div class="rightTop">
  103. <div class="sectionHead">
  104. 操作记录
  105. </div>
  106. <a-spin :spinning="spinning">
  107. <div class="optionRecordList">
  108. <a-timeline >
  109. <a-timeline-item color='#F0F2F5' style="height:46px" v-for="(item,index) in operateRecordList" :key="index">
  110. <p style="margin-bottom:0px">
  111. <span class="content-item">{{item.userName}}{{item.operate}}{{item.materialName||item.orderTitle}}</span>
  112. <span class="time">{{item.time}}</span>
  113. </p>
  114. </a-timeline-item>
  115. </a-timeline>
  116. </div>
  117. </a-spin>
  118. </div>
  119. <!-- <div class="rightBottom">
  120. <div class="sectionHead">
  121. 本周项目燃尽图
  122. </div>
  123. <div class="burnDown">
  124. <a-progress type="circle" :percent="75" :width='150' :strokeWidth='6' />
  125. <div class="tip">
  126. <p class="done">
  127. <span class="item-icon"></span>
  128. <span>已完成订单:{{}}个</span>
  129. </p>
  130. <p class="all">
  131. <span class="item-icon"></span>
  132. <span>未完成订单:{{}}个</span>
  133. </p>
  134. </div>
  135. </div>
  136. </div> -->
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </template>
  142. <script>
  143. import moment from 'moment';
  144. import { getAction, postAction, downFile, downFilePost } from '@/api/manage';
  145. export default {
  146. name:'design-platform',
  147. data() {
  148. return {
  149. spinning:false,
  150. moment,
  151. roleInfo:{},
  152. orderProgressSpinning:false,
  153. touxiang:'@/assets/touxiang.png',
  154. // 订单进度
  155. orderProgressList:[
  156. ],
  157. // 操作记录
  158. optionRecord:[],
  159. // 本周项目燃尽图
  160. burnDownChart:[],
  161. // 分页参数
  162. totalPage:0,
  163. currentPage:1,
  164. userInfo:{},
  165. roleCode:'',
  166. operateRecordList:[],
  167. TimerObj:null,
  168. countInfo:{},
  169. }
  170. },
  171. methods: {
  172. orderDetail(item){
  173. console.log(item)
  174. this.$parent.currentTabComponent='orderDetail';
  175. this.$parent.orderId=item.id
  176. },
  177. goOrderList(val){
  178. console.log(val);
  179. // console.log(this.$parent)
  180. this.$parent.currentTabComponent='orderList';
  181. this.$parent.orderStatus=val
  182. },
  183. goMaterialList(val){
  184. this.$parent.currentTabComponent='materialList';
  185. this.$parent.materialStatus=val
  186. },
  187. // 分页页码改变
  188. pageChange(page, pageSize){
  189. this.currentPage=page;
  190. // console.log(page,pageSize)
  191. this.getOrderList()
  192. },
  193. // 全部订单
  194. allOrder() {
  195. this.$router.push('/workBench/orderList')
  196. },
  197. // 发起订单
  198. sendOrder(){
  199. this.$router.push('/workBench/placeOrder')
  200. },
  201. // 获取订单列表
  202. getOrderList(){
  203. this.orderProgressSpinning=true;
  204. let params={
  205. design:this.userInfo.id,
  206. pageNo:this.currentPage,
  207. pageSize:8,
  208. }
  209. getAction('/platform/order/listByCreatorOrDesignLeader',params).then(res=>{
  210. console.log(res);
  211. this.loading=false;
  212. this.orderProgressSpinning=false;
  213. if(res.success){
  214. this.orderProgressList=res.result.list;
  215. this.totalPage=res.result.total;
  216. }
  217. })
  218. },
  219. // 操作记录
  220. getOperationRecord(){
  221. this.spinning=true;
  222. getAction('/platform/operateRecord/createDesc').then(res=>{
  223. console.log(res)
  224. this.spinning=false;
  225. if(res.success){
  226. this.operateRecordList=res.result.list.map((item,index)=>{
  227. let time='';
  228. let startTime=moment(item.createTime)
  229. console.log()
  230. if(moment().diff(startTime,'minutes')>60){
  231. time=item.createTime.split(/[ ]+/)[1]
  232. return {
  233. ...item,
  234. time,
  235. }
  236. }else if(moment().diff(startTime,'minutes')>=1){
  237. time=moment().diff(startTime,'minutes')+'分钟前'
  238. return {
  239. ...item,
  240. time,
  241. }
  242. }else if(moment().diff(startTime,'minutes')==0){
  243. time=moment().diff(startTime,'seconds')+'秒前'
  244. return {
  245. ...item,
  246. time,
  247. }
  248. }
  249. });
  250. }
  251. })
  252. },
  253. scrollRecord(){
  254. console.log(this.$refs.scrollRecord);
  255. this.TimerObj=setInterval(()=>{
  256. this.getOperationRecord()
  257. },60000)
  258. },
  259. // 获取工作台内容
  260. getPlantformInfo(){
  261. getAction('/platform/query/jobContent').then(res=>{
  262. console.log(res)
  263. if(res.success){
  264. if(this.$parent.role=='operator'){
  265. this.countInfo=res.result.operatorJobContent
  266. }else if(this.$parent.role=='design'){
  267. this.countInfo=res.result.designJobContent
  268. }else if(this.$parent.role=='designLeader'){
  269. this.countInfo=res.result.designLeaderJobContent
  270. }
  271. }
  272. })
  273. },
  274. getTimeState () {
  275. // 获取当前时间
  276. let timeNow = new Date();
  277. // 获取当前小时
  278. let hours = timeNow.getHours();
  279. // 设置默认文字
  280. let text = ``;
  281. // 判断当前时间段
  282. if (hours >= 0 && hours <= 5) {
  283. text = `凌晨好`;
  284. }else if(hours >= 6 && hours <= 9){
  285. text = `早上好`;
  286. } else if(hours > 9 && hours <= 12){
  287. text = `上午好`;
  288. }else if (hours > 12 && hours <= 14) {
  289. text = `中午好`;
  290. } else if (hours > 14 && hours <= 18) {
  291. text = `下午好`;
  292. } else if (hours > 18 && hours <= 24) {
  293. text = `晚上好`;
  294. }
  295. // 返回当前时间段对应的状态
  296. return text
  297. },
  298. getidentity(){
  299. getAction('/platform/query/identity',{}).then(res=>{
  300. console.log(res);
  301. if(res.success){
  302. this.roleInfo=res.result
  303. }
  304. })
  305. }
  306. },
  307. mounted(){
  308. let userInfo=localStorage.getItem('pro__Login_Userinfo');
  309. if(userInfo){
  310. this.userInfo=JSON.parse(userInfo).value
  311. }
  312. this.roleCode=localStorage.getItem('roleCode')
  313. this.getOrderList()
  314. this.getOperationRecord()
  315. this.scrollRecord()
  316. this.getPlantformInfo()
  317. this.getidentity()
  318. },
  319. activated(){
  320. let userInfo=localStorage.getItem('pro__Login_Userinfo');
  321. if(userInfo){
  322. this.userInfo=JSON.parse(userInfo).value
  323. }
  324. this.roleCode=localStorage.getItem('roleCode')
  325. this.getOrderList()
  326. this.getOperationRecord()
  327. this.getPlantformInfo()
  328. this.getidentity()
  329. },
  330. beforeDestroy(){
  331. clearInterval(this.TimerObj)
  332. },
  333. filters:{
  334. handleOrderStatus(val){
  335. let text
  336. switch (val) {
  337. case 0:
  338. text='待接单'
  339. break;
  340. case 1:
  341. text='制作中'
  342. break;
  343. case 2:
  344. text='已驳回'
  345. break;
  346. case 3:
  347. text='已完成'
  348. break;
  349. case -1:
  350. text='已撤回'
  351. break;
  352. default:
  353. text='出错'
  354. break;
  355. }
  356. return text
  357. }
  358. },
  359. }
  360. </script>
  361. <style lang="scss" scoped>
  362. .workBench{
  363. ul,li{
  364. margin: 0;
  365. padding: 0;
  366. }
  367. width: 100%;
  368. .topBody{
  369. width: 100%;
  370. height: 146px;
  371. background: #FFFFFF;
  372. margin-bottom: 12px;
  373. padding: 20px;
  374. box-sizing: border-box;
  375. .breadcrumb{
  376. width: 42px;
  377. height: 22px;
  378. font-size: 12px;
  379. font-family: PingFangSC-Regular, PingFang SC;
  380. font-weight: 400;
  381. color: #000000;
  382. line-height: 22px;
  383. }
  384. .bottom{
  385. display: flex;
  386. position: relative;
  387. // padding: 20px;
  388. .touxiang{
  389. width: 72px;
  390. height: 72px;
  391. margin-right: 20px;
  392. border-radius: 50%;
  393. overflow: hidden;
  394. img{
  395. width: 100%;
  396. height: 100%;
  397. border-radius: 50%;
  398. }
  399. }
  400. .tip{
  401. .greet{
  402. height: 28px;
  403. font-size: 20px;
  404. font-family: PingFangSC-Medium, PingFang SC;
  405. font-weight: 500;
  406. color: rgba(0, 0, 0, 0.85);
  407. line-height: 28px;
  408. }
  409. .descPosition{
  410. height: 22px;
  411. font-size: 14px;
  412. font-family: PingFangSC-Regular, PingFang SC;
  413. font-weight: 400;
  414. color: rgba(0, 0, 0, 0.45);
  415. line-height: 22px;
  416. }
  417. }
  418. .mybtn{
  419. position: absolute;
  420. // top: 50%;
  421. // margin-left: -18px;
  422. right: 0;
  423. }
  424. }
  425. }
  426. .section{
  427. .sectionBody{
  428. display: flex;
  429. .sectionHead{
  430. padding: 15px 20px;
  431. // height: 24px;
  432. font-size: 16px;
  433. font-family: PingFangSC-Medium, PingFang SC;
  434. font-weight: 500;
  435. color: rgba(0, 0, 0, 0.85);
  436. line-height: 24px;
  437. border-bottom: 1px solid #E9E9E9;;
  438. position: relative;
  439. .allOrder{
  440. position: absolute;
  441. right: 5px;
  442. }
  443. }
  444. .sectionLeftBox{
  445. width: 70%;
  446. .leftTop{
  447. overflow: hidden;
  448. background: white;
  449. }
  450. .zhanshiBox{
  451. display: flex;
  452. flex-wrap: wrap;
  453. .item{
  454. width: 33.33%;
  455. // background: brown;
  456. padding: 20px ;
  457. border-right: 1px solid #E9E9E9;
  458. border-bottom: 1px solid #E9E9E9;
  459. .title{
  460. padding-bottom: 34px;
  461. color: #000000;
  462. .iconImg{
  463. width: 24px;
  464. margin-right: 8px;
  465. }
  466. }
  467. .itemBody{
  468. text-align: center;
  469. .count{
  470. font-size: 24px;
  471. font-family: PingFangSC-Medium, PingFang SC;
  472. font-weight: 500;
  473. color: #000000;
  474. line-height: 32px;
  475. cursor: pointer;
  476. span{
  477. font-size: 16px;
  478. cursor: pointer;
  479. }
  480. }
  481. .count:hover{
  482. color: #1890FF;
  483. }
  484. }
  485. }
  486. .item:nth-child(3n){
  487. border-right: 0;
  488. }
  489. }
  490. .leftBottom{
  491. margin-top: 12px;
  492. background: white;
  493. .orderProgress{
  494. padding: 0 20px;
  495. height: 585px;
  496. position: relative;
  497. .orderProgress-list-item{
  498. padding: 10px 0;
  499. display: flex;
  500. align-items: center;
  501. border-bottom: 1px solid #E9E9E9;;
  502. justify-content:space-between;
  503. cursor: pointer;
  504. .item-icon{
  505. width: 8px;
  506. height: 8px;
  507. background: #3BA0FF;
  508. margin-right: 15px;
  509. display: inline-block;
  510. border-radius: 50%;
  511. }
  512. .content{
  513. width: 70%;
  514. overflow: hidden;
  515. font-size: 14px;
  516. font-family: PingFangSC-Regular, PingFang SC;
  517. font-weight: 400;
  518. .name{
  519. height: 22px;
  520. color: rgba(0, 0, 0, 0.65);
  521. line-height: 22px;
  522. text-overflow: ellipsis;
  523. white-space: nowrap;
  524. overflow: hidden;
  525. margin-bottom: 0px;
  526. }
  527. .desc{
  528. height: 22px;
  529. color: rgba(0, 0, 0, 0.25);
  530. line-height: 22px;
  531. text-overflow: ellipsis;
  532. white-space: nowrap;
  533. overflow: hidden;
  534. margin-bottom: 0px;
  535. }
  536. }
  537. .progress{
  538. float: right;
  539. }
  540. }
  541. .fenye{
  542. padding: 20px 0;
  543. text-align: right;
  544. position: absolute;
  545. right: 20;
  546. bottom: 0px;
  547. }
  548. }
  549. }
  550. }
  551. .sectionRightBox{
  552. width: 29.5%;
  553. background: white;
  554. margin-left: 12px;
  555. height: 1023px;
  556. .rightTop{
  557. .optionRecordList{
  558. margin: 20px;
  559. padding: 10px 0;
  560. box-sizing: border-box;
  561. height: 928px;
  562. // overflow: auto;
  563. overflow: hidden;
  564. p{
  565. width: 100%;
  566. }
  567. .content-item{
  568. width: 70%;
  569. display: inline-block;
  570. overflow: hidden;
  571. text-overflow: ellipsis;
  572. white-space: nowrap;
  573. }
  574. .time{
  575. width: 30%;
  576. display: inline-block;
  577. overflow: hidden;
  578. text-overflow: ellipsis;
  579. white-space: nowrap;
  580. text-align: right;
  581. }
  582. }
  583. }
  584. .rightBottom{
  585. margin-top: 12px;
  586. background: white;
  587. .burnDown{
  588. padding: 30px 20px;
  589. text-align: center;
  590. .tip{
  591. margin-top: 40px;
  592. display: flex;
  593. justify-content: space-around;
  594. height: 22px;
  595. font-size: 14px;
  596. font-family: PingFangSC-Regular, PingFang SC;
  597. font-weight: 400;
  598. color: rgba(0, 0, 0, 0.65);
  599. line-height: 22px;
  600. .done{
  601. .item-icon{
  602. width: 8px;
  603. height: 8px;
  604. background: #3BA0FF;
  605. margin-right: 15px;
  606. display: inline-block;
  607. border-radius: 50%;
  608. }
  609. }
  610. .all{
  611. .item-icon{
  612. width: 8px;
  613. height: 8px;
  614. background: #F0F2F5;
  615. margin-right: 15px;
  616. display: inline-block;
  617. border-radius: 50%;
  618. }
  619. }
  620. }
  621. }
  622. }
  623. }
  624. }
  625. }
  626. }
  627. </style>
  628. <style lang="less">
  629. .workBench{
  630. .ant-timeline-item-head{
  631. background: rgb(240,242,245);
  632. }
  633. }
  634. </style>