<template>
	<view style="background-color: #fff;" v-if="content != null">
		<view
			style="height: 100rpx;display: flex;align-items: center;justify-content: space-around;border-bottom: 1px solid #ceccca;"
			v-if="type == 0">
			<!-- <u-tabs :list="list1"  :current="current" @click="click"></u-tabs> -->
			<view class="tab" :class="current==0?'active':''" @click="current = 0">
				待办内容
			</view>
			<view style="border-left: 1px solid #ceccca;height: 80%;">

			</view>
			<view class="tab" :class="current==0?'':'active'" @click="current = 1">
				流转记录
			</view>
		</view>
		<swiper style="background-color:#fff ;" :style="{height:type==0?'calc(100vh - 100rpx)':'100vh'}"
			:current="current" disable-touch>
			<swiper-item>
				<view style="height: 100%;overflow:auto">
					<u--form labelPosition="left" labelAlign="center" :model="content" ref="uForm"
						:labelStyle="{fontSize:'32rpx'}" labelWidth="100">
						<u-form-item label="紧急程度:" borderBottom ref="item1" label-width="100">
							<!-- <u--input v-model="content.sendTime" border="none" readonly></u--input> -->
							<!-- <view class="content">
								{{content.infoOpenType}}
							</view> -->
							<uni-data-select class="edit" v-model="content.jjcd" disabled placeholder="请选择信息公开类型"
								:localdata="jjcdList" :clear="false"></uni-data-select>
						</u-form-item>
						<u-form-item label="发文标题:" borderBottom ref="item1">
							<!-- <u--input v-model="content.title" border="none" readonly></u--input> -->
							<view class="content">
								{{content.title}}
							</view>
						</u-form-item>
						<u-form-item label="密级:" borderBottom ref="item1" label-width="100">
							<!-- <u--input v-model="content.sendTime" border="none" readonly></u--input> -->
							<!-- <view class="content">
								{{content.infoOpenType}}
							</view> -->
							<uni-data-select class="edit" v-model="content.degree" disabled placeholder=""
								:localdata="mijiList" :clear="false"></uni-data-select>
						</u-form-item>
						<u-form-item label="保密期限(年):" borderBottom ref="item1">
							<!-- <u--input v-model="content.sender" border="none" readonly></u--input> -->
							<view class="content">
								{{content.bmqx}}
							</view>
						</u-form-item>
						<u-form-item label="发文单位:" borderBottom ref="item1">
							<!-- <u--input v-model="content.sender" border="none" readonly></u--input> -->
							<view class="content">
								{{content.outUnit}}
							</view>
						</u-form-item>
						<u-form-item label="承办单位:" borderBottom ref="item1">
							<!-- <u--input v-model="content.sender" border="none" readonly></u--input> -->
							<view class="content">
								{{content.undertakerUnit}}
							</view>
						</u-form-item>
						<u-form-item label="主送单位:" borderBottom ref="item1">
							<u--input v-model="content.mainUnit" border="none" placeholder="请输入主送单位"></u--input>
							<!-- <view class="content">
								{{content.mainUnit}}
							</view> -->
						</u-form-item>
						<u-form-item label="抄送单位:" borderBottom ref="item1">
							<u--input v-model="content.copyUnit" border="none" placeholder="请输入抄送单位"></u--input>
							<!-- <view class="content">
								{{content.copyUnit}}
							</view> -->
						</u-form-item>
						<u-form-item label="拟稿人:" borderBottom ref="item1">
							<!-- <u--input v-model="content.sendTime" border="none" readonly></u--input> -->
							<view class="content">
								{{content.draftedName}}
							</view>
						</u-form-item>
						<u-form-item label="拟稿日期:" borderBottom ref="item1">
							<!-- <u--input v-model="content.sendTime" border="none" readonly></u--input> -->
							<view class="content">
								{{content.draftedTime}}
							</view>
						</u-form-item>
						<u-form-item label="打印人:" borderBottom ref="item1">
							<!-- <u--input v-model="content.sendTime" border="none" readonly></u--input> -->
							<view class="content">
								{{content.dyr}}
							</view>
						</u-form-item>
						<u-form-item label="打印份数:" borderBottom ref="item1">
							<!-- <u--input v-model="content.sendTime" border="none" readonly></u--input> -->
							<view class="content">
								{{content.dynum}}
							</view>
						</u-form-item>
						<u-form-item label="正文查看:" borderBottom ref="item1" v-if="content.sendFile != null">
							<view>
								<!-- <u--text mode="link" :text="content.sendFile.name" :href="content.sendFile.url"></u--text> -->
								<u--text size="30rpx" :lines="3" color="#2979FF" :text="content.sendFile.name"
									@click="downLoad(content.sendFile.path)"></u--text>
							</view>
						</u-form-item>
						<u-form-item label="附件查看:" borderBottom ref="item1">
							<view v-if="content.messageFileList != null && content.messageFileList.length != 0 ">
								<u--text :text="v.name" :lines="3" v-for="(v,i) in content.messageFileList" :key="i"
									size="30rpx" color="#2979FF" @click="downLoad(v.path)"></u--text>
							</view>
						</u-form-item>
						<u-form-item label="文件字号:" borderBottom ref="item1">
							<!-- <u--input v-model="content.serial" border="none" readonly></u--input> -->
							<view class="content">
								{{content. wordNum}}
							</view>
						</u-form-item>
						<u-form-item label="信息公开类型:" borderBottom ref="item1" label-width="120">
							<!-- <u--input v-model="content.sendTime" border="none" readonly></u--input> -->
							<!-- <view class="content">
								{{content.infoOpenType}}
							</view> -->
							<uni-data-select class="edit" v-model="content.infoOpenType" disabled
								placeholder="请选择信息公开类型" :localdata="xxgklist" :clear="false"></uni-data-select>
						</u-form-item>
						<u-form-item label="不予公开理由:" borderBottom ref="item1" label-width="120"
							v-if="content.infoOpenType == 3">
							<!-- <u--input v-model="content.sendTime" border="none" readonly></u--input> -->
							<!-- <view class="content">
								{{content.noOpenReason}}
							</view> -->
							<uni-data-select v-model="content.noOpenReason" placeholder="请选择信息公开类型" :localdata="noList"
								:clear="false"></uni-data-select>
						</u-form-item>

						<view v-if="type==0" style="padding-bottom: 40rpx;">
							<u-form-item label="下一节点:" borderBottom ref="item1"
								v-if="gdType == false&&this.nodeId!='207'">
								<uni-data-select v-model="content.jdindex" placeholder="请选择下一节点" :localdata="list"
									:clear="false" @change="change"></uni-data-select>
							</u-form-item>
							<u-form-item label="处理人员:" borderBottom ref="item1" v-if="DeliveryWay==4"
								@click="choosePeo">
								<view :style="{color:content.users==null?'rgb(192, 196, 204)':''}">
									{{content.users==null?'请选择人员': content.userList}}
								</view>
							</u-form-item>
							<u-form-item label="审批意见:" v-if="gdType == false" borderBottom ref="item1">
								<u--textarea v-model="content.reviewMsg" placeholder="请输入审批意见" autoHeight
									border="none"></u--textarea>
							</u-form-item>
							<view v-if="gdType == true">
								<!-- <u-form-item label="密级:" borderBottom ref="item1">
									<uni-data-select v-model="content.levels" placeholder="请选择密级" :clear="false" :localdata="gd" ></uni-data-select>
								</u-form-item> -->
								<u-form-item label="档案编号:" borderBottom ref="item1">
									<u--input v-model="content.archiveNo" placeholder="请输入档案编号"
										border="none"></u--input>
								</u-form-item>
								<u-form-item label="档案分类:" borderBottom ref="item1" @click="chooseGd">
									<view :style="{color:content.typeId==null?'rgb(192, 196, 204)':''}">
										{{content.typeId==null?'请选择档案分类': content.gdtype}}
									</view>
								</u-form-item>
								<u-form-item label="打印份数:" borderBottom ref="item1">
									<u--input v-model="content.printNum" placeholder="请输入打印份数" type="number"
										border="none"></u--input>
								</u-form-item>
							</view>
							<!-- <view v-if="backType == true">
								<u-form-item label="退回节点:" borderBottom ref="item1">
									<uni-data-select v-model="content.returnToNodeID" placeholder="请选择节点" :clear="false"
										:localdata="backlist"></uni-data-select>
								</u-form-item>
								<u-form-item label="退回意见:" borderBottom ref="item1" >
									<u--textarea v-model="content.backMsg" placeholder="请输入退回意见" autoHeight
										border="none"></u--textarea>
								</u-form-item>
							</view> -->
							<view style="margin-top: 40rpx;padding: 0 20rpx;box-sizing: border-box;"
								v-if="gdType == false">
								<u-button type="primary" text="提交" @click="submit"></u-button>
							</view>
							<view style="margin-top: 40rpx;padding: 0 20rpx;box-sizing: border-box;"
								v-if="gdType == true">
								<u-button type="primary" text="归档" @click="save"></u-button>
							</view>
							<view style="margin-top: 40rpx;padding: 0 20rpx;box-sizing: border-box;"
								v-if="backType == true&&this.nodeId!='207'&&this.nodeId!='201'">
								<u-button type="error" text="退回" @click="show = true"></u-button>
							</view>
						</view>
						<view style="padding: 20rpx;box-sizing: border-box;" v-else>
							<u-steps :current="lzNum-1" direction="column" v-if="record != null">
								<view v-for="(v,i) in record" :key="i">
									<u-steps-item :error="v.ActionType==2?true:false"
										:title='v.NDFromT+"（"+v.ActionTypeText+"）"' v-if="v.ActionType==='28'">
										<view slot="desc" style="color: #606266">
											<view style="font-size: 28rpx;">
												处理人：{{v.EmpFromT}}
											</view>
											<view style="font-size: 28rpx;">
												到达时间：{{v.SDT}}
											</view>
										</view>
									</u-steps-item>
									<view v-else-if="v.ActionType22 != undefined">
										<u-steps-item :error="v.ActionType==2?true:false"
											v-for="(item,index) in v.ActionType22" :key="index"
											:title='item.NDFromT+"（"+v.ActionTypeText+"）"'>
											<view slot="desc" style="color:#606266;">
												<view style="font-size: 28rpx;">
													处理部门：{{item.NodeData.split("DeptName=")[1]}}
												</view>
												<view style="font-size: 28rpx;">
													处理人：{{item.Exer.split(',')[1]}}
												</view>
												<view style="font-size: 28rpx;">
													处理时间：{{item.RDT}}
												</view>
												<view style="font-size: 28rpx;">
													审核意见：{{item.Msg}}
												</view>
											</view>
										</u-steps-item>
									</view>
									<u-steps-item :error="v.ActionType==2?true:false"
										:title='v.NDFromT+"（"+v.ActionTypeText+"）"' v-else>
										<view slot="desc" style="color: #606266">
											<view style="font-size: 28rpx;">
												处理部门：{{v.NodeData.split("DeptName=")[1]}}
											</view>
											<view style="font-size: 28rpx;">
												处理人：{{v.Exer.split(',')[1]}}
											</view>
											<view style="font-size: 28rpx;">
												处理时间：{{v.RDT}}
											</view>
										</view>
									</u-steps-item>
								</view>
							</u-steps>
						</view>
					</u--form>
				</view>

			</swiper-item>
			<swiper-item>
				<view style="padding: 20rpx;box-sizing: border-box;width: 100%;height: 100%;overflow: auto;">
					<u-steps :current="lzNum-1" direction="column" dot v-if="record != null">
						<view v-for="(v,i) in record" :key="i">
							<u-steps-item :error="v.ActionType==2?true:false"
								:title='v.NDFromT+"（"+v.ActionTypeText+"）"' v-if="v.ActionType==='28'">
								<view slot="desc" style="color: #606266">
									<view style="font-size: 28rpx;">
										处理人：{{v.EmpFromT}}
									</view>
									<view style="font-size: 28rpx;">
										到达时间：{{v.SDT}}
									</view>
								</view>
							</u-steps-item>
							<view v-else-if="v.ActionType22 != undefined">
								<u-steps-item :error="v.ActionType==2?true:false" v-for="(item,index) in v.ActionType22"
									:key="index" :title='item.NDFromT+"（"+v.ActionTypeText+"）"'>
									<view slot="desc" style="color:#606266;">
										<view style="font-size: 28rpx;">
											处理部门：{{item.NodeData.split("DeptName=")[1]}}
										</view>
										<view style="font-size: 28rpx;">
											处理人：{{item.Exer.split(',')[1]}}
										</view>
										<view style="font-size: 28rpx;">
											处理时间：{{item.RDT}}
										</view>
										<view style="font-size: 28rpx;">
											审核意见：{{item.Msg}}
										</view>
									</view>
								</u-steps-item>
							</view>
							<u-steps-item :error="v.ActionType==2?true:false"
								:title='v.NDFromT+"（"+v.ActionTypeText+"）"' v-else>
								<view slot="desc" style="color: #606266">
									<view style="font-size: 28rpx;">
										处理部门：{{v.NodeData.split("DeptName=")[1]}}
									</view>
									<view style="font-size: 28rpx;">
										处理人：{{v.Exer.split(',')[1]}}
									</view>
									<view style="font-size: 28rpx;">
										处理时间：{{v.RDT}}
									</view>
								</view>
							</u-steps-item>
						</view>
					</u-steps>

				</view>
			</swiper-item>
		</swiper>
		<u-modal :show="show" title="退回" :closeOnClickOverlay="true" showCancelButton @cancel="close" @close="close"
			@confirm="back">
			<view class="slot-content" style="width: 100%;">
				<u--form labelPosition="left" labelAlign="center" :model="content" ref="uForm1"
					:labelStyle="{fontSize:'32rpx'}" labelWidth="100">
					<u-form-item label="退回节点:" borderBottom ref="item1">
						<uni-data-select v-model="content.returnToNodeID" placeholder="请选择节点" :clear="false"
							:localdata="backlist"></uni-data-select>
					</u-form-item>
					<u-form-item label="退回意见:" borderBottom ref="item1">
						<u--textarea v-model="content.backMsg" placeholder="请输入退回意见" autoHeight
							border="none"></u--textarea>
					</u-form-item>
				</u--form>
			</view>
		</u-modal>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current: 0,
				content: null,
				statusList: [],
				//流转记录
				record: null,
				//待办已办
				type: 0,
				//节点列表
				list: [],
				//是否选择下发人员
				selectType: 3,
				workid: null,
				flowNo: null,
				id: null,
				//tabs
				list1: [{
						name: '待办内容'
					},
					{
						name: '流转记录'
					}
				],
				DeliveryWay: null,
				//归档
				gd: null,
				gdType: false, //判断是否是归档
				overType: false, //判断是否结束
				//上个页面传过来的参数
				parameter: null,
				//已下载附件
				list2: [],
				list3: [],
				//退回状态
				backType: false,
				//退回节点列表
				backlist: [],
				//退回模态框
				show: false,
				//信息公开列表
				xxgklist: [],
				jjcdList: [],
				mijiList: [],
				//不予公开列表
				noList: [],
				//流转记录数量
				lzNum: 0,
				nodeId: null
			}
		},
		onLoad(options) {
			let that = this
			this.getDicts()
			this.getMsgClass()
			this.getNoList()
			this.getjjcdClass()
			this.getmijiClass()
			this.getContent(options.workid)
			this.getRecord(options.workid)
			this.getgd()
			this.parameter = options
			this.type = options.type
			this.workid = options.workid
			this.flowNo = options.flowNo
			this.nodeId = options.nodeId
			uni.setNavigationBarTitle({
				title: options.title
			})
			if (options.nodeName.indexOf('归档') != -1) {
				that.gdType = true
				that.getgd()
			}
			// if (options.type == 0) {
			// 	setTimeout(()=>{
			// 		this.isOver(options)
			// 	},500)
			// }

		},
		onShow() {
			uni.$once('query', (query) => {
				if (query.a == 1) {
					this.content.users = getApp().globalData.peoIdList
					this.content.userList = getApp().globalData.peoList
					this.$forceUpdate()
				} else if (query.a == 2) {
					this.content.typeId = getApp().globalData.gdId.split(",")[0]
					this.content.gdtype = getApp().globalData.gdId.split(",")[1]
					this.$forceUpdate()
				}
			})
		},
		methods: {
			click(e) {
				this.current = e.index
			},
			//查询发文详情
			getContent(id) {
				uni.$u.http.get('/offcial/message/messageByWorkId/' + id).then(res => {
					this.content = res.data
					this.content.workid = id
					if (this.gdType == true) {
						this.content.typeId = null //归档分类
						this.content.levels = null //密级
						this.content.archiveNo = null //档案编号
						this.content.archiveFormNo = null
						this.content.printNum = null //打印份数
						this.content.name = res.data.title //档案名称
						this.content.gdtype = null //分类名称
					}
					if (this.type == 0) {
						this.isOver(this.parameter)
						this.getBackNo(this.parameter.nodeId)
					}
					this.statusList.forEach(item => {
						if (item.dictValue == res.data.emergencyDegree) {
							this.content.status = item.dictLabel
						}
					})
				})
			},
			// 查询字典数据详细
			getDicts() {
				uni.$u.http.get('/system/dict/data/type/urgent_type').then(res => {
					this.statusList = res.data
				})
			},
			//查询信息公开类型
			getMsgClass() {
				uni.$u.http.get('/system/dict/data/type/sw_open_type').then(res => {
					// this.statusList = res.data
					this.xxgklist = res.data.map((item, index) => {
						let obj = {
							value: item.dictValue,
							id: item.dictValue,
							text: item.dictLabel,
						}
						return obj
					})
				})
			},
			//查询紧急程度
			getjjcdClass() {
				uni.$u.http.get('/system/dict/data/type/urgent_type').then(res => {
					// this.statusList = res.data
					this.jjcdList = res.data.map((item, index) => {
						let obj = {
							value: item.dictValue,
							id: item.dictValue,
							text: item.dictLabel,
						}
						return obj
					})
				})
			},
			//查询密级
			getmijiClass() {
				uni.$u.http.get('/system/dict/data/type/archive_levels').then(res => {
					// this.statusList = res.data
					this.mijiList = res.data.map((item, index) => {
						let obj = {
							value: item.dictValue,
							id: item.dictValue,
							text: item.dictLabel,
						}
						return obj
					})
				})
			},
			//查询不予公开理由字典
			getNoList() {
				uni.$u.http.get('/system/dict/data/type/no_open_reason').then(res => {
					// this.statusList = res.data
					this.noList = res.data.map((item, index) => {
						let obj = {
							value: item.dictValue,
							id: item.dictValue,
							text: item.dictLabel,
						}
						return obj
					})
				})
			},
			//查询归档字典
			getgd() {
				uni.$u.http.get('/system/dict/data/type/archive_levels').then(res => {
					this.gd = res.data.map((item, index) => {
						let obj = {
							value: item.dictCode,
							id: item.dictCode,
							text: item.dictLabel,
						}
						return obj
					})
				})
			},
			//判断是否为最后一步
			isOver(v) {
				uni.$u.http.get("/jflow/restful/judgeNode", {
					params: {
						nodeId: v.nodeId
					}
				}).then(res => {
					if (res.msg == "Y") {
						this.overType = true
					} else {
						this.overType = false
						this.jdList(v.workid, v.flowNo)
					}
				})
			},
			//查询流转记录
			getRecord(id) {
				uni.$u.http.get('/jflow/restful/getWfGenerWorkList', {
					params: {
						workID: id,
						token: uni.getStorageSync('jtoken')
					}
				}).then(res => {
					this.record = res.trackList
					for (let i in res.trackList) {
						if (res.trackList[i].ActionType !== '28') {
							if (res.trackList[i].ActionType22 != undefined) {
								this.lzNum = this.lzNum + res.trackList[i].ActionType22.length
							} else {
								this.lzNum = this.lzNum + 1
							}
						}
					}
					if (this.type == 0) {
						this.content.reviewMsg = null
						this.content.users = null
						this.content.userList = null
					}
				})
			},
			//查询下一步所有节点
			jdList(id, flow) {
				uni.$u.http.get('/jflow/restful/GenerNextStepAllNode', {
					params: {
						workid: id,
						token: uni.getStorageSync('jtoken'),
						flowNo: flow
					}
				}).then(res => {
					this.id = res[0].NodeID
					this.content.jdindex = 0 //下一节点索引
					this.DeliveryWay = res[0].DeliveryWay //下一节点状态
					this.content.toNodeId = res[0].NodeID //下一节点ID
					this.content.nodeId = res[0].NodeID //下一节点ID
					this.content.optionName = res[0].Name //节点名称
					this.list = res.map((item, index) => {
						let obj = {
							value: index,
							id: item.NodeID,
							text: item.Name,
							DeliveryWay: item.DeliveryWay
						}
						return obj
					})

				})
			},
			//节点选择
			change(e) {
				if (e.length != 0) {
					this.id = this.list[e].id
					this.DeliveryWay = this.list[e].DeliveryWay
					this.content.toNodeId = this.list[e].id
					this.content.nodeId = this.list[e].id
					this.content.optionName = this.list[e].text
				}

			},
			//选择归档分类
			chooseGd() {
				uni.navigateTo({
					url: "/pages/file/file"
				})
			},
			//选择人员相关
			choosePeo() {
				if (this.id == null) {
					uni.showToast({
						title: "请先选择下一节点",
						icon: "none"
					})
				} else {
					uni.navigateTo({
						url: `/pages/peoChoose/peoChoose?workid=${this.workid}&flowNo=${this.flowNo}&id=${this.id}`,
					})
				}
			},
			//提交待办
			submit() {
				if (this.id == null && this.nodeId != '207') {
					uni.showToast({
						title: "请先选择下一节点",
						icon: "none"
					})
				} else if (this.content.users == null && this.DeliveryWay == 4) {
					uni.showToast({
						title: "请选择人员",
						icon: "none"
					})
				} else if (this.content.reviewMsg == null) {
					uni.showToast({
						title: "请填写审批意见",
						icon: "none"
					})
				} else {
					uni.showLoading({
						title: "提交中...",
						mask: true
					})
					uni.$u.http.put("/offcial/message", this.content).then(qaz => {
						console.log(qaz)
						uni.$u.http.post("/offcial/receive/sendFlowToUsers", this.content, {
							header: {
								// 'Content-Type': 'multipart/form-data'
								'content-Type': 'application/x-www-form-urlencoded'
							}
						}).then(res => {
							console.log(res.data.VarAcceptersName)
							uni.hideLoading()
							if (res.data.VarAcceptersName != "" && res.data.VarAcceptersName !=
								undefined && res.data.VarAcceptersName != "结束") {
								uni.showToast({
									title: "已发送到" + res.data.VarToNodeName + "节点，接收人：" + res
										.data.VarAcceptersName,
									icon: "none",
									mask: true,
									duration: 3000
								})
							} else if (this.overType) {
								uni.showToast({
									title: res.data.Message,
									icon: "none",
									mask: true,
									duration: 3000
								})
								console.log('78452')
							} else {
								// if (res.data.Message.replace(/[@]/g, "")) {
								uni.showToast({
									title: res.data.Message.replace(/[@]/g, ""),
									icon: "none",
									mask: true,
									duration: 3000
								})
								// } else {
								// 	uni.showToast({
								// 		title: res.data.Message,
								// 		icon: "none",
								// 		mask: true,
								// 		duration: 3000
								// 	})
								// }

							}

							uni.$emit('query', {
								a: 'back'
							})
							setTimeout(() => {
								uni.navigateBack()
							}, 2000)
						}).catch(res => {
							console.log(res)
							uni.hideLoading()
							uni.showToast({
								title: "请稍后重试",
								icon: "none"
							})
						})
					}).catch(res => {
						console.log(res)
						uni.hideLoading()
						uni.showToast({
							title: "请稍后重试",
							icon: "none"
						})
					})
				}
			},
			//保存归档
			save() {
				if (this.content.archiveNo == null) {
					uni.showToast({
						title: "请填写档案编号",
						icon: "none"
					})
				} else if (this.content.typeId == null) {
					uni.showToast({
						title: "请选择归档分类",
						icon: "none"
					})
				} else if (this.content.printNum == null || this.content.printNum < 1 || this.content.printNum % 1 != 0) {
					uni.showToast({
						title: "请填写正确打印份数",
						icon: "none"
					})
				} else {
					this.content.reviewMsg = "同意"
					uni.showLoading({
						title: "提交中...",
						mask: true
					})
					uni.$u.http.put("/offcial/message", this.content).then(qaz => {
						uni.$u.http.post("/offcial/archive/save", this.content).then(res => {
							uni.$u.http.get('/jflow/restful/GenerNextStepAllNode', {
								params: {
									workid: this.parameter.workid,
									token: uni.getStorageSync('jtoken'),
									flowNo: this.parameter.flowNo,
								}
							}).then(qwe => {
								uni.hideLoading()
								uni.showToast({
									title: "归档成功",
									icon: "none",
									mask: true,
									duration: 2000
								})
								uni.$emit('query', {
									a: 'back'
								})
								setTimeout(() => {
									uni.navigateBack()
								}, 2000)
							})
						}).catch(res => {
							uni.hideLoading()
							uni.showToast({
								title: "请稍后重试",
								icon: "none"
							})
						})
					}).catch(res => {
						uni.hideLoading()
						uni.showToast({
							title: "请稍后重试",
							icon: "none"
						})
					})
				}
			},
			//下载附件
			downLoad(v) {
				let that = this
				uni.navigateTo({
					url: "/pages/office/office?url=" + getApp().globalData.saveUrl + v
				})
				// uni.showLoading({
				// 	title:"打开中...",
				// })
				// if(that.list3.indexOf(v) == -1){
				// 	uni.downloadFile({
				// 	  url:getApp().globalData.saveUrl+v,
				// 	  success: function(res) {
				// 	    if (res.statusCode === 200) {
				// 			that.list3.push(v)
				// 			that.list2.push(res.tempFilePath)
				// 	      uni.openDocument({
				// 	        filePath: res.tempFilePath,
				// 			success: function (res) {
				// 				uni.hideLoading();
				// 			}
				// 	      });
				// 	    }else{
				// 			uni.hideLoading()
				// 			uni.showToast({
				// 				title:"下载失败",
				// 				icon:'none'
				// 			})
				// 		}
				// 	  },fail:function(){
				// 		  uni.hideLoading()
				// 		  uni.showToast({
				// 		  	title:"下载失败",
				// 			icon:'none'
				// 		  })
				// 	  }
				// 	});
				// }else{
				// 	uni.openDocument({
				// 	  filePath: that.list2[that.list3.indexOf(v)],
				// 	  success: function (res) {
				// 	  	uni.hideLoading();
				// 	  }
				// 	});
				// }

			},
			//保存修改收文信息
			saveFw() {

			},
			//查询是否能退回
			getBackNo(id) {
				uni.$u.http.get("/jflow/restful/CurrNodeInfo?currNodeID=" + id).then(res => {
					if (res[0].ReturnRole != 0) {
						this.getBackList()
						this.backType = true
						this.content.returnToNodeID = null
						this.content.backMsg = null
					}
				})
			},
			//获取退回节点列表
			getBackList() {
				uni.$u.http.get("/jflow/restful/getReturnWorkNode", {
					params: {
						workid: this.parameter.workid,
						token: uni.getStorageSync('jtoken')
					}
				}).then(res => {
					this.backlist = res.map((item, index) => {
						let obj = {
							value: item.No,
							id: item.No,
							text: item.Name,
						}
						return obj
					})
				})
			},
			//退回上一节点
			back() {
				if (this.content.returnToNodeID == null) {
					uni.showToast({
						title: "请选择退回节点",
						icon: "none"
					})
				} else if (this.content.backMsg == null) {
					uni.showToast({
						title: "请填写退回意见",
						icon: "none"
					})
				} else {
					uni.showLoading({
						title: "退回中...",
					})
					uni.$u.http.get("/offcial/receive/NodeReturnWork", {
						params: {
							workid: this.parameter.workid,
							returnToNodeID: this.content.returnToNodeID,
							returnMsg: this.content.backMsg
						}
					}).then(res => {
						uni.hideLoading()
						this.close()
						uni.showToast({
							title: res,
							icon: "none",
							duration: 2000
						})
						uni.$emit('query', {
							a: 'back'
						})
						setTimeout(() => {
							uni.navigateBack()
						}, 2000)
					}).catch(error => {
						uni.hideLoading()
						uni.showToast({
							title: "请稍后重试",
							icon: "none"
						})
					})
				}

			},
			//关闭模态框
			close() {
				this.content.returnToNodeID = null
				this.content.backMsg = null
				this.show = false
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		font-size: 32rpx;
	}

	.tab {
		width: 48%;
		height: 100%;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.active {
		color: #2979ff
	}

	::v-deep .uni-select--disabled[data-v-6b64008e] {
		background-color: white;
		cursor: not-allowed;
	}

	::v-deep .edit .uni-select[data-v-6b64008e] {
		font-size: 15px;
		border: none;
		box-sizing: border-box;
		border-radius: 4px;
		padding: 0px;
		padding-left: 0px;
		position: relative;
		display: flex;
		-webkit-user-select: none;
		user-select: none;
		flex-direction: row;
		align-items: center;
		border-bottom: none;
		width: 100%;
		flex: 1;
		height: 35px;
	}

	::v-deep .edit .uniui-bottom[data-v-a2e81f6e]:before {
		content: "";
	}
</style>