<template>
	<view class="content">
		<view class="param">
			<view class="all-text">创建项目需求</view>
			<view class="proName">项目标题</view>
			<input class="proINname" v-model="data.projectName" placeholder="请输入项目标题"/>
			<view class="proMiao">项目描述</view>
			<textarea class="proINname proIMi" v-model="data.projectContent" placeholder="请输入项目描述"/>
			<view class="proMiao">附件</view>
			<view class="upload-img">
				<uni-file-picker limit="3" 
					@select='selectUpload' 
					@delete="deleteHandle"
					:auto-upload='false' 
					file-extname='pdf,docx,jpg,png,jpeg,doc,docm,dot,dotm,dotx,xlsx,xls,csv,xlsm,slxb,xlt,xltx' 
					file-mediatype="all" 
					@success='uploadSuccess'	
					@fail='uploadFail' 
					:list-styles='listStyles' 
					v-model='fileList2'
				></uni-file-picker>
			</view>
			<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>
			<view class="proMiao">主办单位/主办人</view>
			<uni-data-picker placeholder="请选择主办单位" popup-title="请选择主办人" :localdata="range" v-model="value"
				@change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened" @popupclosed="onpopupclosed">
			</uni-data-picker>
			<view class="proINname" style="height: 100%;">
				   <view v-if="userListSelectwei1.length>0" class="tag-view" v-for="(value,key) in userListSelectwei1"  :key="key" @click="clearTagAdminwei1(value)">
						<uni-tag :text="value.value+'/'+value.text[key]" type="primary" ></uni-tag>
						<uni-icons class="clearBtn"  type="clear" size="15" color="#ccc" />
					</view>
					<view v-if="userListSelectwei1.length==0" class="tag-view" v-for="(value,key) in userListSelect1"  :key="key" @click="clearTagAdmin1(value)">
						<uni-tag :text="value.parent_value.organize+'/'+value.text" type="primary" ></uni-tag>
						<!-- {{value.parent_value.organize}}/{{value.text}} -->
						<uni-icons class="clearBtn"  type="clear" size="15" color="#ccc" />
					</view>
			</view>
			<!-- <view class="proMiao">主办单位</view>
			<uni-data-select class="proINname"
				v-model="value" placeholder="请选择主办单位"
				:localdata="range"
				@change="change"
			></uni-data-select>
			<view class="proMiao">主办人</view>
			<uni-data-select class="proINname"
				v-model="peopleValue" placeholder="请选择主办人"
				:localdata="rangePeople"
				@change="change"
			></uni-data-select> -->
			<view class="proMiao">协办单位/协办人</view>
			<uni-data-picker placeholder="请选择协办单位" popup-title="请选择协办人" :showSearch= "true" :localdata="range" v-model="value2"
				@change="onchange2" @nodeclick="onnodeclick2" @popupopened="onpopupopened2" @popupclosed="onpopupclosed2">
			</uni-data-picker>
			<view class="proINname" style="height: 100%;">
				   <view v-if="userListSelectwei.length>0" class="tag-view" v-for="(value,key) in userListSelectwei"  :key="key" @click="clearTagAdminwei(value)">
						<uni-tag :text="value.value+'/'+value.text[key]" type="primary" ></uni-tag>
						<uni-icons class="clearBtn"  type="clear" size="15" color="#ccc" />
					</view>
					<view v-if="userListSelectwei.length==0" class="tag-view" v-for="(value,key) in userListSelect"  :key="key" @click="clearTagAdmin(value)">
						<uni-tag :text="value.parent_value.organize+'/'+value.text" type="primary" ></uni-tag>
						<!-- {{value.parent_value.organize}}/{{value.text}} -->
						<uni-icons class="clearBtn"  type="clear" size="15" color="#ccc" />
					</view>
			</view>
			<!-- <view class="proMiao">协办单位</view>
			<mySelectCheckbox class="proINname" placeholder="请选择协办单位" v-model="value2" multiple dataKey="label" dataValue="value" :localdata="data2"
				@change="changeXie"></mySelectCheckbox>
			<view class="proMiao">协办人</view>
			<mySelectCheckbox class="proINname" placeholder="请选择协办人" v-model="peopleValue2" multiple dataKey="label" dataValue="value" :localdata="dataPeople"
				@change="changeXiePeo"></mySelectCheckbox> -->
			
			<view class="proMiao">项目级别</view>
			<uni-data-select class="proINname"
				v-model="jibieValue" placeholder="请选择项目级别"
				:localdata="jibie"
				@change="change"
			></uni-data-select>
			<view class="proMiao">项目来源</view>
			<uni-data-select class="proINname"
				v-model="fromValue" placeholder="请选择项目来源"
				:localdata="from"
				@change="change"
			></uni-data-select>
			<view class="proMiao">项目评分人</view>
			<uni-combox class="proINname"
			  :scorePeople="scorePeople" labelKey="label" valueKey="value"
			  placeholder="请选择项目评分人"
			  v-model="peoplescore"
			  @input="comboxInput"
			></uni-combox>
			</uni-forms-item>
			<view class="proINname" style="height: 100%;">
				   <view v-if="userListSelectweiP.length>0" class="tag-view" v-for="(value,key) in userListSelectweiP"  :key="key" @click="clearTagAdminweiP(value)">
						<uni-tag :text="value" type="primary" ></uni-tag>
						<uni-icons class="clearBtn"  type="clear" size="15" color="#ccc" />
					</view>
					<view v-if="userListSelectweiP.length==0" class="tag-view" v-for="(value,key) in scorePeople22"  :key="key" @click="clearTagAdminP(value)">
						<uni-tag :text="value" type="primary" ></uni-tag>
						<!-- {{value.parent_value.organize}}/{{value.text}} -->
						<uni-icons class="clearBtn"  type="clear" size="15" color="#ccc" />
					</view>
			</view>
			<view class="proMiao jindu">完成进度</view>
			<view class="weidu">维度权重{{weidu}}%</view>
			<view class="addRen" @click="addRen" v-if="crerenwu==1&& (select==5 || select==3)">新增任务</view>
			<!-- 任务列表 -->
			<view style="width: 100%;margin: 50rpx 0 0 20rpx;">
				<view class="renwu" v-for="(item,index) in renwu" :key="index" @click="clickRenwu(item)">
					<view>{{item.taskName}}</view>
					<view>{{item.createTime}}</view>
					<view v-if="item.finishTime!=null">{{item.finishRemark}}</view>
					<view v-if="gengrenwu==1">{{item.weight}}</view>
					<view v-if="item.state==1">已完成</view>
					<view style="color: rgba(0, 97, 255, 1);" @click.stop="updateJin(item)" v-if="gengrenwu==1&& (select==5 || select==3|| select==4)">更新进度</view>
					<view style="color: rgba(0, 97, 255, 1);" @click.stop="cuirenwu2(item)" v-if="cuirenwu==1">催办</view>
					<view style="display: flex;">
						<view class="renwu-bu bianji" v-if="item.finishTime==null&&uprenwu==1&& (select==5 || select==3)" @click.stop="bianjiRenwu(item)">编辑</view>
						<view class="renwu-bu delete" @click.stop="deleteRenwu(item)" v-if="delerenwu==1&& (select==5 || select==3)">删除</view>
					</view>
				</view>
			</view>
			
			<!-- <view style="width: 100%;margin: 50rpx 0 0 20rpx;">
				<view class="renwu" v-for="(item,index) in renwu" :key="index">
					<view>{{item.taskName}}</view>
					<view>{{item.createTime}}</view>
					<view>{{item.weight}}</view>
					<view>{{item.scoreLimit}}</view>
					<view style="color: rgba(0, 97, 255, 1);" @click="updateJin(item)" v-if="gengrenwu==1">更新进度</view>
					<view style="color: rgba(0, 97, 255, 1);" @click="cuirenwu(item)" v-if="cuirenwu==1">催办</view>
				</view>
			</view> -->
			<view class="proMiao jindu" v-if="data.progress>0">进度详情</view>
			<!-- 进度 -->
			<view style="margin: 33rpx 0 0 19rpx;" v-if="data.progress>0">
				<view v-for="(item,index) in 5" :key="index" class="jindu-kuang">
					<view style="display: flex;">
						<view class="jindu-circle"></view>
						<view>
							<view style="width: 600rpx;display: flex;justify-content: space-between;margin-top: 20rpx;">
								<view style="display: flex;">
									<view style="margin-left: 28rpx;">{{item.createName}}</view>
									<view class="jindu-type lixiang">{{item.content}}</view>
								</view>
								<!-- <view class="jindu-type cuiban">已催办</view>
								<view class="jindu-type tijiao">已提交</view> -->
								<view>{{item.createTime}}</view>
							</view>
							<view style="margin:7rpx 0 0 28rpx;">项目名：{{item.projectName}}</view>
						</view>
					</view>
					<!-- <view class="jindu-line" v-if="index<4"></view> -->
					
				</view>
			</view>
			<view class="project">
				<view class="butt queren" @click="updatePro">保存</view>
			</view>
			<view style="width: 100%;height: 60rpx;"></view>
		</view>
	</view>
</template>

<script>
	import configdata from '@/common/config.js'
	import mySelectCheckbox from '../../components/my-selectCheckbox.vue'
	export default {
		components:{mySelectCheckbox},
		data() {
			return {
				data:{},
				//主办单位
				value: '1-2',
				range: [],
				//主办人
				peopleValue:'',
				rangePeople:[],
				userListSelect1:[],
				userListSelectwei1:[
					{value:'',text:''},
				],
				//协办
				value2:'',
				userListSelect:[],
				userListSelectwei:[
					{value:'',text:''},
				],
				data2: [],
				xieban:[],//协办传入值数组
				xieValue:[],//协办传入id
				//协办人
				peopleValue2:[],
				dataPeople: [],
				xiebanPeople:[],//协办传入值数组
				xieValuePeople:[],//协办传入id
				//评分人
				peoplescore:[],
				scorePeople: [],
				scorePeople22:[],//协办传入值数组
				userListSelectweiP:[],
				scoreValuePeople:[],//协办传入id
				// 项目级别
				jibieValue:0,
				jibie:[
					{ value: 0, text: "正常" },
					{ value: 1, text: "紧急" },
				],
				// 项目来源
				fromValue:0,
				from:[
					{ value: 0, text: "涉内" },
					{ value: 1, text: "涉外" },
				],
				fileList2: [],
				fileList22:'',
				// fileList: [
				// 	{name:'111'},
				// 	{name:'333'}
				// ],
				listStyles: {
					"borderStyle": {
						"width": "0", // 边框宽度
					},
					"border": false, // 是否显示边框
					"dividline": false
				},
				renwu:[],
				
				weidu:'',
				
				crerenwu:1,//添加任务
				uprenwu:1,//修改任务
				delerenwu:1,//是否删除任务
				cuirenwu:1,//催办任务
				gengrenwu:1,//是否更新任务
				select:0,//状态
			}
		},
		onShow() {
			// console.log('aa',sessionStorage.getItem("crerenwu"))
			this.crerenwu=sessionStorage.getItem("crerenwu")
			this.uprenwu=sessionStorage.getItem("uprenwu")
			this.delerenwu=sessionStorage.getItem("delerenwu")
			this.cuirenwu=sessionStorage.getItem("cuirenwu")
			this.gengrenwu=sessionStorage.getItem("gengrenwu")
			this.getPeopleZhu()
		},
		onLoad(option) {
			this.select=option.select
			
			console.log(JSON.parse(decodeURIComponent(option.data)))
			var wei=JSON.parse(decodeURIComponent(option.weidu))
			this.data=JSON.parse(decodeURIComponent(option.data))
			this.weidu=(wei[2].configValue)
			// this.getDanwei()
			this.getPeople(this.data.organize)
			for(var i=0;i<this.jibie.length;i++){
				if(this.jibie[i].text==this.data.projectLevel){
					this.jibieValue=this.jibie[i].value
				}
			}
			for(var i=0;i<this.from.length;i++){
				if(this.from[i].text==this.data.projectFrom){
					this.fromValue=this.from[i].value
				}
			}
			var image=[]
			image=this.data.fileUrl.split(',')
			this.fileList2 =image.map(item =>{
				return {
					name: item
				}
			})
			this.fileList22=image.join(",")
			console.log(this.fileList2)
			this.getRenwu()
			
			console.log(this.data.coOrganize.split(','))
			// this.userListSelect=
			this.userListSelectwei=[]
			this.userListSelectwei1=[]
			this.userListSelectweiP=[]
			var zhuban=[]
			var zhubanpeo=[]
			var zhubanV=[]
			zhuban=this.data.organize.split(',')
			zhubanpeo=this.data.sposonerName.split(',')
			zhubanV=this.data.sposoner.split(',')
			this.userListSelectwei1=zhuban.map(item =>{
				console.log(item)
				return {
					value: item,
					text:zhubanpeo,
					id:zhubanV
				}
			})
			var xieban=[]
			var xiebanpeo=[]
			var xiebanV=[]
			xieban=this.data.coOrganize.split(',')
			xiebanpeo=this.data.coSposonerName.split(',')
			xiebanV=this.data.coSposoner.split(',')
			this.userListSelectwei=xieban.map(item =>{
				console.log(item)
				return {
					value: item,
					text:xiebanpeo,
					id:xiebanV
				}
			})
			var pingpeo=[]
			pingpeo=this.data.scorerName.split(',')
			this.userListSelectweiP=pingpeo
			// for(var i=0;i<xieban.length;i++){
			// 	// for(var j=0;j<xiebanpeo.length;j++){
			// 		// this.userListSelectwei.push({value:xieban[0]},{text:xiebanpeo[0]})
			// 	// }
			// }
			// this.userListSelectwei.push({value:xieban[0]},{text:xiebanpeo[0]})
			// xieban.map(item =>{
			// 	tt.push({value:item})
			// 	// return {
			// 	// 	value: item2,
			// 	// 	text: item,
			// 	// }
			// })
			// this.userListSelectwei=tt
			console.log(this.userListSelectwei,'t')
			// xiebanpeo.map(item =>{
			// 	this.userListSelectwei.push({text:item})
			// 	// return {
			// 	// 	value: item2,
			// 	// 	text: item,
			// 	// }
			// })
			// this.userListSelectwei=xiebanpeo.map(item =>{
			// 	return {
			// 		value: item,
			// 	}
			// })
			// this.userListSelectwei.push(xieban,xiebanpeo)
			console.log(this.userListSelectwei,'p')
		},
		methods: {
			 change(e) {
			  console.log("e:", e);
			},
			//主办人
			onnodeclick(data) {
				console.log(data);
				if(data.parent_value){//存在父级
				  let dataId = data.value;
				  this.userListSelect1.push(data);
				  this.userListSelect1 = [...new Set(this.userListSelect1)]//es6数组去重
				  this.userListSelectwei1=[]
				}
				console.log(this.userListSelectwei1,'多选',this.userListSelect1)
			},
			onpopupopened(e) {
				console.log('popupopened');
			},
			onpopupclosed(e) {
				console.log('popupclosed');
			},
			onchange(e) {
				console.log('---------onchange:', e);
				var acc=e.detail.value[0].text
				this.getPeople(acc)
			},
			//主办人
			clearTagAdmin(value){
				this.userListSelect1 = this.userListSelect1.filter(item => item != value);
			},
			clearTagAdminwei(value){
				this.userListSelectwei1 = this.userListSelectwei1.filter(item => item != value);
			},
			//协办人
			clearTagAdmin(value){
				this.userListSelect = this.userListSelect.filter(item => item != value);
			},
			clearTagAdminwei1(value){
				this.userListSelectwei = this.userListSelectwei.filter(item => item != value);
			},
			onnodeclick2(data) {
				console.log(data);
				if(data.parent_value){//存在父级
				  let dataId = data.value;
				  this.userListSelect.push(data);
				  this.userListSelect = [...new Set(this.userListSelect)]//es6数组去重
				  this.userListSelectwei=[]
				}
				console.log(this.userListSelectwei,'多选',this.userListSelect)
			
			},
			onpopupopened2(e) {
				console.log('popupopened');
			},
			onpopupclosed2(e) {
				console.log('popupclosed');
			},
			onchange2(e) {
				console.log('---------onchange:', e);
			},
			// @input	combox输入事件	返回combox值
			comboxInput(e) {
				console.log('e:', e);
			  // this.peoplescore=e
			  // this.scorePeople22=[]
			  // this.scoreValuePeople=[]
			  for(var i=0;i<this.scorePeople.length;i++){
				  if(e==this.scorePeople[i].value){
					  this.userListSelectweiP=[]
					  this.scorePeople22.push(this.scorePeople[i].label)
					  this.scoreValuePeople.push(this.scorePeople[i].value)
				  }
			  }
			  console.log(this.scorePeople22)
			},
			clearTagAdminP(value){
				this.scorePeople22 = this.scorePeople22.filter(item => item != value);
			},
			clearTagAdminweiP(value){
				this.userListSelectweiP = this.userListSelectweiP.filter(item => item != value);
			},
			//新增任务
			addRen(){
				var shuzu=[
					{userName:'',department:'',id:''}
				]
				var xieban=[]
				var xiebanpeo=[]
				var tt=[]
				var xiebanV=[]
				var a1=this.data.sposonerName+','+this.data.coSposonerName
				var a2=this.data.organize+','+this.data.coOrganize
				var a3=this.data.sposoner+','+this.data.coSposoner
				xieban=a1.split(',')
				xiebanpeo=a2.split(',')
				xiebanV=a3.split(',')
				shuzu=xieban.map(item =>{
					console.log(item)
					return {
						userName: item,
					}
				})
				shuzu.forEach((item,index) => {
					console.log(item);
					this.$set(item,"department",xiebanpeo[index])
					this.$set(item,"id",xiebanV[index])
				})
				let t2=JSON.stringify(shuzu)
				//这里———————————————————————————
				let query2 = encodeURIComponent(t2)
				uni.navigateTo({
					url:'/pages/project/addRenwu?proId='+this.data.id+'&people='+query2
				})
			},
			//编辑任务
			bianjiRenwu(item){
				var shuzu=[
					{userName:'',department:'',id:''}
				]
				var xieban=[]
				var xiebanpeo=[]
				var tt=[]
				var xiebanV=[]
				var a1=this.data.sposonerName+','+this.data.coSposonerName
				var a2=this.data.organize+','+this.data.coOrganize
				var a3=this.data.sposoner+','+this.data.coSposoner
				xieban=a1.split(',')
				xiebanpeo=a2.split(',')
				xiebanV=a3.split(',')
				shuzu=xieban.map(item =>{
					console.log(item)
					return {
						userName: item,
					}
				})
				shuzu.forEach((item,index) => {
					console.log(item);
					this.$set(item,"department",xiebanpeo[index])
					this.$set(item,"id",xiebanV[index])
				})
				let t2=JSON.stringify(shuzu)
				//这里———————————————————————————
				let query2 = encodeURIComponent(t2)
				
				//传参对象，使用encodeURIComponent编码
				let str = JSON.stringify(item)
				//注意这里——————————————————————
				str = str.replace(/%/g, '%25')
				//这里———————————————————————————
				let query = encodeURIComponent(str)
				uni.navigateTo({
					url:'/pages/project/changeRenwu?data='+query+'&people='+query2
				})
			},
			//删除任务
			deleteRenwu(item){
				let that = this
				uni.showModal({
					title: '提示',
					content: '确定删除任务吗？',
					success: function(res) {
						if (res.confirm) {
							console.log('用户点击确定');
							uni.showLoading({
								title: '加载中',
								mask: true, // 是否显示透明蒙层，防止触摸穿透
							});
							let data={
								id:item.id,
							}
							that.$Request.postT('/api/sysTask/del',data).then(res => {
								if (res.code==200) {
									uni.showToast({
										title: '删除成功',
										icon: 'none',
										duration:800
									});
									uni.hideLoading()
													
									setTimeout(function() {
										that.getRenwu()
									}, 1000)
								} else {
									uni.hideLoading();
									uni.showToast({
										title: res.message,
										icon: 'none',
										duration:800
									});
								}
							});
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				})
			},
			//任务详情
			clickRenwu(item){
				var shuzu=[
					{userName:'',department:'',id:''}
				]
				var xieban=[]
				var xiebanpeo=[]
				var tt=[]
				var xiebanV=[]
				var a1=this.data.sposonerName+','+this.data.coSposonerName
				var a2=this.data.organize+','+this.data.coOrganize
				var a3=this.data.sposoner+','+this.data.coSposoner
				xieban=a1.split(',')
				xiebanpeo=a2.split(',')
				xiebanV=a3.split(',')
				shuzu=xieban.map(item =>{
					console.log(item)
					return {
						userName: item,
					}
				})
				shuzu.forEach((item,index) => {
					console.log(item);
					this.$set(item,"department",xiebanpeo[index])
					this.$set(item,"id",xiebanV[index])
				})
				let t2=JSON.stringify(shuzu)
				//这里———————————————————————————
				let query2 = encodeURIComponent(t2)
				
				//传参对象，使用encodeURIComponent编码
				let str = JSON.stringify(item)
				//注意这里——————————————————————
				str = str.replace(/%/g, '%25')
				//这里———————————————————————————
				let query = encodeURIComponent(str)
				uni.navigateTo({
					url:'/pages/project/renwuX?data='+query+'&people='+query2
				})
			},
			//更新进度
			updateJin(item){
				//传参对象，使用encodeURIComponent编码
				let str = JSON.stringify(item)
				//注意这里——————————————————————
				str = str.replace(/%/g, '%25')
				//这里———————————————————————————
				let query = encodeURIComponent(str)
				uni.navigateTo({
					url:'/pages/project/renwuUpdateJin?data='+query
				})
			},
			//催办任务
			cuirenwu2(item){
				let that = this
				uni.showModal({
					title: '提示',
					content: '确定催办任务吗？',
					success: function(res) {
						if (res.confirm) {
							console.log('用户点击确定');
							uni.showLoading({
								title: '加载中',
								mask: true, // 是否显示透明蒙层，防止触摸穿透
							});
							let data={
								taskId:item.id,
							}
							that.$Request.postT('/api/sysTask/urge',data).then(res => {
								if (res.code==200) {
									uni.showToast({
										title: '催办成功',
										icon: 'none',
										duration:800
									});
									uni.hideLoading()
													
									setTimeout(function() {
										that.getRenwu()
									}, 1000)
								} else {
									uni.hideLoading();
									uni.showToast({
										title: res.message,
										icon: 'none',
										duration:800
									});
								}
							});
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				})
			},
			//获取单位
			getDanwei(){
				this.range=[]
				this.data2=[]
				uni.showLoading({
					title: '加载中',
					mask: true, // 是否显示透明蒙层，防止触摸穿透
				});
				this.$Request.postT('/api/Organize/query').then(res => {
					if (res.code==200&&res.data) {
						this.range =res.data.map(item =>{
							return {
								value: item.id,
								text: item.oname,
								id:item.oid
							}
						})
						this.data2 =res.data.map(item =>{
							return {
								value: item.id,
								label: item.oname,
								id:item.oid
							}
						})
						for(var i=0;i<this.range.length;i++){
							if(this.range[i].text==this.data.organize){
								this.value=this.range[i].value
							}
						}
						// for(var i=0;i<this.data2.length;i++){
						// 	if(this.data2[i].label==this.data.){
						// 		this.value2=this.data2[i].value
						// 	}
						// }
					}
					uni.hideLoading();
					
				});
			},
			//获取主办协办人
			getPeopleZhu(){
				this.range=[]
				this.rangePeople=[]
				uni.showLoading({
					title: '加载中',
					mask: true, // 是否显示透明蒙层，防止触摸穿透
				});
				this.$Request.postJson('/api/sysProject/queryCoUsers',{}).then(res => {
					if (res.code==200) {
						var lianji=[]
						for(var i=0;i<res.data.length;i++){
							if(res.data[i].userList.length>0){
								lianji.push(res.data[i])
							}
						}
						this.range =lianji.map(item =>{
							return {
								value: item,
								text: item.organize,
								children:item.userList.map(item =>{
									return{
										value: item.id,
										text: item.userName,
									}
								})
							}
						})
						
						console.log(this.range,'人')
						this.value=parseInt(this.data.sposoner)//25
						this.userListSelect1={
							parent_value:{
								organize:this.data.organize
							}
						}
					}else{
						var ii=JSON.stringify(res)
						console.log(res,res.data)
						console.log(JSON.parse(res))
						console.log(JSON.parse(ii))
					}
					uni.hideLoading();
				});
			},
			//根据单位获取人员(评分人)
			getPeople(acc){
				console.log(this.userListSelect1)
				this.scorePeople=[]
				uni.showLoading({
					title: '加载中',
					mask: true, // 是否显示透明蒙层，防止触摸穿透
				});
				this.$Request.postT('/api/sysUser/queryScorer',{
					organizes:acc
				}).then(res => {
					if (res.code==200) {
						console.log(res,'评分')
						this.scorePeople =res.data.map(item =>{
							return {
								value: item.id,
								label: item.userName,
							}
						})
						console.log(this.scorePeople,'人')
						
						// var people=[]
						// people=this.data.scorerName.split(',')
						// for(var j=0;j<this.scorePeople.length;j++){
						// 	for(var i=0;i<people.length;i++){
						// 		console.log(this.scorePeople[j].label,'ll',people[i])
						// 		if(this.scorePeople[j].label==people[i]){
						// 			this.peoplescore.push(this.scorePeople[j].value)
						// 			this.scoreValuePeople.push(this.scorePeople[j].value)
						// 		}
						// 	}
						// }
					}else{
						var ii=JSON.stringify(res)
						console.log(res,res.data)
						console.log(JSON.parse(res))
						console.log(JSON.parse(ii))
					}
					uni.hideLoading();
				});
			},
			// 查找任务
			getRenwu(){
				let that = this
				that.renwu=[]
				uni.showLoading({
					title: '加载中',
					mask: true, // 是否显示透明蒙层，防止触摸穿透
				});
				var data={
					"projectId": that.data.id
				}
				that.$Request.postT('/api/sysTask/queryTaskByProject',data).then(res => {
					if (res.code==200) {
						that.renwu=res.data
						console.log(that.renwu,'任务')
					}
					uni.hideLoading();
				});
			},
			// 上传附件
			uploadSuccess(e) {
			console.log('上传成功', e)
			},
			uploadFail(e) {
				console.log('上传失败：', e)
			},
			//保存编辑项目
			updatePro(){
				console.log(this.userListSelectwei)
				var xieban=[]
				var xiebanValue=[]
				if(this.userListSelectwei.length>0){
					this.userListSelectwei.map(item =>{
						xieban.push(item.value)
						xiebanValue.push(item.id[0])
					})
				}else{
					this.userListSelect.map(item =>{
						xieban.push(item.parent_value.organize)
						xiebanValue.push(item.value)
					})
				}
				var zhuban=[]
				var zhubanValue=[]
				if(this.userListSelectwei1.length>0){
					this.userListSelectwei1.map(item =>{
						zhuban.push(item.value)
						zhubanValue.push(item.id[0])
					})
				}else{
					this.userListSelect1.map(item =>{
						zhuban.push(item.parent_value.organize)
						zhubanValue.push(item.value)
					})
				}
				console.log(this.userListSelect1,this.value)
				let that = this
				if (!that.data.projectName) {
					that.$queue.showToast("请输入项目标题");
				}else if (!that.data.projectContent) {
					that.$queue.showToast("请输入项目描述");
				}else {
					uni.showLoading({
						title: '加载中',
						mask: true, // 是否显示透明蒙层，防止触摸穿透
					});
					that.$Request.postJson("/api/sysProject/update", {
						"id": that.data.id,
						"projectName": that.data.projectName,   // 项目名称
						"projectFrom": that.from[that.fromValue].text,    // 项目来源
						"projectLevel": that.jibie[that.jibieValue].text,    // 项目等级
						"projectContent": that.data.projectContent,    // 项目描述
						"fileUrl": that.fileList22,   // 附件
						"organize": zhuban.join(","),   // 主办单位-单选
						"sposoner": zhubanValue.join(","),   // 主办人ID-单选
						"coOrganize": xieban.join(","),   // 协办单位-多选
						"coSposoner": xiebanValue.join(",")    ,// 协办人ID-多选
						"scorer": that.scoreValuePeople.join(",")   // 评分人ID-多选
					}).then(res => {
						if (res.code == 200) {
							uni.showToast({
								title: '修改成功',
								icon: 'none',
								duration:800
							});
							uni.hideLoading()
				
							setTimeout(function() {
								uni.switchTab({
									url:'/pages/project/index'
								})
							}, 1000)
						} else {
							uni.hideLoading();
							uni.showToast({
								title: res.message,
								icon: 'none',
								duration:800
							});
						}
					});
				}
			},
			//删除文件
			deleteHandle(index){
				console.log(index)
				this.fileList2.splice(index.index,1)
				console.log(this.fileList2)
				this.fileList22=this.fileList2.join(",")
			},
			async selectUpload(e) {
				console.log('上传：', e)
				 let data = new FormData();
				  data.set("file", e.tempFiles[0].file);
				  let res = await this.$axios({
				    method: "post",
				    url: this.config('APIHOST1') + "/api/sysFile/upload",
				    headers: {
						tokenW: sessionStorage.getItem("token"),
						"Content-Type": "multipart/form-data"
				    },
				    data: data,
				  });
					// return res
				  console.log(res, "图片上传成功");
				  if (res.data.code == 200) {
					console.log(this.fileList2)
				    this.fileList2.push(res.data.data);
					this.fileList22=this.fileList2.join(",")
					// console.log(this.fileList2.join(","))
				  } else if(res.message=="登录凭证已过去，请重新登录"){
					sessionStorage.removeItem("token")
					sessionStorage.removeItem("roleId")
					uni.showModal({
						title: '提示',
						content: '用户信息失效，请重新登录！',
						showCancel: false, // 是否显示取消按钮，默认为 true // 是否显示取消按钮，默认为 true
						success: function(res) {
							if (res.confirm) {
							}
						}
					});
				   }else {
			    		uni.showToast({
							title: res.message,
							icon: 'none',
							duration:800
						});
				    }
			},
			config: function (name) {
				var info = null
				if (name) {
					var name2 = name.split('.') //字符分割
					if (name2.length > 1) {
						info = configdata[name2[0]][name2[1]] || null
					} else {
						info = configdata[name] || null
					}
					if (info == null) {
						let web_config = cache.get('web_config')
						if (web_config) {
							if (name2.length > 1) {
								info = web_config[name2[0]][name2[1]] || null
							} else {
								info = web_config[name] || null
							}
						}
					}
				}
				return info
			},
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
	.param{
		margin: 20rpx 0 0 0;
		width: 100%;
		background-color: rgba(255, 255, 255, 1);
		font-size: 28rpx;
		font-weight: 400;
		line-height: 41rpx;
		color: rgba(0, 0, 0, 1);
	}
	.all-text{
		margin: 22rpx 0 0 20rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: rgba(0, 0, 0, 1);
	}
	.proName{
		margin: 23rpx 0 0 20rpx;
	}
	.proINname{
		margin: 25rpx 0 0 21rpx;
		width: 709rpx;
		height: 90rpx;
		border-radius: 13rpx;
		background: rgba(245, 248, 252, 1);
		border: 1rpx solid rgba(229, 229, 229, 1);
		font-size: 28rpx;
		line-height: 90rpx;
		/* 自动换行 */
		word-wrap: break-word;
		word-break: break-all;
		white-space: pre-line;
		/* color: rgba(179, 179, 179, 1); */
	}
	.proIMi{
		height: 315rpx;
	}
	.proMiao{
		margin: 31rpx 0 0 20rpx;
	}
	/* 上传附件 */
	.upload-img{
		/* width: 200rpx;
		height: 80rpx;
		opacity: 1;
		border-radius: 13rpx;
		background: rgba(0, 97, 255, 0.1);
		border: 1rpx solid rgba(0, 97, 255, 1); */
	}
	.jindu{
		font-size: 32rpx;
		font-weight: 500;
		line-height: 46rpx;
	}
	/* 进度 */
	.jindu-kuang{
		font-size: 24rpx;
		line-height: 35rpx;
		color: rgba(128, 128, 128, 1);
	}
	.jindu-circle{
		margin-top: 10rpx;
		width: 100rpx;
		height: 100rpx;
		border-radius: 50%;
		opacity: 1;
		background-color:rgba(204, 204, 204, 1);
	}
	.jindu-type{
		/* width: 103rpx; */
		height: 40rpx;
		border-radius: 71rpx;
		font-size: 24rpx;
		line-height: 40rpx;
		color: rgba(255, 255, 255, 1);
		text-align: center;
		margin: 0 0 0 20rpx;
	}
	.lixiang{
		background: linear-gradient(90deg, rgba(54, 111, 255, 1) 0%, rgba(93, 160, 252, 1) 100%);
	}
	.cuiban{
		background: linear-gradient(90deg, rgba(57, 167, 139, 1) 0%, rgba(126, 224, 203, 1) 100%);
	}
	.tijiao{
		background: linear-gradient(90deg, rgba(255, 112, 69, 1) 0%, rgba(247, 161, 114, 1) 100%);
	}
	.jindu-line{
		width: 4rpx;
		height: 100rpx;
		background-color: rgba(166, 166, 166, 1);
	}
	.weidu{
		margin: 7rpx 0 0 20rpx;
		font-size: 24rpx;
		line-height: 35rpx;
		color: rgba(128, 128, 128, 1);
	}
	.addRen{
		margin: -80rpx 0 0 581rpx;
		width: 149rpx;
		height: 59rpx;
		border-radius: 92rpx;
		background: rgba(0, 97, 255, 1);
		font-size: 28rpx;
		line-height: 59rpx;
		color: rgba(255, 255, 255, 1);
		text-align: center;
	}
	/* 任务列表 */
	.renwu{
		display: flex;
		margin-top: 6rpx;
		width: 709rpx;
		height: 90rpx;
		border-radius: 13rpx;
		background: rgba(245, 248, 252, 1);
		border: 1rpx solid rgba(229, 229, 229, 1);
		font-size: 28rpx;
		justify-content: space-evenly;
		align-items: center;
	}
	.renwu-bu{
		width: 105rpx;
		height: 50rpx;
		border-radius: 110rpx;
		line-height:50rpx;
		text-align: center;
	}
	.bianji{
		border: 1rpx solid rgba(0, 97, 255, 1);
		color: rgba(0, 97, 255, 1);
	}
	.delete{
		margin-left: 20rpx;
		border: 1rpx solid rgba(212, 48, 48, 1);
		color: rgba(212, 48, 48, 1);
	}
	.project{
		display: flex;
		margin: 61rpx 0 0 0;
		justify-content: space-evenly;
	}
	.butt{
		width: 330rpx;
		height: 90rpx;
		border-radius: 117rpx;
		font-size: 32rpx;
		line-height: 90rpx;
		text-align: center;
	}
	.quxiao{
		border: 1rpx solid rgba(0, 97, 255, 1);
		color: rgba(0, 97, 255, 1);
	}
	.queren{
		background: rgba(0, 97, 255, 1);
		color: rgba(255, 255, 255, 1);
	}
</style>