<template>
	<view>
		<cu-custom bgColor="bg-gradual-blueness" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">延期申请</block>
		</cu-custom>
		<scroll-view scroll-y>
			<view class="de-card-list de-list">
				<view class="de-item">
					<text class="text-semi">{{pd.HIDDENDESCR}}</text>
				</view>
				<view class="de-item">
					<view class="de-sub-title">
						<text class="text-grey">隐患来源</text>
					</view>
					<view class="uni-flex-item text-right">
						<text v-if="pd.SOURCE=='1'" class="text-semi">隐患快报</text>
						<text v-if="pd.SOURCE=='2' || pd.SOURCE=='3'" class="text-semi">清单排查</text>
						<text v-if="pd.SOURCE=='4'" class="text-semi">安全环保检查(监管端)</text>
						<text v-if="pd.SOURCE=='5'" class="text-semi">安全环保检查(企业端)</text>
					</view>
				</view>
				<view class="de-item" v-if="pd.SOURCE==2">
					<view class="de-sub-title">
						<text class="text-grey">风险点(单元)</text>
					</view>
					<view class="uni-flex-item text-right">
						<text class="text-semi">{{pd.RISK_UNIT}}</text>
					</view>
				</view>
				<view class="de-item" v-if="pd.SOURCE==2">
					<view class="de-sub-title">
						<text class="text-grey">辨识部位</text>
					</view>
					<view class="uni-flex-item text-right">
						<text class="text-semi">{{pd.IDENTIFICATION}}</text>
					</view>
				</view>
				<view class="de-item-sp" v-if="pd.SOURCE==2">
					<view class="de-sub-title">
						<text class="text-grey">存在风险</text>
					</view>
					<view class="de-sub-content">
						<text class="text-semi">{{pd.RISK_DESCR}}</text>
					</view>
				</view>
				<view class="de-item">
					<view style="width: 200px" class="de-sub-title">
						<text class="text-grey">隐患上报位置(经纬度)</text>
					</view>
					<view class="uni-flex-item text-right" v-if="pd.LONGITUDE">
						<text class="text-semi">
							{{ pd.LONGITUDE &&
							pd.LONGITUDE.length>6?pd.LONGITUDE.substr(0,6):pd.LONGITUDE}},{{pd.LATITUDE &&
							pd.LATITUDE.length>6?pd.LATITUDE.substr(0,6):pd.LATITUDE}}
						</text>
					</view>
				</view>
				<view class="de-item" v-if="pd.SOURCE==2">
					<view class="de-sub-title">
						<text class="text-grey">风险分级</text>
					</view>
					<view class="uni-flex-item text-right">
						<text class="text-semi">{{pd.LEVEL}}</text>
					</view>
				</view>
				<view class="de-item-sp" v-if="pd.SOURCE==2">
					<view class="de-sub-title">
						<text class="text-grey">检查内容</text>
					</view>
					<view class="de-sub-content">
						<text class="text-semi">{{pd.CHECK_CONTENT}}</text>
					</view>
				</view>
				<!-- 				<view class="de-item-sp">
                                    <view class="de-sub-title">
                                        <text class="text-grey">隐患描述</text>
                                    </view>
                                    <view class="de-sub-content">
                                        <text class="text-semi">{{pd.HIDDENDESCR}}</text>
                                    </view>
                                </view> -->
				<view class="de-item">
					<view class="de-sub-title">
						<text class="text-grey">隐患部位</text>
					</view>
					<view class="uni-flex-item text-right">
						<text class="text-semi">{{pd.hregionName}}</text>
					</view>
				</view>
				<view class="de-item">
					<view class="de-sub-title">
						<text class="text-grey">隐患类型</text>
					</view>
					<view class="uni-flex-item text-right">
						<text class="text-semi">{{pd.HIDDENTYPENAME}}</text>
					</view>
				</view>
				<!--<view class="de-item">
                    <view class="de-sub-title">
                        <text class="text-grey">隐患类型2</text>
                    </view>
                    <view class="uni-flex-item text-right">
                        <text class="text-semi">{{pd.HIDDENTYPENAME2}}</text>
                    </view>
                </view>-->
				<view class="de-item">
					<view class="de-sub-title">
						<text class="text-grey">隐患级别</text>
					</view>
					<view class="uni-flex-item text-right">
						<text  class="text-semi">{{pd.editLevelName}}</text>
					</view>
				</view>
				<view class="de-item" v-for="(item, index) in hiddenFindPeople" :key="index">
					<view class="de-sub-title">
						<text class="text-grey">隐患发现人</text>
					</view>
					<view class="uni-flex-item text-right">
						<text class="text-semi">{{item.NAME}}</text>
					</view>
				</view>
				<view class="de-item">
					<view class="de-sub-title">
						<text class="text-grey">隐患发现时间</text>
					</view>
					<view class="uni-flex-item text-right">
						<text class="text-semi">{{formatDate(pd.DISCOVERYTIME)}}</text>
					</view>
				</view>
				<view class="de-item">
					<view class="de-sub-title">
						<text class="text-grey">整改类型</text>
					</view>
					<view class="uni-flex-item text-right">
						<text v-if="pd.RECTIFICATIONTYPE=='1'" class="text-semi">立即整改</text>
						<text v-else-if="pd.RECTIFICATIONTYPE=='2'" class="text-semi">限期整改</text>
					</view>
				</view>
				<view class="de-item">
					<view class="de-sub-title">
						<text class="text-grey">整改负责部门</text>
					</view>
					<view class="uni-flex-item text-right">
						<text class="text-semi">{{pd.editDeptName}}</text>
					</view>
				</view>
				<view class="de-item">
					<view class="de-sub-title">
						<text class="text-grey">整改负责人</text>
					</view>
					<view class="uni-flex-item text-right">
						<text class="text-semi">{{pd.editUserName}}</text>
					</view>
				</view>
				<view v-if="pd.RECTIFICATIONTYPE=='2'" class="de-item">
					<view class="de-sub-title">
						<text class="text-grey">整改期限</text>
					</view>
					<view class="uni-flex-item text-right">
						<text class="text-semi">{{pd.editRectificationDeadline }}</text>
					</view>
				</view>
				<view class="de-item">
					<view class="de-sub-title">
						<text class="text-grey">是否相关方</text>
					</view>
					<view class="uni-flex-item text-right">
						<text v-if="pd.ISRELEVANT=='1'" class="text-semi">是</text>
						<text v-else-if="pd.ISRELEVANT=='2'" class="text-semi">否</text>
					</view>
				</view>
				<view class="de-item-sp">
					<view class="de-sub-title">
						<text class="text-grey">隐患照片</text>
					</view>
					<view class="de-sub-content">
						<scroll-view scroll-x class="bg-white nav" scroll-with-animation>
							<view class="cu-item" v-for="(item,index) in files" v-bind:key="index">
								<view class="imgs">
									<image :src="baseImgPath+item.FILEPATH" :data-index="index" @click="ViewShowImage"
										   mode=""></image>
								</view>
							</view>
						</scroll-view>
					</view>
				</view>

				<view class="de-item-sp" v-if="hiddenVideo.length>0">
					<view class="de-sub-title">
						<text class="text-grey">隐患视频</text>
					</view>
					<view class="de-sub-content" style="background-color: #000;width: 120upx;">
						<image src="/static/icon-apps/video.png" mode="aspectFill" @click="playVideo"
							   :data-src="baseImgPath + hiddenVideo[0].FILEPATH"
							   style="width: 120upx;height: 120upx;"></image>
					</view>
				</view>
				<view class="de-item" @click="seeHiddenConfirm=='2'?seeHiddenConfirm='1':seeHiddenConfirm='2'" >
					<view class="de-sub-title">
						<text class="text-grey">隐患确认信息</text>
					</view>
					<view class="uni-flex-item text-right">
						<a>查看</a>
					</view>
				</view>
			</view>

			<view class="de-card-list de-list" v-if="seeHiddenConfirm=='1'">
				<view class="de-title">
					<text class="text-semi">隐患确认</text>
				</view>
				<view class="cu-form-group margin-top" >
					<view class="title">隐患级别</view>
					<view class="picker-tree-box" >
						<view class="uni-flex-item text-right">
							<text class="text-semi">{{pd.HIDDENLEVELNAME}}</text>
						</view>
					</view>
				</view>
				<view class="cu-form-group margin-top" >
					<view class="title">整改负责人部门</view>
					<view class="picker-tree-box">
						<view class="uni-flex-item text-right">
							<text class="text-semi">{{pd.RECTIFICATIONDEPTNAME}}</text>
						</view>
					</view>
				</view>
				<view class="cu-form-group">
					<view class="title">整改负责人:</view>
					<view class="picker-tree-box">
						<view class="uni-flex-item text-right">
							<text class="text-semi">{{pd.RECTIFICATIONORNAME}}</text>
						</view>
					</view>
				</view>
				<view class="cu-form-group margin-top" >
					<view class="title">整改期限</view>
					<view class="picker-tree-box">
						<view class="uni-flex-item text-right">
							<text class="text-semi">{{pd.RECTIFICATIONDEADLINE}}</text>
						</view>
					</view>
				</view>
				<view class="cu-form-group margin-top" >
					<view class="title">隐患确认人</view>
					<view class="picker-tree-box">
						<view class="uni-flex-item text-right">
							<text class="text-semi">{{pd.conUserName}}</text>
						</view>
					</view>
				</view>
				<view class="cu-form-group margin-top" >
					<view class="title">隐患确认时间</view>
					<view class="picker-tree-box">
						<view class="uni-flex-item text-right">
							<text class="text-semi">{{pd.CONFIRM_TIME}}</text>
						</view>
					</view>
				</view>
			</view>
            <view class="cu-form-group margin-top">
                <view class="title text-hui">延期时间</view>
				<ruiDatePicker :start="todayDate" fields="minute" :value="pd.DELAY_TIME || '请选择'"
							   @change="changeDelayTimeDate"></ruiDatePicker>
            </view>
			<view class="cu-form-textarea">
				<view class="cu-form-title text-grey">处置方案</view>
				<textarea maxlength="-1" v-model="pd.disposalPlan" placeholder="请输入处置方案"></textarea>
			</view>
			<view class="padding flex flex-direction bf">
				<button class="cu-btn bg-green margin-tb-sm lg" @click="$noMultipleClicks(goSubmit)">提 交</button>
			</view>
			<view class="cu-tabbar-height"></view>
		</scroll-view>
		<view :class="['cu-modal',{'show':modalShow}]" v-if="modalShow">
			<view class="cu-dialog">
				<view class="cu-bar bg-white justify-end">
					<view class="content">播放视频</view>
					<view class="action" @tap="modalShow = false">
						<text class="cuIcon-close text-red"></text>
					</view>
				</view>
				<video :src="videoSrc" :autoplay="true"></video>
				<view class="cu-bar bg-white justify-end">
					<view class="action">
						<button class="cu-btn line-green text-green" @click="modalShow = false">关闭</button>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import ruiDatePicker from '@/components/rattenking-dtpicker/rattenking-dtpicker.vue';
	import {
		basePath,corpinfoId,loginSession,loginUser,baseImgPath,formatDate
	} from '@/common/tool.js';
	import lFile from '@/components/l-file/l-file.vue'
	import tkiTree from "@/components/select-tree/select-tree.vue"
	export default {
		components: {
			tkiTree,lFile,ruiDatePicker
		},
		data() {
			return {
				noClick: true,
				date: '',
				RECTIFICATIONTIME: '',
				imgList: [],
				imgList_fa: [],
				id: '',
				pd: [],
				files: [],
				hiddenVideo:[],
				RECTIFYDESCR: '',
				basePath:basePath,
				baseImgPath:baseImgPath,
				HAVESCHEME:'0',
				HIDDENSCHEME_ID:'',
				treeNode:[],//部门下拉数据
				uindex: -1,
                IS_NORMAL:1,
				rectificationUserList:[],
				other:[{"DEPARTMENT_ID":'',"USER_ID":'',"DEPARTMENT_NAME":'',"USER_NAME":'',index:-1}],//其他验收人员
				otherUserList:[],
				todayDate: formatDate(new Date(), 'yyyy-MM-dd hh:mm'),
				modalShow: false,
				videoSrc: '',
				hiddenFindPeople: [], //隐患发现人
				seeHiddenConfirm:'2'
			}
		},
		onLoad(e) {
			this.id = e.id;
			// let now = new Date();
			// this.date = formatDate(now, 'yyyy-MM-dd');

			this.getData();
			this.getDept();
			loginSession();
		},

		methods: {
			getData() {
				var _this = this;
				uni.showLoading({
					title: '请稍候'
				})
				uni.request({
					url: basePath + '/app/hidden/goEdit',
					method: 'POST',
					dataType: 'json',
					header: {
						'Content-type': 'application/x-www-form-urlencoded'
					},
					data: {
						HIDDEN_ID: _this.id,
					},
					success: (res) => {
						if ("success" == res.data.result) {
							uni.hideLoading();
							_this.pd = res.data.pd; //参数map
							_this.files = res.data.hImgs;
							_this.hiddenVideo = res.data.hiddenVideo
							_this.hiddenFindPeople = res.data.hiddenFindPeople
							if (res.data.hiddenExa.length > 0) {
								res.data.hiddenExa.forEach(item => {
									if (item.TYPE == 0) {
										_this.pd.editUserName = item.editUserName
										_this.pd.editDeptName = item.editDeptName
										_this.pd.editLevelName = item.editLevelName
										_this.pd.editRectificationDeadline = item.spare3
									}
								})
							}
						} else if ("exception" == data.result) {
							uni.showToast({
								title: '错误',
								duration: 2000
							});
						}
					}
				});
			},
			//图片上传
			ChooseImage() {
				var _this = this;
				uni.chooseImage({
					count: 4, //默认9
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
					sourceType: ['camera', 'album'], //从相册选择
					success: (res) => {
						if (this.imgList.length != 0) {
							this.imgList = this.imgList.concat(res.tempFilePaths)
						} else {
							this.imgList = res.tempFilePaths
						}
					}
				});
			},
			ViewImage(e) {
				uni.previewImage({
					urls: this.imgList,
					current: e.currentTarget.dataset.url
				});
			},
			playVideo(e) {
				this.videoSrc = e.currentTarget.dataset.src
				this.modalShow = true
			},
			DelImg(e) {
				uni.showModal({
					title: '双控平台',
					content: '确定要删除这张图片吗?',
					cancelColor: "#000000",
					cancelText: '取消',
					confirmText: '确定',
					success: res => {
						if (res.confirm) {
							this.imgList.splice(e.currentTarget.dataset.index, 1)
						}
					}
				})
			},
			//图片上传
			ChooseImage_fa() {
				var _this = this;
				uni.chooseImage({
					count: 4, //默认9
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
					sourceType: ['camera', 'album'], //从相册选择
					success: (res) => {
						if (this.imgList_fa.length != 0) {
							this.imgList_fa = this.imgList_fa.concat(res.tempFilePaths)
						} else {
							this.imgList_fa = res.tempFilePaths
						}
					}
				});
			},
			ViewImage_fa(e) {
				uni.previewImage({
					urls: this.imgList_fa,
					current: e.currentTarget.dataset.url
				});
			},
			DelImg_fa(e) {
				uni.showModal({
					title: '双控平台',
					content: '确定要删除这张图片吗?',
					cancelColor: "#000000",
					cancelText: '取消',
					confirmText: '确定',
					success: res => {
						if (res.confirm) {
							this.imgList_fa.splice(e.currentTarget.dataset.index, 1)
						}
					}
				})
			},
			textareaAInput(e) {
				this.RECTIFYDESCR = e.detail.value
			},
			goSubmit() {
				var _this = this;
				let required = true
				if (!this.pd.DELAY_TIME) {
					uni.showToast({
						icon: 'none',
						title: '请选择延期时间',
						duration: 1500
					});
					required = false
				}
				if (!this.pd.disposalPlan) {
					uni.showToast({
						icon: 'none',
						title: '请填写处置方案',
						duration: 1500
					});
					required = false
				}
				if (!required) {
					return
				}
				uni.showLoading({
					title: '请稍候'
				})
				uni.request({
					url: basePath + "/app/hiddenexamine/delayed" ,
					method: 'POST',
					dataType: 'json',
					header: {
						'Content-type': 'application/x-www-form-urlencoded'
					},
					data: {
						CORPINFO_ID: corpinfoId,
						loginUserId :loginUser.USER_ID,
						USERNAME: loginUser.NAME,
						HIDDEN_ID :_this.id,
						DELAY_TIME:this.pd.DELAY_TIME,
						disposalPlan:this.pd.disposalPlan

					},
					success: (res) => {
						uni.showToast({
							icon: 'none',
							title: '提交成功',
							duration: 2000
						});
						_this.goback()
					},
					fail: (err) => {
						uni.hideLoading();
						uni.showModal({
							content: err.errMsg,
							showCancel: false
						});
					}
				})
			},
			uploadImg(tempFilePaths,i) {
				return new Promise((resolve, reject) => {
					var _this = this;
					if(tempFilePaths.length==0){
						resolve();
					}
					uni.showLoading({
						title: '上传中'
					})
					uni.uploadFile({
						url: basePath + '/app/imgfiles/add',
						filePath: tempFilePaths[i].filePath,
						name: 'FFILE',

						formData: {
							'FOREIGN_KEY': tempFilePaths[i].FOREIGN_KEY,
							'TYPE': tempFilePaths[i].type
						},
						success: (res) => {
							i++;
							if (tempFilePaths.length > i) {
								_this.uploadImg(tempFilePaths, i);
							} else {
								uni.hideLoading();
								resolve();
							}
						},
						fail: (err) => {
							uni.hideLoading();
							uni.showModal({
								content: err.errMsg,
								showCancel: false
							});
						}
					})
				})
			},

			uploadImg_fa(tempFilePaths,i) {
				var _this = this;
				uni.showLoading({
					title: '上传中'
				})
				uni.uploadFile({
					url: basePath + '/app/imgfiles/add',
					filePath: tempFilePaths[i],
					name: 'FFILE',

					formData: {
						'FOREIGN_KEY': _this.HIDDENSCHEME_ID,
						'TYPE': '8'
					},
					success: (res) => {
						i++;
						if (tempFilePaths.length > i) {
							_this.uploadImg(tempFilePaths, i);
						} else {
							if(_this.HAVESCHEME == '1'){
								_this.onUpload()
							} else {
								uni.showToast({
									icon: 'none',
									title: '提交成功',
									duration: 1500
								});
								setTimeout(function(){
									var pages = getCurrentPages();	// 获取当前页面栈
									var prePage = pages[pages.length - 2];	// 上一个页面
									prePage.$vm.initflag = true;    // A 页面 init方法 为true
									uni.navigateBack({});
									uni.hideLoading();
								},1500);
							}


						}
					},
					fail: (err) => {
						uni.hideLoading();
						console.log('uploadImage fail', err);
						uni.showModal({
							content: err.errMsg,
							showCancel: false
						});
					}
				})
			},
			submit() {
				return new Promise((resolve, reject) => {
					var _this = this;
					uni.request({
						url: basePath + "/app/hidden/rectify", //提交接口
						method: 'POST',
						dataType: 'json',
						header:{
							'Content-type':'application/x-www-form-urlencoded'
						},
						data: {
							RECTIFICATIONTIME: _this.RECTIFICATIONTIME,
							RECTIFYDESCR: _this.RECTIFYDESCR,
							HAVESCHEME:_this.HAVESCHEME,
							// RECTIFICATIONDEPT:_this.pd.RECTIFICATIONDEPT,
							// RECTIFICATIONOR:_this.pd.RECTIFICATIONOR,
							USER_ID:loginUser.USER_ID,
							USERNAME: loginUser.NAME,
							CORPINFO_ID:corpinfoId,
							HIDDEN_ID: _this.id,

							SCREENINGDATE:_this.pd.CREATTIME?_this.pd.CREATTIME:'',
							LISTNAME:_this.pd.LIST_NAME?_this.pd.LIST_NAME:'',
							GOVERNSTANDARDS:_this.pd.GOVERNSTANDARDS?_this.pd.GOVERNSTANDARDS:'',
							GOVERNMETHOD:_this.pd.GOVERNMETHOD?_this.pd.GOVERNMETHOD:'',
							EXPENDITURE:_this.pd.EXPENDITURE?_this.pd.EXPENDITURE:'',
							PRINCIPAL:_this.pd.PRINCIPAL?_this.pd.PRINCIPAL:'',
							PROGRAMMING:_this.pd.PROGRAMMING?_this.pd.PROGRAMMING:'',
							TIMELIMITFOR:_this.pd.TIMELIMITFOR?_this.pd.TIMELIMITFOR:'',
							JOBREQUIREMENT:_this.pd.JOBREQUIREMENT?_this.pd.JOBREQUIREMENT:'',
							OTHERBUSINESS:_this.pd.OTHERBUSINESS?_this.pd.OTHERBUSINESS:'',
							OTHER:JSON.stringify(_this.other)
						},
						success: (res) => {
								uni.hideLoading();
							if ("success" == res.data.result) {
								_this.HIDDENSCHEME_ID = res.data.HIDDENSCHEME_ID
								resolve();
							}else{
								uni.showToast({
									title: '错误',
									duration: 2000
								});
								reject();
							}

						}
					});
				})
			},
			haveUser(e){
				if(e == null || e.length == 0){
					uni.showToast({
						icon:"none",
						title: '请先选择有人员的部门',
						duration: 2000
					});
				}
				console.info(1)
			},
			onUpload() {
				return new Promise((resolve, reject) => {
				this.$refs.lFile.upload({
					// #ifdef APP-PLUS
					// nvue页面使用时请查阅nvue获取当前webview的api,当前示例为vue窗口
					currentWebview: this.$mp.page.$getAppWebview(),
					// #endif
					//非真实地址,记得更换,调试时ios有跨域,需要后端开启跨域并且接口地址不要使用http://localhost/
					url: basePath + "/app/hidden/rectify1?HIDDENSCHEME_ID="+this.HIDDENSCHEME_ID,
					//默认file,上传文件的key
					name: 'file',
					// header:{
					// 	'Content-type':'application/x-www-form-urlencoded'
					// },
					//...其他参数
				});
				resolve();
				})
			},
			onSuccess(res) {
				return new Promise((resolve, reject) => {
				resolve();
				})


			},
			getDept() {
				var _this = this;
				uni.request({
					url: basePath + '/app/sys/listTree',//部门下拉接口
					method: 'POST',
					dataType: 'json',
					header: {
						'Content-type':'application/x-www-form-urlencoded'
					},
					data: {
						CORPINFO_ID : corpinfoId,
					},
					success: (res) => {
						if("success" == res.data.result){
								_this.treeNode=eval(res.data.zTreeNodes);
						} else {
							uni.showToast({
								title: res.data.message,
								duration: 2000
							});
						}
					}
				});
			},
			// 确定回调事件
			zgtreeConfirm(e) {
				this.pd.RECTIFICATIONDEPT=e[0].id;
				this.pd.RECTIFICATIONDEPTNAME=e[0].name;
				this.uindex=-1;
				this.pd.RECTIFICATIONOR='';
				this.pd.RECTIFICATIONORNAME='';
				this.$forceUpdate();//强制刷新
				this.getUserList(this.pd.RECTIFICATIONDEPT);
			},
			// 显示树形选择器
			showZgTree() {
				this.$refs.tkiTree._show();
			},

			// 确定回调事件
			ystreeConfirm(e,index) {
				this.other[index].DEPARTMENT_ID=e[0].id;
				this.other[index].DEPARTMENT_NAME=e[0].name;
				this.other[index].USER_ID='';
				this.other[index].USER_NAME='';
				this.other[index].index=-1;
				this.getUserList(this.other[index].DEPARTMENT_ID,index);
				this.$forceUpdate();//强制刷新
			},
			// 显示树形选择器
			showYsTree(index) {
				let ref = 'tkiTree'+index;
				this.$refs['tkiTree'+index][0]._show();
			},
			//根据主键ID获取数据
			addOther: function(){
				var _this=this;
				let o = {"DEPARTMENT_ID":'',"USER_ID":'',"DEPARTMENT_NAME":'',"USER_NAME":'',index:-1};
				_this.other.push(o);
				let index=_this.other.length-1;
				_this.otherUserList[index]=[];
			},
			removeOther: function(index){
				this.other.splice(index,1);
				this.otherUserList.splice(index,1);
			},
			//获取人员列表
			getUserList(DEPARTMENT_ID,i){
				//发送 post 请求
				var _this = this;
				uni.request({
					method: 'POST',
					dataType: 'json',
					header: {
						'Content-type':'application/x-www-form-urlencoded'
					},
					url: basePath+'/app/sys/listUser',
					data: {
						DEPARTMENT_ID:DEPARTMENT_ID, NOMAIN:'1',
						LOGINUSERID:loginUser.USER_ID,
						NOSELF:'1',
						tm:new Date().getTime()
					},
					success: function(res){
						if("success" == res.data.result){
							if(i>-1){
								_this.otherUserList[i]=[];
								_this.otherUserList[i]=res.data.userList;
								_this.$forceUpdate();//强制刷新
							}else{
								_this.rectificationUserList=res.data.userList;
							}
						}else{
							uni.showToast({
								title: res.data.message,
								duration: 2000
							});
						}
					}
				})
			},
			PickerZgr(e) {
				this.uindex = e.detail.value;
				this.pd.RECTIFICATIONOR=this.rectificationUserList[this.uindex].USER_ID;
				this.pd.RECTIFICATIONORNAME=this.rectificationUserList[this.uindex].NAME;
				this.$forceUpdate();//强制刷新
			},
			PickerYsr(e,index) {
				this.other[index].index = e.detail.value;
				this.other[index].USER_ID=this.otherUserList[index][e.detail.value]?this.otherUserList[index][e.detail.value].USER_ID:'';
				this.other[index].USER_NAME=this.otherUserList[index][e.detail.value]?this.otherUserList[index][e.detail.value].NAME:'';
				this.$forceUpdate();//强制刷新
			},
			radio(e){
				this.HAVESCHEME = e
			},
            radioNormal(e){
                this.IS_NORMAL = e
            },
			changeDate(e) {
				this.RECTIFICATIONTIME = e.detail.value
			},
			ViewShowImage(e) {
				let files = [];
				for (var i = 0; i < this.files.length; i++) {
					files.push(baseImgPath+this.files[i].FILEPATH)
				}
				uni.previewImage({
					urls: files,
					current: e.currentTarget.dataset.index
				});
			},
			changeDelayTimeDate(e){
				this.pd.DELAY_TIME = e
			},
			formatDate(time) {
				let date = new Date(time)
				return formatDate(date, 'yyyy-MM-dd hh:mm')
			},
			goback() {
				uni.navigateBack({
					delta: 1
				});
				uni.hideLoading();
			}
		}
	}
</script>

<style>
	.bb {
		border-top: 1upx solid #f1f1f1;
		border-bottom: 1upx solid #f1f1f1;
	}

	.cu-bar .action:first-child {
		font-size: 26upx
	}

	.cu-form-title {
		padding: 20upx 0;
	}

	.cu-form-textarea {
		background-color: #ffffff;
		padding: 1upx 30upx 20upx;
		min-height: 100upx;
		border-bottom: 1px solid #f1f1f1;
	}

	.cu-form-textarea textarea {
		height: 4.6em;
		width: 100%;
		line-height: 1.2em;
		flex: 1;
		font-size: 28upx;
		padding: 0;
	}

	.cu-form-group {
		padding: 0upx 25upx;
	}

	.cu-form-group picker .picker {
		line-height: 76upx;
	}

	.cu-form-group .title {
		font-size: 28upx;
		/* line-height: 76upx; */
		color: #888;
	}

	.cu-form-group uni-picker::after {
		top: -11upx;
	}

	.selected {
		display: flex;
		align-items: center;
	}

	.selected .radio {
		transform: scale(0.5);
		margin-right: 10upx;
	}

	.bf .cu-btn {
		border-radius: 0;
		width: 100%;
		height: 84upx;
		font-weight: bold;
	}

	.group {
		display: flex;
		align-items: center;
	}
</style>