projectX.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. <template>
  2. <view class="content">
  3. <view class="param">
  4. <view class="proName">项目标题</view>
  5. <view class="prolittle">{{data.projectName}}</view>
  6. <view class="proMiao">项目描述</view>
  7. <view class="prolittle">{{data.projectContent}}</view>
  8. <view class="proMiao">附件</view>
  9. <view class="prolittle" v-for="(item,index) in fileList2">
  10. <view style="color: rgba(0, 97, 255, 1);" @click="navigateToTU(item.name)">{{item.name}}</view>
  11. </view>
  12. <!-- <view class="upload-img">
  13. <uni-file-picker limit="3"
  14. @select='selectUpload'
  15. :auto-upload='false'
  16. file-extname='pdf,docx,jpg,png,jpeg,doc,docm,dot,dotm,dotx,xlsx,xls,csv,xlsm,slxb,xlt,xltx'
  17. file-mediatype="all"
  18. @success='uploadSuccess'
  19. @fail='uploadFail'
  20. :list-styles='listStyles'
  21. v-model='fileList2'
  22. ></uni-file-picker>
  23. </view> -->
  24. <view class="proMiao">主办单位</view>
  25. <view class="prolittle">{{data.organize}}</view>
  26. <view class="proMiao">主办人</view>
  27. <view class="prolittle">{{data.sposonerName}}</view>
  28. <view class="proMiao">协办单位</view>
  29. <view class="prolittle">{{data.coOrganize}}</view>
  30. <view class="proMiao">协办人</view>
  31. <view class="prolittle">{{data.coSposonerName}}</view>
  32. <view class="proMiao">评分人</view>
  33. <view class="prolittle">{{data.scorerName}}</view>
  34. <view class="proMiao">项目级别</view>
  35. <view class="prolittle">{{data.projectLevel}}</view>
  36. <view class="proMiao">项目来源</view>
  37. <view class="prolittle">{{data.projectFrom}}</view>
  38. <view class="proMiao jindu">完成进度</view>
  39. <view class="weidu">维度权重{{weidu}}%</view>
  40. <view class="addRen" @click="addRen" v-if="crerenwu==1&& (select==5 || select==3)">新增任务</view>
  41. <!-- 任务列表 -->
  42. <view style="width: 100%;margin: 50rpx 0 0 20rpx;">
  43. <view class="renwu" v-for="(item,index) in renwu" :key="index" @click="clickRenwu(item)">
  44. <view>{{item.taskName}}</view>
  45. <view>{{item.createTime}}</view>
  46. <view v-if="item.finishTime!=null">{{item.finishRemark}}</view>
  47. <view v-if="gengrenwu==1">{{item.weight}}</view>
  48. <view v-if="item.state==1">已完成</view>
  49. <view style="color: rgba(0, 97, 255, 1);" @click.stop="updateJin(item)" v-if="gengrenwu==1&& (select==5 || select==3|| select==4)">更新进度</view>
  50. <view style="color: rgba(0, 97, 255, 1);" @click.stop="cuirenwu2(item)" v-if="cuirenwu==1">催办</view>
  51. <view style="display: flex;">
  52. <view class="renwu-bu bianji" v-if="item.finishTime==null&&uprenwu==1&& (select==5 || select==3)" @click.stop="bianjiRenwu(item)">编辑</view>
  53. <view class="renwu-bu delete" @click.stop="deleteRenwu(item)" v-if="delerenwu==1&& (select==5 || select==3)">删除</view>
  54. </view>
  55. </view>
  56. </view>
  57. <!-- <view style="width: 100%;margin: 50rpx 0 0 20rpx;">
  58. <view class="renwu" v-for="(item,index) in renwu" :key="index">
  59. <view>{{item.taskName}}</view>
  60. <view>{{item.createTime}}</view>
  61. <view>{{item.weight}}</view>
  62. <view>{{item.scoreLimit}}</view>
  63. <view style="color: rgba(0, 97, 255, 1);">更新进度</view>
  64. </view>
  65. </view> -->
  66. <view class="proMiao jindu" v-if="data.progress>0">进度详情</view>
  67. <!-- 进度 -->
  68. <view style="margin: 33rpx 0 0 19rpx;">
  69. <view v-for="(item,index) in rizhi" :key="index" class="jindu-kuang">
  70. <view style="display: flex;">
  71. <view class="jindu-circle"></view>
  72. <view>
  73. <view style="width: 600rpx;display: flex;justify-content: space-between;margin-top: 20rpx;">
  74. <view style="display: flex;">
  75. <view style="margin-left: 28rpx;">{{item.createName}}</view>
  76. <view class="jindu-type lixiang">{{item.content}}</view>
  77. </view>
  78. <!-- <view class="jindu-type cuiban">已催办</view>
  79. <view class="jindu-type tijiao">已提交</view> -->
  80. <view>{{item.createTime}}</view>
  81. </view>
  82. <view style="margin:7rpx 0 0 28rpx;">项目名:{{item.projectName}}</view>
  83. <!-- <view style="margin:7rpx 0 0 28rpx;">任务指派:xxx,xxx,xxx</view>
  84. <view style="margin:7rpx 0 0 28rpx;">任务指派:xxx,xxx,xxx</view>
  85. <view style="margin:7rpx 0 0 28rpx;">任务指派:xxx,xxx,xxx</view> -->
  86. </view>
  87. </view>
  88. <!-- <view class="jindu-line" v-if="index<(rizhi.length-1)"></view> -->
  89. </view>
  90. </view>
  91. <view style="width: 100%;height: 60rpx;"></view>
  92. </view>
  93. </view>
  94. </template>
  95. <script>
  96. export default {
  97. data() {
  98. return {
  99. data:{},
  100. fileList2: [],
  101. fileList22:'',
  102. listStyles: {
  103. "borderStyle": {
  104. "width": "0", // 边框宽度
  105. },
  106. "border": false, // 是否显示边框
  107. "dividline": false
  108. },
  109. renwu:[],
  110. rizhi:[],//日志
  111. weidu:'',
  112. crerenwu:1,//添加任务
  113. uprenwu:1,//修改任务
  114. delerenwu:1,//是否删除任务
  115. cuirenwu:1,//催办任务
  116. gengrenwu:1,//是否更新任务
  117. select:0,//状态
  118. }
  119. },
  120. onShow() {
  121. this.crerenwu=sessionStorage.getItem("crerenwu")
  122. this.uprenwu=sessionStorage.getItem("uprenwu")
  123. this.delerenwu=sessionStorage.getItem("delerenwu")
  124. this.cuirenwu=sessionStorage.getItem("cuirenwu")
  125. this.gengrenwu=sessionStorage.getItem("gengrenwu")
  126. },
  127. onLoad(option) {
  128. this.select=option.select
  129. console.log(JSON.parse(decodeURIComponent(option.data)))
  130. console.log(JSON.parse(decodeURIComponent(option.weidu)))
  131. var wei=JSON.parse(decodeURIComponent(option.weidu))
  132. this.data=JSON.parse(decodeURIComponent(option.data))
  133. this.weidu=(wei[2].configValue)
  134. var image=[]
  135. image=this.data.fileUrl.split(',')
  136. this.fileList2 =image.map(item =>{
  137. return {
  138. name: item
  139. }
  140. })
  141. this.fileList22=image.join(",")
  142. console.log(this.fileList2)
  143. this.getRenwu()
  144. this.getRizhi()
  145. },
  146. methods: {
  147. change(e) {
  148. console.log("e:", e);
  149. },
  150. //跳转页面
  151. navigateToTU(url) {
  152. window.location.href = url;
  153. },
  154. //新增任务
  155. addRen(){
  156. var shuzu=[
  157. {userName:'',department:'',id:''}
  158. ]
  159. var xieban=[]
  160. var xiebanpeo=[]
  161. var tt=[]
  162. var xiebanV=[]
  163. var a1=this.data.sposonerName+','+this.data.coSposonerName
  164. var a2=this.data.organize+','+this.data.coOrganize
  165. var a3=this.data.sposoner+','+this.data.coSposoner
  166. xieban=a1.split(',')
  167. xiebanpeo=a2.split(',')
  168. xiebanV=a3.split(',')
  169. shuzu=xieban.map(item =>{
  170. console.log(item)
  171. return {
  172. userName: item,
  173. }
  174. })
  175. shuzu.forEach((item,index) => {
  176. console.log(item);
  177. this.$set(item,"department",xiebanpeo[index])
  178. this.$set(item,"id",xiebanV[index])
  179. })
  180. let t2=JSON.stringify(shuzu)
  181. //这里———————————————————————————
  182. let query2 = encodeURIComponent(t2)
  183. uni.navigateTo({
  184. url:'/pages/project/addRenwu?proId='+this.data.id+'&people='+query2
  185. })
  186. },
  187. //编辑任务
  188. bianjiRenwu(item){
  189. var shuzu=[
  190. {userName:'',department:'',id:''}
  191. ]
  192. var xieban=[]
  193. var xiebanpeo=[]
  194. var tt=[]
  195. var xiebanV=[]
  196. var a1=this.data.sposonerName+','+this.data.coSposonerName
  197. var a2=this.data.organize+','+this.data.coOrganize
  198. var a3=this.data.sposoner+','+this.data.coSposoner
  199. xieban=a1.split(',')
  200. xiebanpeo=a2.split(',')
  201. xiebanV=a3.split(',')
  202. shuzu=xieban.map(item =>{
  203. console.log(item)
  204. return {
  205. userName: item,
  206. }
  207. })
  208. shuzu.forEach((item,index) => {
  209. console.log(item);
  210. this.$set(item,"department",xiebanpeo[index])
  211. this.$set(item,"id",xiebanV[index])
  212. })
  213. let t2=JSON.stringify(shuzu)
  214. //这里———————————————————————————
  215. let query2 = encodeURIComponent(t2)
  216. //传参对象,使用encodeURIComponent编码
  217. let str = JSON.stringify(item)
  218. //注意这里——————————————————————
  219. str = str.replace(/%/g, '%25')
  220. //这里———————————————————————————
  221. let query = encodeURIComponent(str)
  222. uni.navigateTo({
  223. url:'/pages/project/changeRenwu?data='+query+'&people='+query2
  224. })
  225. },
  226. //删除任务
  227. deleteRenwu(item){
  228. let that = this
  229. uni.showModal({
  230. title: '提示',
  231. content: '确定删除任务吗?',
  232. success: function(res) {
  233. if (res.confirm) {
  234. console.log('用户点击确定');
  235. uni.showLoading({
  236. title: '加载中',
  237. mask: true, // 是否显示透明蒙层,防止触摸穿透
  238. });
  239. let data={
  240. id:item.id,
  241. }
  242. that.$Request.postT('/api/sysTask/del',data).then(res => {
  243. if (res.code==200) {
  244. uni.showToast({
  245. title: '删除成功',
  246. icon: 'none',
  247. duration:800
  248. });
  249. uni.hideLoading()
  250. setTimeout(function() {
  251. that.getRenwu()
  252. }, 1000)
  253. } else {
  254. uni.hideLoading();
  255. uni.showToast({
  256. title: res.message,
  257. icon: 'none',
  258. duration:800
  259. });
  260. }
  261. });
  262. } else if (res.cancel) {
  263. console.log('用户点击取消');
  264. }
  265. }
  266. })
  267. },
  268. //任务详情
  269. clickRenwu(item){
  270. var shuzu=[
  271. {userName:'',department:'',id:''}
  272. ]
  273. var xieban=[]
  274. var xiebanpeo=[]
  275. var tt=[]
  276. var xiebanV=[]
  277. var a1=this.data.sposonerName+','+this.data.coSposonerName
  278. var a2=this.data.organize+','+this.data.coOrganize
  279. var a3=this.data.sposoner+','+this.data.coSposoner
  280. xieban=a1.split(',')
  281. xiebanpeo=a2.split(',')
  282. xiebanV=a3.split(',')
  283. shuzu=xieban.map(item =>{
  284. console.log(item)
  285. return {
  286. userName: item,
  287. }
  288. })
  289. shuzu.forEach((item,index) => {
  290. console.log(item);
  291. this.$set(item,"department",xiebanpeo[index])
  292. this.$set(item,"id",xiebanV[index])
  293. })
  294. let t2=JSON.stringify(shuzu)
  295. //这里———————————————————————————
  296. let query2 = encodeURIComponent(t2)
  297. //传参对象,使用encodeURIComponent编码
  298. let str = JSON.stringify(item)
  299. //注意这里——————————————————————
  300. str = str.replace(/%/g, '%25')
  301. //这里———————————————————————————
  302. let query = encodeURIComponent(str)
  303. uni.navigateTo({
  304. url:'/pages/project/renwuX?data='+query+'&people='+query2
  305. })
  306. },
  307. //更新进度
  308. updateJin(item){
  309. //传参对象,使用encodeURIComponent编码
  310. let str = JSON.stringify(item)
  311. //注意这里——————————————————————
  312. str = str.replace(/%/g, '%25')
  313. //这里———————————————————————————
  314. let query = encodeURIComponent(str)
  315. uni.navigateTo({
  316. url:'/pages/project/renwuUpdateJin?data='+query
  317. })
  318. },
  319. //催办任务
  320. cuirenwu2(item){
  321. let that = this
  322. uni.showModal({
  323. title: '提示',
  324. content: '确定催办任务吗?',
  325. success: function(res) {
  326. if (res.confirm) {
  327. console.log('用户点击确定');
  328. uni.showLoading({
  329. title: '加载中',
  330. mask: true, // 是否显示透明蒙层,防止触摸穿透
  331. });
  332. let data={
  333. taskId:item.id,
  334. }
  335. that.$Request.postT('/api/sysTask/urge',data).then(res => {
  336. if (res.code==200) {
  337. uni.showToast({
  338. title: '催办成功',
  339. icon: 'none',
  340. duration:800
  341. });
  342. uni.hideLoading()
  343. setTimeout(function() {
  344. that.getRenwu()
  345. }, 1000)
  346. } else {
  347. uni.hideLoading();
  348. uni.showToast({
  349. title: res.message,
  350. icon: 'none',
  351. duration:800
  352. });
  353. }
  354. });
  355. } else if (res.cancel) {
  356. console.log('用户点击取消');
  357. }
  358. }
  359. })
  360. },
  361. // 查找任务
  362. getRenwu(){
  363. let that = this
  364. that.renwu=[]
  365. uni.showLoading({
  366. title: '加载中',
  367. mask: true, // 是否显示透明蒙层,防止触摸穿透
  368. });
  369. var data={
  370. "projectId": that.data.id
  371. }
  372. that.$Request.postT('/api/sysTask/queryTaskByProject',data).then(res => {
  373. if (res.code==200) {
  374. that.renwu=res.data
  375. console.log(that.renwu,'任务')
  376. }
  377. uni.hideLoading();
  378. });
  379. },
  380. //项目日志
  381. getRizhi(){
  382. let that = this
  383. that.rizhi=[]
  384. uni.showLoading({
  385. title: '加载中',
  386. mask: true, // 是否显示透明蒙层,防止触摸穿透
  387. });
  388. var data={
  389. "projectId": that.data.id
  390. }
  391. that.$Request.postT('/api/sysProject/queryLogs',data).then(res => {
  392. if (res.code==200) {
  393. that.rizhi=res.data
  394. console.log(that.rizhi,'日志')
  395. }
  396. uni.hideLoading();
  397. });
  398. }
  399. }
  400. }
  401. </script>
  402. <style>
  403. .content {
  404. display: flex;
  405. flex-direction: column;
  406. align-items: center;
  407. justify-content: center;
  408. }
  409. .param{
  410. margin: 20rpx 0 0 0;
  411. width: 100%;
  412. background-color: rgba(255, 255, 255, 1);
  413. font-size: 28rpx;
  414. font-weight: 400;
  415. line-height: 41rpx;
  416. color: rgba(0, 0, 0, 1);
  417. }
  418. .proName{
  419. margin: 23rpx 0 0 20rpx;
  420. }
  421. .prolittle{
  422. margin: 5rpx 0 0 20rpx;
  423. width: 710rpx;
  424. /* 自动换行 */
  425. word-wrap: break-word;
  426. word-break: break-all;
  427. white-space: pre-line;
  428. }
  429. .proINname{
  430. margin: 25rpx 0 0 21rpx;
  431. width: 709rpx;
  432. height: 90rpx;
  433. border-radius: 13rpx;
  434. background: rgba(245, 248, 252, 1);
  435. border: 1rpx solid rgba(229, 229, 229, 1);
  436. font-size: 28rpx;
  437. line-height: 90rpx;
  438. /* color: rgba(179, 179, 179, 1); */
  439. }
  440. .proIMi{
  441. height: 315rpx;
  442. }
  443. .proMiao{
  444. margin: 31rpx 0 0 20rpx;
  445. }
  446. /* 上传附件 */
  447. .upload-img{
  448. /* width: 200rpx;
  449. height: 80rpx;
  450. opacity: 1;
  451. border-radius: 13rpx;
  452. background: rgba(0, 97, 255, 0.1);
  453. border: 1rpx solid rgba(0, 97, 255, 1); */
  454. }
  455. .jindu{
  456. font-size: 32rpx;
  457. font-weight: 500;
  458. line-height: 46rpx;
  459. }
  460. /* 进度 */
  461. .jindu-kuang{
  462. font-size: 24rpx;
  463. line-height: 35rpx;
  464. color: rgba(128, 128, 128, 1);
  465. }
  466. .jindu-circle{
  467. margin-top: 10rpx;
  468. width: 100rpx;
  469. height: 100rpx;
  470. border-radius: 50%;
  471. opacity: 1;
  472. background-color:rgba(204, 204, 204, 1);
  473. }
  474. .jindu-type{
  475. /* width: 103rpx; */
  476. height: 40rpx;
  477. border-radius: 71rpx;
  478. font-size: 24rpx;
  479. line-height: 40rpx;
  480. color: rgba(255, 255, 255, 1);
  481. text-align: center;
  482. margin: 0 0 0 20rpx;
  483. }
  484. .lixiang{
  485. background: linear-gradient(90deg, rgba(54, 111, 255, 1) 0%, rgba(93, 160, 252, 1) 100%);
  486. }
  487. .cuiban{
  488. background: linear-gradient(90deg, rgba(57, 167, 139, 1) 0%, rgba(126, 224, 203, 1) 100%);
  489. }
  490. .tijiao{
  491. background: linear-gradient(90deg, rgba(255, 112, 69, 1) 0%, rgba(247, 161, 114, 1) 100%);
  492. }
  493. .jindu-line{
  494. width: 4rpx;
  495. height: 100rpx;
  496. background-color: rgba(166, 166, 166, 1);
  497. }
  498. .weidu{
  499. margin: 7rpx 0 0 20rpx;
  500. font-size: 24rpx;
  501. line-height: 35rpx;
  502. color: rgba(128, 128, 128, 1);
  503. }
  504. .addRen{
  505. margin: -80rpx 0 0 581rpx;
  506. width: 149rpx;
  507. height: 59rpx;
  508. border-radius: 92rpx;
  509. background: rgba(0, 97, 255, 1);
  510. font-size: 28rpx;
  511. line-height: 59rpx;
  512. color: rgba(255, 255, 255, 1);
  513. text-align: center;
  514. }
  515. /* 任务列表 */
  516. .renwu{
  517. display: flex;
  518. margin-top: 6rpx;
  519. width: 709rpx;
  520. height: 90rpx;
  521. border-radius: 13rpx;
  522. background: rgba(245, 248, 252, 1);
  523. border: 1rpx solid rgba(229, 229, 229, 1);
  524. font-size: 28rpx;
  525. justify-content: space-evenly;
  526. align-items: center;
  527. }
  528. .renwu-bu{
  529. width: 105rpx;
  530. height: 50rpx;
  531. border-radius: 110rpx;
  532. line-height:50rpx;
  533. text-align: center;
  534. }
  535. .bianji{
  536. border: 1rpx solid rgba(0, 97, 255, 1);
  537. color: rgba(0, 97, 255, 1);
  538. }
  539. .delete{
  540. margin-left: 20rpx;
  541. border: 1rpx solid rgba(212, 48, 48, 1);
  542. color: rgba(212, 48, 48, 1);
  543. }
  544. .project{
  545. display: flex;
  546. margin: 61rpx 0 0 0;
  547. justify-content: space-evenly;
  548. }
  549. .butt{
  550. width: 330rpx;
  551. height: 90rpx;
  552. border-radius: 117rpx;
  553. font-size: 32rpx;
  554. line-height: 90rpx;
  555. text-align: center;
  556. }
  557. .quxiao{
  558. border: 1rpx solid rgba(0, 97, 255, 1);
  559. color: rgba(0, 97, 255, 1);
  560. }
  561. .queren{
  562. background: rgba(0, 97, 255, 1);
  563. color: rgba(255, 255, 255, 1);
  564. }
  565. </style>