projectChange.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102
  1. <template>
  2. <view class="content">
  3. <view class="param">
  4. <view class="all-text">创建项目需求</view>
  5. <view class="proName">项目标题</view>
  6. <input class="proINname" v-model="data.projectName" placeholder="请输入项目标题"/>
  7. <view class="proMiao">项目描述</view>
  8. <textarea class="proINname proIMi" v-model="data.projectContent" placeholder="请输入项目描述"/>
  9. <view class="proMiao">附件</view>
  10. <view class="upload-img">
  11. <uni-file-picker limit="3"
  12. @select='selectUpload'
  13. @delete="deleteHandle"
  14. :auto-upload='false'
  15. file-extname='pdf,docx,jpg,png,jpeg,doc,docm,dot,dotm,dotx,xlsx,xls,csv,xlsm,slxb,xlt,xltx'
  16. file-mediatype="all"
  17. @success='uploadSuccess'
  18. @fail='uploadFail'
  19. :list-styles='listStyles'
  20. v-model='fileList2'
  21. ></uni-file-picker>
  22. </view>
  23. <span style="margin: 20rpx 0 0 20rpx;">支持pdf,docx,jpg,png,jpeg,doc,docm,dot,dotm,dotx,xlsx,xls,csv,xlsm,slxb,xlt,xltx格式,单个文件大小不超过5MB</span>
  24. <view class="proMiao">主办单位/主办人</view>
  25. <uni-data-picker placeholder="请选择主办单位" popup-title="请选择主办人" :localdata="range" v-model="value"
  26. @change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened" @popupclosed="onpopupclosed">
  27. </uni-data-picker>
  28. <view class="proINname" style="height: 100%;">
  29. <view v-if="userListSelectwei1.length>0" class="tag-view" v-for="(value,key) in userListSelectwei1" :key="key" @click="clearTagAdminwei1(value)">
  30. <uni-tag :text="value.value+'/'+value.text[key]" type="primary" ></uni-tag>
  31. <uni-icons class="clearBtn" type="clear" size="15" color="#ccc" />
  32. </view>
  33. <view v-if="userListSelectwei1.length==0" class="tag-view" v-for="(value,key) in userListSelect1" :key="key" @click="clearTagAdmin1(value)">
  34. <uni-tag :text="value.parent_value.organize+'/'+value.text" type="primary" ></uni-tag>
  35. <!-- {{value.parent_value.organize}}/{{value.text}} -->
  36. <uni-icons class="clearBtn" type="clear" size="15" color="#ccc" />
  37. </view>
  38. </view>
  39. <!-- <view class="proMiao">主办单位</view>
  40. <uni-data-select class="proINname"
  41. v-model="value" placeholder="请选择主办单位"
  42. :localdata="range"
  43. @change="change"
  44. ></uni-data-select>
  45. <view class="proMiao">主办人</view>
  46. <uni-data-select class="proINname"
  47. v-model="peopleValue" placeholder="请选择主办人"
  48. :localdata="rangePeople"
  49. @change="change"
  50. ></uni-data-select> -->
  51. <view class="proMiao">协办单位/协办人</view>
  52. <uni-data-picker placeholder="请选择协办单位" popup-title="请选择协办人" :showSearch= "true" :localdata="range" v-model="value2"
  53. @change="onchange2" @nodeclick="onnodeclick2" @popupopened="onpopupopened2" @popupclosed="onpopupclosed2">
  54. </uni-data-picker>
  55. <view class="proINname" style="height: 100%;">
  56. <view v-if="userListSelectwei.length>0" class="tag-view" v-for="(value,key) in userListSelectwei" :key="key" @click="clearTagAdminwei(value)">
  57. <uni-tag :text="value.value+'/'+value.text[key]" type="primary" ></uni-tag>
  58. <uni-icons class="clearBtn" type="clear" size="15" color="#ccc" />
  59. </view>
  60. <view v-if="userListSelectwei.length==0" class="tag-view" v-for="(value,key) in userListSelect" :key="key" @click="clearTagAdmin(value)">
  61. <uni-tag :text="value.parent_value.organize+'/'+value.text" type="primary" ></uni-tag>
  62. <!-- {{value.parent_value.organize}}/{{value.text}} -->
  63. <uni-icons class="clearBtn" type="clear" size="15" color="#ccc" />
  64. </view>
  65. </view>
  66. <!-- <view class="proMiao">协办单位</view>
  67. <mySelectCheckbox class="proINname" placeholder="请选择协办单位" v-model="value2" multiple dataKey="label" dataValue="value" :localdata="data2"
  68. @change="changeXie"></mySelectCheckbox>
  69. <view class="proMiao">协办人</view>
  70. <mySelectCheckbox class="proINname" placeholder="请选择协办人" v-model="peopleValue2" multiple dataKey="label" dataValue="value" :localdata="dataPeople"
  71. @change="changeXiePeo"></mySelectCheckbox> -->
  72. <view class="proMiao">项目级别</view>
  73. <uni-data-select class="proINname"
  74. v-model="jibieValue" placeholder="请选择项目级别"
  75. :localdata="jibie"
  76. @change="change"
  77. ></uni-data-select>
  78. <view class="proMiao">项目来源</view>
  79. <uni-data-select class="proINname"
  80. v-model="fromValue" placeholder="请选择项目来源"
  81. :localdata="from"
  82. @change="change"
  83. ></uni-data-select>
  84. <view class="proMiao">项目评分人</view>
  85. <uni-combox class="proINname"
  86. :scorePeople="scorePeople" labelKey="label" valueKey="value"
  87. placeholder="请选择项目评分人"
  88. v-model="peoplescore"
  89. @input="comboxInput"
  90. ></uni-combox>
  91. </uni-forms-item>
  92. <view class="proINname" style="height: 100%;">
  93. <view v-if="userListSelectweiP.length>0" class="tag-view" v-for="(value,key) in userListSelectweiP" :key="key" @click="clearTagAdminweiP(value)">
  94. <uni-tag :text="value" type="primary" ></uni-tag>
  95. <uni-icons class="clearBtn" type="clear" size="15" color="#ccc" />
  96. </view>
  97. <view v-if="userListSelectweiP.length==0" class="tag-view" v-for="(value,key) in scorePeople22" :key="key" @click="clearTagAdminP(value)">
  98. <uni-tag :text="value" type="primary" ></uni-tag>
  99. <!-- {{value.parent_value.organize}}/{{value.text}} -->
  100. <uni-icons class="clearBtn" type="clear" size="15" color="#ccc" />
  101. </view>
  102. </view>
  103. <view class="proMiao jindu">完成进度</view>
  104. <view class="weidu">维度权重{{weidu}}%</view>
  105. <view class="addRen" @click="addRen" v-if="crerenwu==1&& (select==5 || select==3)">新增任务</view>
  106. <!-- 任务列表 -->
  107. <view style="width: 100%;margin: 50rpx 0 0 20rpx;">
  108. <view class="renwu" v-for="(item,index) in renwu" :key="index" @click="clickRenwu(item)">
  109. <view>{{item.taskName}}</view>
  110. <view>{{item.createTime}}</view>
  111. <view v-if="item.finishTime!=null">{{item.finishRemark}}</view>
  112. <view v-if="gengrenwu==1">{{item.weight}}</view>
  113. <view v-if="item.state==1">已完成</view>
  114. <view style="color: rgba(0, 97, 255, 1);" @click.stop="updateJin(item)" v-if="gengrenwu==1&& (select==5 || select==3|| select==4)">更新进度</view>
  115. <view style="color: rgba(0, 97, 255, 1);" @click.stop="cuirenwu2(item)" v-if="cuirenwu==1">催办</view>
  116. <view style="display: flex;">
  117. <view class="renwu-bu bianji" v-if="item.finishTime==null&&uprenwu==1&& (select==5 || select==3)" @click.stop="bianjiRenwu(item)">编辑</view>
  118. <view class="renwu-bu delete" @click.stop="deleteRenwu(item)" v-if="delerenwu==1&& (select==5 || select==3)">删除</view>
  119. </view>
  120. </view>
  121. </view>
  122. <!-- <view style="width: 100%;margin: 50rpx 0 0 20rpx;">
  123. <view class="renwu" v-for="(item,index) in renwu" :key="index">
  124. <view>{{item.taskName}}</view>
  125. <view>{{item.createTime}}</view>
  126. <view>{{item.weight}}</view>
  127. <view>{{item.scoreLimit}}</view>
  128. <view style="color: rgba(0, 97, 255, 1);" @click="updateJin(item)" v-if="gengrenwu==1">更新进度</view>
  129. <view style="color: rgba(0, 97, 255, 1);" @click="cuirenwu(item)" v-if="cuirenwu==1">催办</view>
  130. </view>
  131. </view> -->
  132. <view class="proMiao jindu" v-if="data.progress>0">进度详情</view>
  133. <!-- 进度 -->
  134. <view style="margin: 33rpx 0 0 19rpx;" v-if="data.progress>0">
  135. <view v-for="(item,index) in 5" :key="index" class="jindu-kuang">
  136. <view style="display: flex;">
  137. <view class="jindu-circle"></view>
  138. <view>
  139. <view style="width: 600rpx;display: flex;justify-content: space-between;margin-top: 20rpx;">
  140. <view style="display: flex;">
  141. <view style="margin-left: 28rpx;">{{item.createName}}</view>
  142. <view class="jindu-type lixiang">{{item.content}}</view>
  143. </view>
  144. <!-- <view class="jindu-type cuiban">已催办</view>
  145. <view class="jindu-type tijiao">已提交</view> -->
  146. <view>{{item.createTime}}</view>
  147. </view>
  148. <view style="margin:7rpx 0 0 28rpx;">项目名:{{item.projectName}}</view>
  149. </view>
  150. </view>
  151. <!-- <view class="jindu-line" v-if="index<4"></view> -->
  152. </view>
  153. </view>
  154. <view class="project">
  155. <view class="butt queren" @click="updatePro">保存</view>
  156. </view>
  157. <view style="width: 100%;height: 60rpx;"></view>
  158. </view>
  159. </view>
  160. </template>
  161. <script>
  162. import configdata from '@/common/config.js'
  163. import mySelectCheckbox from '../../components/my-selectCheckbox.vue'
  164. export default {
  165. components:{mySelectCheckbox},
  166. data() {
  167. return {
  168. data:{},
  169. //主办单位
  170. value: '1-2',
  171. range: [],
  172. //主办人
  173. peopleValue:'',
  174. rangePeople:[],
  175. userListSelect1:[],
  176. userListSelectwei1:[
  177. {value:'',text:''},
  178. ],
  179. //协办
  180. value2:'',
  181. userListSelect:[],
  182. userListSelectwei:[
  183. {value:'',text:''},
  184. ],
  185. data2: [],
  186. xieban:[],//协办传入值数组
  187. xieValue:[],//协办传入id
  188. //协办人
  189. peopleValue2:[],
  190. dataPeople: [],
  191. xiebanPeople:[],//协办传入值数组
  192. xieValuePeople:[],//协办传入id
  193. //评分人
  194. peoplescore:[],
  195. scorePeople: [],
  196. scorePeople22:[],//协办传入值数组
  197. userListSelectweiP:[],
  198. scoreValuePeople:[],//协办传入id
  199. // 项目级别
  200. jibieValue:0,
  201. jibie:[
  202. { value: 0, text: "正常" },
  203. { value: 1, text: "紧急" },
  204. ],
  205. // 项目来源
  206. fromValue:0,
  207. from:[
  208. { value: 0, text: "涉内" },
  209. { value: 1, text: "涉外" },
  210. ],
  211. fileList2: [],
  212. fileList22:'',
  213. // fileList: [
  214. // {name:'111'},
  215. // {name:'333'}
  216. // ],
  217. listStyles: {
  218. "borderStyle": {
  219. "width": "0", // 边框宽度
  220. },
  221. "border": false, // 是否显示边框
  222. "dividline": false
  223. },
  224. renwu:[],
  225. weidu:'',
  226. crerenwu:1,//添加任务
  227. uprenwu:1,//修改任务
  228. delerenwu:1,//是否删除任务
  229. cuirenwu:1,//催办任务
  230. gengrenwu:1,//是否更新任务
  231. select:0,//状态
  232. }
  233. },
  234. onShow() {
  235. // console.log('aa',sessionStorage.getItem("crerenwu"))
  236. this.crerenwu=sessionStorage.getItem("crerenwu")
  237. this.uprenwu=sessionStorage.getItem("uprenwu")
  238. this.delerenwu=sessionStorage.getItem("delerenwu")
  239. this.cuirenwu=sessionStorage.getItem("cuirenwu")
  240. this.gengrenwu=sessionStorage.getItem("gengrenwu")
  241. this.getPeopleZhu()
  242. },
  243. onLoad(option) {
  244. this.select=option.select
  245. console.log(JSON.parse(decodeURIComponent(option.data)))
  246. var wei=JSON.parse(decodeURIComponent(option.weidu))
  247. this.data=JSON.parse(decodeURIComponent(option.data))
  248. this.weidu=(wei[2].configValue)
  249. // this.getDanwei()
  250. this.getPeople(this.data.organize)
  251. for(var i=0;i<this.jibie.length;i++){
  252. if(this.jibie[i].text==this.data.projectLevel){
  253. this.jibieValue=this.jibie[i].value
  254. }
  255. }
  256. for(var i=0;i<this.from.length;i++){
  257. if(this.from[i].text==this.data.projectFrom){
  258. this.fromValue=this.from[i].value
  259. }
  260. }
  261. var image=[]
  262. image=this.data.fileUrl.split(',')
  263. this.fileList2 =image.map(item =>{
  264. return {
  265. name: item
  266. }
  267. })
  268. this.fileList22=image.join(",")
  269. console.log(this.fileList2)
  270. this.getRenwu()
  271. console.log(this.data.coOrganize.split(','))
  272. // this.userListSelect=
  273. this.userListSelectwei=[]
  274. this.userListSelectwei1=[]
  275. this.userListSelectweiP=[]
  276. var zhuban=[]
  277. var zhubanpeo=[]
  278. var zhubanV=[]
  279. zhuban=this.data.organize.split(',')
  280. zhubanpeo=this.data.sposonerName.split(',')
  281. zhubanV=this.data.sposoner.split(',')
  282. this.userListSelectwei1=zhuban.map(item =>{
  283. console.log(item)
  284. return {
  285. value: item,
  286. text:zhubanpeo,
  287. id:zhubanV
  288. }
  289. })
  290. var xieban=[]
  291. var xiebanpeo=[]
  292. var xiebanV=[]
  293. xieban=this.data.coOrganize.split(',')
  294. xiebanpeo=this.data.coSposonerName.split(',')
  295. xiebanV=this.data.coSposoner.split(',')
  296. this.userListSelectwei=xieban.map(item =>{
  297. console.log(item)
  298. return {
  299. value: item,
  300. text:xiebanpeo,
  301. id:xiebanV
  302. }
  303. })
  304. var pingpeo=[]
  305. pingpeo=this.data.scorerName.split(',')
  306. this.userListSelectweiP=pingpeo
  307. // for(var i=0;i<xieban.length;i++){
  308. // // for(var j=0;j<xiebanpeo.length;j++){
  309. // // this.userListSelectwei.push({value:xieban[0]},{text:xiebanpeo[0]})
  310. // // }
  311. // }
  312. // this.userListSelectwei.push({value:xieban[0]},{text:xiebanpeo[0]})
  313. // xieban.map(item =>{
  314. // tt.push({value:item})
  315. // // return {
  316. // // value: item2,
  317. // // text: item,
  318. // // }
  319. // })
  320. // this.userListSelectwei=tt
  321. console.log(this.userListSelectwei,'t')
  322. // xiebanpeo.map(item =>{
  323. // this.userListSelectwei.push({text:item})
  324. // // return {
  325. // // value: item2,
  326. // // text: item,
  327. // // }
  328. // })
  329. // this.userListSelectwei=xiebanpeo.map(item =>{
  330. // return {
  331. // value: item,
  332. // }
  333. // })
  334. // this.userListSelectwei.push(xieban,xiebanpeo)
  335. console.log(this.userListSelectwei,'p')
  336. },
  337. methods: {
  338. change(e) {
  339. console.log("e:", e);
  340. },
  341. //主办人
  342. onnodeclick(data) {
  343. console.log(data);
  344. if(data.parent_value){//存在父级
  345. let dataId = data.value;
  346. this.userListSelect1.push(data);
  347. this.userListSelect1 = [...new Set(this.userListSelect1)]//es6数组去重
  348. this.userListSelectwei1=[]
  349. }
  350. console.log(this.userListSelectwei1,'多选',this.userListSelect1)
  351. },
  352. onpopupopened(e) {
  353. console.log('popupopened');
  354. },
  355. onpopupclosed(e) {
  356. console.log('popupclosed');
  357. },
  358. onchange(e) {
  359. console.log('---------onchange:', e);
  360. var acc=e.detail.value[0].text
  361. this.getPeople(acc)
  362. },
  363. //主办人
  364. clearTagAdmin(value){
  365. this.userListSelect1 = this.userListSelect1.filter(item => item != value);
  366. },
  367. clearTagAdminwei(value){
  368. this.userListSelectwei1 = this.userListSelectwei1.filter(item => item != value);
  369. },
  370. //协办人
  371. clearTagAdmin(value){
  372. this.userListSelect = this.userListSelect.filter(item => item != value);
  373. },
  374. clearTagAdminwei1(value){
  375. this.userListSelectwei = this.userListSelectwei.filter(item => item != value);
  376. },
  377. onnodeclick2(data) {
  378. console.log(data);
  379. if(data.parent_value){//存在父级
  380. let dataId = data.value;
  381. this.userListSelect.push(data);
  382. this.userListSelect = [...new Set(this.userListSelect)]//es6数组去重
  383. this.userListSelectwei=[]
  384. }
  385. console.log(this.userListSelectwei,'多选',this.userListSelect)
  386. },
  387. onpopupopened2(e) {
  388. console.log('popupopened');
  389. },
  390. onpopupclosed2(e) {
  391. console.log('popupclosed');
  392. },
  393. onchange2(e) {
  394. console.log('---------onchange:', e);
  395. },
  396. // @input combox输入事件 返回combox值
  397. comboxInput(e) {
  398. console.log('e:', e);
  399. // this.peoplescore=e
  400. // this.scorePeople22=[]
  401. // this.scoreValuePeople=[]
  402. for(var i=0;i<this.scorePeople.length;i++){
  403. if(e==this.scorePeople[i].value){
  404. this.userListSelectweiP=[]
  405. this.scorePeople22.push(this.scorePeople[i].label)
  406. this.scoreValuePeople.push(this.scorePeople[i].value)
  407. }
  408. }
  409. console.log(this.scorePeople22)
  410. },
  411. clearTagAdminP(value){
  412. this.scorePeople22 = this.scorePeople22.filter(item => item != value);
  413. },
  414. clearTagAdminweiP(value){
  415. this.userListSelectweiP = this.userListSelectweiP.filter(item => item != value);
  416. },
  417. //新增任务
  418. addRen(){
  419. var shuzu=[
  420. {userName:'',department:'',id:''}
  421. ]
  422. var xieban=[]
  423. var xiebanpeo=[]
  424. var tt=[]
  425. var xiebanV=[]
  426. var a1=this.data.sposonerName+','+this.data.coSposonerName
  427. var a2=this.data.organize+','+this.data.coOrganize
  428. var a3=this.data.sposoner+','+this.data.coSposoner
  429. xieban=a1.split(',')
  430. xiebanpeo=a2.split(',')
  431. xiebanV=a3.split(',')
  432. shuzu=xieban.map(item =>{
  433. console.log(item)
  434. return {
  435. userName: item,
  436. }
  437. })
  438. shuzu.forEach((item,index) => {
  439. console.log(item);
  440. this.$set(item,"department",xiebanpeo[index])
  441. this.$set(item,"id",xiebanV[index])
  442. })
  443. let t2=JSON.stringify(shuzu)
  444. //这里———————————————————————————
  445. let query2 = encodeURIComponent(t2)
  446. uni.navigateTo({
  447. url:'/pages/project/addRenwu?proId='+this.data.id+'&people='+query2
  448. })
  449. },
  450. //编辑任务
  451. bianjiRenwu(item){
  452. var shuzu=[
  453. {userName:'',department:'',id:''}
  454. ]
  455. var xieban=[]
  456. var xiebanpeo=[]
  457. var tt=[]
  458. var xiebanV=[]
  459. var a1=this.data.sposonerName+','+this.data.coSposonerName
  460. var a2=this.data.organize+','+this.data.coOrganize
  461. var a3=this.data.sposoner+','+this.data.coSposoner
  462. xieban=a1.split(',')
  463. xiebanpeo=a2.split(',')
  464. xiebanV=a3.split(',')
  465. shuzu=xieban.map(item =>{
  466. console.log(item)
  467. return {
  468. userName: item,
  469. }
  470. })
  471. shuzu.forEach((item,index) => {
  472. console.log(item);
  473. this.$set(item,"department",xiebanpeo[index])
  474. this.$set(item,"id",xiebanV[index])
  475. })
  476. let t2=JSON.stringify(shuzu)
  477. //这里———————————————————————————
  478. let query2 = encodeURIComponent(t2)
  479. //传参对象,使用encodeURIComponent编码
  480. let str = JSON.stringify(item)
  481. //注意这里——————————————————————
  482. str = str.replace(/%/g, '%25')
  483. //这里———————————————————————————
  484. let query = encodeURIComponent(str)
  485. uni.navigateTo({
  486. url:'/pages/project/changeRenwu?data='+query+'&people='+query2
  487. })
  488. },
  489. //删除任务
  490. deleteRenwu(item){
  491. let that = this
  492. uni.showModal({
  493. title: '提示',
  494. content: '确定删除任务吗?',
  495. success: function(res) {
  496. if (res.confirm) {
  497. console.log('用户点击确定');
  498. uni.showLoading({
  499. title: '加载中',
  500. mask: true, // 是否显示透明蒙层,防止触摸穿透
  501. });
  502. let data={
  503. id:item.id,
  504. }
  505. that.$Request.postT('/api/sysTask/del',data).then(res => {
  506. if (res.code==200) {
  507. uni.showToast({
  508. title: '删除成功',
  509. icon: 'none',
  510. duration:800
  511. });
  512. uni.hideLoading()
  513. setTimeout(function() {
  514. that.getRenwu()
  515. }, 1000)
  516. } else {
  517. uni.hideLoading();
  518. uni.showToast({
  519. title: res.message,
  520. icon: 'none',
  521. duration:800
  522. });
  523. }
  524. });
  525. } else if (res.cancel) {
  526. console.log('用户点击取消');
  527. }
  528. }
  529. })
  530. },
  531. //任务详情
  532. clickRenwu(item){
  533. var shuzu=[
  534. {userName:'',department:'',id:''}
  535. ]
  536. var xieban=[]
  537. var xiebanpeo=[]
  538. var tt=[]
  539. var xiebanV=[]
  540. var a1=this.data.sposonerName+','+this.data.coSposonerName
  541. var a2=this.data.organize+','+this.data.coOrganize
  542. var a3=this.data.sposoner+','+this.data.coSposoner
  543. xieban=a1.split(',')
  544. xiebanpeo=a2.split(',')
  545. xiebanV=a3.split(',')
  546. shuzu=xieban.map(item =>{
  547. console.log(item)
  548. return {
  549. userName: item,
  550. }
  551. })
  552. shuzu.forEach((item,index) => {
  553. console.log(item);
  554. this.$set(item,"department",xiebanpeo[index])
  555. this.$set(item,"id",xiebanV[index])
  556. })
  557. let t2=JSON.stringify(shuzu)
  558. //这里———————————————————————————
  559. let query2 = encodeURIComponent(t2)
  560. //传参对象,使用encodeURIComponent编码
  561. let str = JSON.stringify(item)
  562. //注意这里——————————————————————
  563. str = str.replace(/%/g, '%25')
  564. //这里———————————————————————————
  565. let query = encodeURIComponent(str)
  566. uni.navigateTo({
  567. url:'/pages/project/renwuX?data='+query+'&people='+query2
  568. })
  569. },
  570. //更新进度
  571. updateJin(item){
  572. //传参对象,使用encodeURIComponent编码
  573. let str = JSON.stringify(item)
  574. //注意这里——————————————————————
  575. str = str.replace(/%/g, '%25')
  576. //这里———————————————————————————
  577. let query = encodeURIComponent(str)
  578. uni.navigateTo({
  579. url:'/pages/project/renwuUpdateJin?data='+query
  580. })
  581. },
  582. //催办任务
  583. cuirenwu2(item){
  584. let that = this
  585. uni.showModal({
  586. title: '提示',
  587. content: '确定催办任务吗?',
  588. success: function(res) {
  589. if (res.confirm) {
  590. console.log('用户点击确定');
  591. uni.showLoading({
  592. title: '加载中',
  593. mask: true, // 是否显示透明蒙层,防止触摸穿透
  594. });
  595. let data={
  596. taskId:item.id,
  597. }
  598. that.$Request.postT('/api/sysTask/urge',data).then(res => {
  599. if (res.code==200) {
  600. uni.showToast({
  601. title: '催办成功',
  602. icon: 'none',
  603. duration:800
  604. });
  605. uni.hideLoading()
  606. setTimeout(function() {
  607. that.getRenwu()
  608. }, 1000)
  609. } else {
  610. uni.hideLoading();
  611. uni.showToast({
  612. title: res.message,
  613. icon: 'none',
  614. duration:800
  615. });
  616. }
  617. });
  618. } else if (res.cancel) {
  619. console.log('用户点击取消');
  620. }
  621. }
  622. })
  623. },
  624. //获取单位
  625. getDanwei(){
  626. this.range=[]
  627. this.data2=[]
  628. uni.showLoading({
  629. title: '加载中',
  630. mask: true, // 是否显示透明蒙层,防止触摸穿透
  631. });
  632. this.$Request.postT('/api/Organize/query').then(res => {
  633. if (res.code==200&&res.data) {
  634. this.range =res.data.map(item =>{
  635. return {
  636. value: item.id,
  637. text: item.oname,
  638. id:item.oid
  639. }
  640. })
  641. this.data2 =res.data.map(item =>{
  642. return {
  643. value: item.id,
  644. label: item.oname,
  645. id:item.oid
  646. }
  647. })
  648. for(var i=0;i<this.range.length;i++){
  649. if(this.range[i].text==this.data.organize){
  650. this.value=this.range[i].value
  651. }
  652. }
  653. // for(var i=0;i<this.data2.length;i++){
  654. // if(this.data2[i].label==this.data.){
  655. // this.value2=this.data2[i].value
  656. // }
  657. // }
  658. }
  659. uni.hideLoading();
  660. });
  661. },
  662. //获取主办协办人
  663. getPeopleZhu(){
  664. this.range=[]
  665. this.rangePeople=[]
  666. uni.showLoading({
  667. title: '加载中',
  668. mask: true, // 是否显示透明蒙层,防止触摸穿透
  669. });
  670. this.$Request.postJson('/api/sysProject/queryCoUsers',{}).then(res => {
  671. if (res.code==200) {
  672. var lianji=[]
  673. for(var i=0;i<res.data.length;i++){
  674. if(res.data[i].userList.length>0){
  675. lianji.push(res.data[i])
  676. }
  677. }
  678. this.range =lianji.map(item =>{
  679. return {
  680. value: item,
  681. text: item.organize,
  682. children:item.userList.map(item =>{
  683. return{
  684. value: item.id,
  685. text: item.userName,
  686. }
  687. })
  688. }
  689. })
  690. console.log(this.range,'人')
  691. this.value=parseInt(this.data.sposoner)//25
  692. this.userListSelect1={
  693. parent_value:{
  694. organize:this.data.organize
  695. }
  696. }
  697. }else{
  698. var ii=JSON.stringify(res)
  699. console.log(res,res.data)
  700. console.log(JSON.parse(res))
  701. console.log(JSON.parse(ii))
  702. }
  703. uni.hideLoading();
  704. });
  705. },
  706. //根据单位获取人员(评分人)
  707. getPeople(acc){
  708. console.log(this.userListSelect1)
  709. this.scorePeople=[]
  710. uni.showLoading({
  711. title: '加载中',
  712. mask: true, // 是否显示透明蒙层,防止触摸穿透
  713. });
  714. this.$Request.postT('/api/sysUser/queryScorer',{
  715. organizes:acc
  716. }).then(res => {
  717. if (res.code==200) {
  718. console.log(res,'评分')
  719. this.scorePeople =res.data.map(item =>{
  720. return {
  721. value: item.id,
  722. label: item.userName,
  723. }
  724. })
  725. console.log(this.scorePeople,'人')
  726. // var people=[]
  727. // people=this.data.scorerName.split(',')
  728. // for(var j=0;j<this.scorePeople.length;j++){
  729. // for(var i=0;i<people.length;i++){
  730. // console.log(this.scorePeople[j].label,'ll',people[i])
  731. // if(this.scorePeople[j].label==people[i]){
  732. // this.peoplescore.push(this.scorePeople[j].value)
  733. // this.scoreValuePeople.push(this.scorePeople[j].value)
  734. // }
  735. // }
  736. // }
  737. }else{
  738. var ii=JSON.stringify(res)
  739. console.log(res,res.data)
  740. console.log(JSON.parse(res))
  741. console.log(JSON.parse(ii))
  742. }
  743. uni.hideLoading();
  744. });
  745. },
  746. // 查找任务
  747. getRenwu(){
  748. let that = this
  749. that.renwu=[]
  750. uni.showLoading({
  751. title: '加载中',
  752. mask: true, // 是否显示透明蒙层,防止触摸穿透
  753. });
  754. var data={
  755. "projectId": that.data.id
  756. }
  757. that.$Request.postT('/api/sysTask/queryTaskByProject',data).then(res => {
  758. if (res.code==200) {
  759. that.renwu=res.data
  760. console.log(that.renwu,'任务')
  761. }
  762. uni.hideLoading();
  763. });
  764. },
  765. // 上传附件
  766. uploadSuccess(e) {
  767. console.log('上传成功', e)
  768. },
  769. uploadFail(e) {
  770. console.log('上传失败:', e)
  771. },
  772. //保存编辑项目
  773. updatePro(){
  774. console.log(this.userListSelectwei)
  775. var xieban=[]
  776. var xiebanValue=[]
  777. if(this.userListSelectwei.length>0){
  778. this.userListSelectwei.map(item =>{
  779. xieban.push(item.value)
  780. xiebanValue.push(item.id[0])
  781. })
  782. }else{
  783. this.userListSelect.map(item =>{
  784. xieban.push(item.parent_value.organize)
  785. xiebanValue.push(item.value)
  786. })
  787. }
  788. var zhuban=[]
  789. var zhubanValue=[]
  790. if(this.userListSelectwei1.length>0){
  791. this.userListSelectwei1.map(item =>{
  792. zhuban.push(item.value)
  793. zhubanValue.push(item.id[0])
  794. })
  795. }else{
  796. this.userListSelect1.map(item =>{
  797. zhuban.push(item.parent_value.organize)
  798. zhubanValue.push(item.value)
  799. })
  800. }
  801. console.log(this.userListSelect1,this.value)
  802. let that = this
  803. if (!that.data.projectName) {
  804. that.$queue.showToast("请输入项目标题");
  805. }else if (!that.data.projectContent) {
  806. that.$queue.showToast("请输入项目描述");
  807. }else {
  808. uni.showLoading({
  809. title: '加载中',
  810. mask: true, // 是否显示透明蒙层,防止触摸穿透
  811. });
  812. that.$Request.postJson("/api/sysProject/update", {
  813. "id": that.data.id,
  814. "projectName": that.data.projectName, // 项目名称
  815. "projectFrom": that.from[that.fromValue].text, // 项目来源
  816. "projectLevel": that.jibie[that.jibieValue].text, // 项目等级
  817. "projectContent": that.data.projectContent, // 项目描述
  818. "fileUrl": that.fileList22, // 附件
  819. "organize": zhuban.join(","), // 主办单位-单选
  820. "sposoner": zhubanValue.join(","), // 主办人ID-单选
  821. "coOrganize": xieban.join(","), // 协办单位-多选
  822. "coSposoner": xiebanValue.join(",") ,// 协办人ID-多选
  823. "scorer": that.scoreValuePeople.join(",") // 评分人ID-多选
  824. }).then(res => {
  825. if (res.code == 200) {
  826. uni.showToast({
  827. title: '修改成功',
  828. icon: 'none',
  829. duration:800
  830. });
  831. uni.hideLoading()
  832. setTimeout(function() {
  833. uni.switchTab({
  834. url:'/pages/project/index'
  835. })
  836. }, 1000)
  837. } else {
  838. uni.hideLoading();
  839. uni.showToast({
  840. title: res.message,
  841. icon: 'none',
  842. duration:800
  843. });
  844. }
  845. });
  846. }
  847. },
  848. //删除文件
  849. deleteHandle(index){
  850. console.log(index)
  851. this.fileList2.splice(index.index,1)
  852. console.log(this.fileList2)
  853. this.fileList22=this.fileList2.join(",")
  854. },
  855. async selectUpload(e) {
  856. console.log('上传:', e)
  857.  let data = new FormData();
  858.   data.set("file", e.tempFiles[0].file);
  859.   let res = await this.$axios({
  860.     method: "post",
  861.     url: this.config('APIHOST1') + "/api/sysFile/upload",
  862.     headers: {
  863. tokenW: sessionStorage.getItem("token"),
  864. "Content-Type": "multipart/form-data"
  865.     },
  866.     data: data,
  867.   });
  868. // return res
  869.   console.log(res, "图片上传成功");
  870.   if (res.data.code == 200) {
  871. console.log(this.fileList2)
  872.     this.fileList2.push(res.data.data);
  873. this.fileList22=this.fileList2.join(",")
  874. // console.log(this.fileList2.join(","))
  875.   } else if(res.message=="登录凭证已过去,请重新登录"){
  876. sessionStorage.removeItem("token") sessionStorage.removeItem("roleId")
  877. uni.showModal({
  878. title: '提示',
  879. content: '用户信息失效,请重新登录!',
  880. showCancel: false, // 是否显示取消按钮,默认为 true // 是否显示取消按钮,默认为 true
  881. success: function(res) {
  882. if (res.confirm) {
  883. }
  884. }
  885. });
  886. }else {
  887.     uni.showToast({
  888. title: res.message,
  889. icon: 'none',
  890. duration:800
  891. });
  892.   }
  893. },
  894. config: function (name) {
  895. var info = null
  896. if (name) {
  897. var name2 = name.split('.') //字符分割
  898. if (name2.length > 1) {
  899. info = configdata[name2[0]][name2[1]] || null
  900. } else {
  901. info = configdata[name] || null
  902. }
  903. if (info == null) {
  904. let web_config = cache.get('web_config')
  905. if (web_config) {
  906. if (name2.length > 1) {
  907. info = web_config[name2[0]][name2[1]] || null
  908. } else {
  909. info = web_config[name] || null
  910. }
  911. }
  912. }
  913. }
  914. return info
  915. },
  916. }
  917. }
  918. </script>
  919. <style>
  920. .content {
  921. display: flex;
  922. flex-direction: column;
  923. align-items: center;
  924. justify-content: center;
  925. }
  926. .param{
  927. margin: 20rpx 0 0 0;
  928. width: 100%;
  929. background-color: rgba(255, 255, 255, 1);
  930. font-size: 28rpx;
  931. font-weight: 400;
  932. line-height: 41rpx;
  933. color: rgba(0, 0, 0, 1);
  934. }
  935. .all-text{
  936. margin: 22rpx 0 0 20rpx;
  937. font-size: 32rpx;
  938. font-weight: 500;
  939. color: rgba(0, 0, 0, 1);
  940. }
  941. .proName{
  942. margin: 23rpx 0 0 20rpx;
  943. }
  944. .proINname{
  945. margin: 25rpx 0 0 21rpx;
  946. width: 709rpx;
  947. height: 90rpx;
  948. border-radius: 13rpx;
  949. background: rgba(245, 248, 252, 1);
  950. border: 1rpx solid rgba(229, 229, 229, 1);
  951. font-size: 28rpx;
  952. line-height: 90rpx;
  953. /* 自动换行 */
  954. word-wrap: break-word;
  955. word-break: break-all;
  956. white-space: pre-line;
  957. /* color: rgba(179, 179, 179, 1); */
  958. }
  959. .proIMi{
  960. height: 315rpx;
  961. }
  962. .proMiao{
  963. margin: 31rpx 0 0 20rpx;
  964. }
  965. /* 上传附件 */
  966. .upload-img{
  967. /* width: 200rpx;
  968. height: 80rpx;
  969. opacity: 1;
  970. border-radius: 13rpx;
  971. background: rgba(0, 97, 255, 0.1);
  972. border: 1rpx solid rgba(0, 97, 255, 1); */
  973. }
  974. .jindu{
  975. font-size: 32rpx;
  976. font-weight: 500;
  977. line-height: 46rpx;
  978. }
  979. /* 进度 */
  980. .jindu-kuang{
  981. font-size: 24rpx;
  982. line-height: 35rpx;
  983. color: rgba(128, 128, 128, 1);
  984. }
  985. .jindu-circle{
  986. margin-top: 10rpx;
  987. width: 100rpx;
  988. height: 100rpx;
  989. border-radius: 50%;
  990. opacity: 1;
  991. background-color:rgba(204, 204, 204, 1);
  992. }
  993. .jindu-type{
  994. /* width: 103rpx; */
  995. height: 40rpx;
  996. border-radius: 71rpx;
  997. font-size: 24rpx;
  998. line-height: 40rpx;
  999. color: rgba(255, 255, 255, 1);
  1000. text-align: center;
  1001. margin: 0 0 0 20rpx;
  1002. }
  1003. .lixiang{
  1004. background: linear-gradient(90deg, rgba(54, 111, 255, 1) 0%, rgba(93, 160, 252, 1) 100%);
  1005. }
  1006. .cuiban{
  1007. background: linear-gradient(90deg, rgba(57, 167, 139, 1) 0%, rgba(126, 224, 203, 1) 100%);
  1008. }
  1009. .tijiao{
  1010. background: linear-gradient(90deg, rgba(255, 112, 69, 1) 0%, rgba(247, 161, 114, 1) 100%);
  1011. }
  1012. .jindu-line{
  1013. width: 4rpx;
  1014. height: 100rpx;
  1015. background-color: rgba(166, 166, 166, 1);
  1016. }
  1017. .weidu{
  1018. margin: 7rpx 0 0 20rpx;
  1019. font-size: 24rpx;
  1020. line-height: 35rpx;
  1021. color: rgba(128, 128, 128, 1);
  1022. }
  1023. .addRen{
  1024. margin: -80rpx 0 0 581rpx;
  1025. width: 149rpx;
  1026. height: 59rpx;
  1027. border-radius: 92rpx;
  1028. background: rgba(0, 97, 255, 1);
  1029. font-size: 28rpx;
  1030. line-height: 59rpx;
  1031. color: rgba(255, 255, 255, 1);
  1032. text-align: center;
  1033. }
  1034. /* 任务列表 */
  1035. .renwu{
  1036. display: flex;
  1037. margin-top: 6rpx;
  1038. width: 709rpx;
  1039. height: 90rpx;
  1040. border-radius: 13rpx;
  1041. background: rgba(245, 248, 252, 1);
  1042. border: 1rpx solid rgba(229, 229, 229, 1);
  1043. font-size: 28rpx;
  1044. justify-content: space-evenly;
  1045. align-items: center;
  1046. }
  1047. .renwu-bu{
  1048. width: 105rpx;
  1049. height: 50rpx;
  1050. border-radius: 110rpx;
  1051. line-height:50rpx;
  1052. text-align: center;
  1053. }
  1054. .bianji{
  1055. border: 1rpx solid rgba(0, 97, 255, 1);
  1056. color: rgba(0, 97, 255, 1);
  1057. }
  1058. .delete{
  1059. margin-left: 20rpx;
  1060. border: 1rpx solid rgba(212, 48, 48, 1);
  1061. color: rgba(212, 48, 48, 1);
  1062. }
  1063. .project{
  1064. display: flex;
  1065. margin: 61rpx 0 0 0;
  1066. justify-content: space-evenly;
  1067. }
  1068. .butt{
  1069. width: 330rpx;
  1070. height: 90rpx;
  1071. border-radius: 117rpx;
  1072. font-size: 32rpx;
  1073. line-height: 90rpx;
  1074. text-align: center;
  1075. }
  1076. .quxiao{
  1077. border: 1rpx solid rgba(0, 97, 255, 1);
  1078. color: rgba(0, 97, 255, 1);
  1079. }
  1080. .queren{
  1081. background: rgba(0, 97, 255, 1);
  1082. color: rgba(255, 255, 255, 1);
  1083. }
  1084. </style>