projectX.vue 16 KB

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