<template>
	<view style="background-color: #fff;" v-if="content != null">
		<view style="height: 100%;overflow: auto;">
			<u--form labelPosition="left" labelAlign="center" :model="content" ref="uForm" :rules="rules"
				:labelStyle="{fontSize:'32rpx'}" labelWidth="130">
				<view v-if="fkFlow == '006'">
					<u-form-item label="出差处室:" borderBottom prop="outWorkDept">
						<u--input v-model="content.outWorkDept" border="none" readonly></u--input>
					</u-form-item>
					<u-form-item label="出差人:" borderBottom prop="userName">
						<u--input v-model="content.userName" border="none" readonly></u--input>
					</u-form-item>
					<u-form-item label="目的地:" borderBottom prop="destination">
						<view>
							<view>
								<u-radio-group v-model="content.provinceType" @change="groupChange">
									<u-radio :customStyle="{marginRight: '40rpx'}" key="0" label="省内" name="0">
									</u-radio>
									<u-radio key="1" label="省外" name="1"> </u-radio>
								</u-radio-group>
							</view>
							<view style="margin-top: 20rpx;">
								<u--input v-model="content.destination" border="none" placeholder="请填写目的地"></u--input>
							</view>
						</view>
					</u-form-item>
					<u-form-item label="起止日期:" borderBottom prop="startTime" @click="show = true">
						<view :style="{color:content.startTime==null?'rgb(192, 196, 204)':''}">
							{{content.startTime == null?'请选择起止日期':content.startTime+' 至 '+content.endTime}}
						</view>
					</u-form-item>
					<u-form-item label="出差事由:" borderBottom prop="reason">
						<u--textarea v-model="content.reason" placeholder="请填写出差事由" border="none"
							height="100"></u--textarea>
					</u-form-item>
					<u-form-item label="接收人:" borderBottom prop="toEmpsName" @click="peoShow = true">
						<view :style="{color:content.toEmpsName==null?'rgb(192, 196, 204)':''}">
							{{content.params.toEmps == null?'请选择接收人':content.toEmpsName}}
						</view>
					</u-form-item>
				</view>
				<view v-if="fkFlow == '007'">
					<u-form-item label="申请人:" borderBottom prop="userName">
						<u--input v-model="content.userName" border="none" readonly></u--input>
					</u-form-item>
					<u-form-item label="邀请单位:" borderBottom prop="inviteUnit">
						<u--input v-model="content.inviteUnit" border="none" placeholder="请填写邀请单位"></u--input>
					</u-form-item>
					<u-form-item label="培训名称:" borderBottom prop="trainName">
						<u--input v-model="content.trainName" border="none" placeholder="请填写培训名称"></u--input>
					</u-form-item>
					<u-form-item label="目的地:" borderBottom prop="destination">
						<u--input v-model="content.destination" border="none" placeholder="请填写目的地"></u--input>
					</u-form-item>
					<u-form-item label="起止日期:" borderBottom prop="startTime" @click="show = true">
						<view :style="{color:content.startTime==null?'rgb(192, 196, 204)':''}">
							{{content.startTime == null?'请选择起止日期':content.startTime+' 至 '+content.endTime}}
						</view>
					</u-form-item>
					<u-form-item label="授课题目:" borderBottom prop="teacherTitle">
						<u--input v-model="content.teacherTitle" border="none" placeholder="请填写授课题目"></u--input>
					</u-form-item>
					<u-form-item label="参加人数:" borderBottom prop="numberOfParticipants">
						<u--input v-model="content.numberOfParticipants" border="none" placeholder="请填写参加人数"></u--input>
					</u-form-item>
				</view>
				<view v-if="fkFlow == '021'">
					<u-form-item label="姓名:" borderBottom ref="item1">
						<u--input v-model="content.name" border="none" readonly></u--input>
					</u-form-item>
					<u-form-item label="请(休)假类别:" borderBottom prop="leaveTpye">
						<uni-data-select v-model="content.leaveTpye" :clear="false" placeholder="请选择请假类别"
							:localdata="statusList"></uni-data-select>
					</u-form-item>
					<u-form-item label="起止日期:" borderBottom prop="leaveStartTime" @click="show = true">
						<view :style="{color:content.leaveStartTime==null?'rgb(192, 196, 204)':''}">
							{{content.leaveStartTime == null?'请选择起止日期':content.leaveStartTime+' 至 '+content.leaveEndTime}}
						</view>
					</u-form-item>
					<u-form-item label="请(休)假天数:" borderBottom ref="item1">
						<u--input v-model="content.leaveNumber" border="none" readonly
							placeholder="请填写请(休)假天数"></u--input>
					</u-form-item>
					<u-form-item label="请(休)假事由:" borderBottom prop="leaveReason">
						<u--textarea v-model="content.leaveReason" placeholder="请填写请(休)假事由" border="none"
							height="100"></u--textarea>
					</u-form-item>
					<u-form-item label="接收人:" borderBottom prop="toEmpsName" v-if="fzr == true" @click="peoShow = true">
						<view :style="{color:content.toEmpsName==null?'rgb(192, 196, 204)':''}">
							{{content.params.toEmps == null?'请选择接收人':content.toEmpsName}}
						</view>
					</u-form-item>
				</view>
				<view v-if="fkFlow == '015'">
					<u-form-item label="申请人:" borderBottom ref="item1">
						<u--input v-model="content.createBy" border="none" readonly></u--input>
					</u-form-item>
					<u-form-item label="联系电话:" borderBottom prop="phone" ref="item1">
						<u--input v-model="content.phone" placeholder="请输入联系电话" border="none"></u--input>
					</u-form-item>
					<u-form-item label="用车日期:" borderBottom prop="startUseTime" @click="show = true">
						<view :style="{color:content.startUseTime==null?'rgb(192, 196, 204)':''}">
							{{content.startUseTime == null?'请选择起止日期':content.startUseTime+' 至 '+content.endUseTime}}
						</view>
					</u-form-item>
					<u-form-item label="用车天数:" borderBottom ref="item1">
						<u--input v-model="content.dayNum" border="none" readonly placeholder="请填写用车天数"></u--input>
					</u-form-item>
					<u-form-item label="乘车人数:" borderBottom prop="carNum" ref="item1">
						<u--input v-model="content.carNum" border="none" type="number" placeholder="请填写乘车人数"></u--input>
					</u-form-item>
					<u-form-item label="目的地:" borderBottom prop="addres" ref="item1">
						<u--textarea v-model="content.addres" placeholder="请填写目的地" border="none"
							height="100"></u--textarea>
					</u-form-item>
					<u-form-item label="用途:" borderBottom prop="useMessage">
						<u--textarea v-model="content.useMessage" placeholder="请填写用途" border="none"
							height="100"></u--textarea>
					</u-form-item>
					<u-form-item label="接收人:" borderBottom prop="toEmpsName" v-if="fzr == true" @click="peoShow = true">
						<view :style="{color:content.toEmpsName==null?'rgb(192, 196, 204)':''}">
							{{content.params.toEmps == null?'请选择接收人':content.toEmpsName}}
						</view>
					</u-form-item>
				</view>
				<view v-if="fkFlow == '020'">
					<u-form-item label="申请人:" borderBottom ref="item1">
						<u--input v-model="content.createBy" border="none" readonly></u--input>
					</u-form-item>
					<u-form-item label="所在处室:" borderBottom prop="outWorkDept" ref="item1">
						<u--input v-model="content.outWorkDept" placeholder="请输入所在处室" border="none"></u--input>
					</u-form-item>
					<!-- <u-form-item label="值班日期:" borderBottom prop="srcDate" @click="typeChange('zhiban')">
						<view>
							{{content.srcDate}}
						</view>
					</u-form-item> -->
					<u-form-item label="调班日期:" prop="targetDate" @click="typeChange('tiaoban')" borderBottom
						ref="item1">
						<view>
							{{content.targetDate}}
						</view>
					</u-form-item>
					<u-form-item label="调班人:" @click='changePeople1' borderBottom prop="user" ref="item1">
						<view class="">
							{{content.user}}
						</view>
					</u-form-item>
					<u-form-item label="替换人:" @click='changePeople2' borderBottom prop="nickNameTh" ref="item1">
						<view class="">
							{{content.nickNameTh}}
						</view>
					</u-form-item>

					<u-form-item label="接收人:" borderBottom prop="toEmpsName" v-if="Jld == false"
						@click="peoShow1 = true">
						<view :style="{color:content.toEmpsName==null?'rgb(192, 196, 204)':''}">
							{{content.params.toEmps == null?'请选择接收人':content.toEmpsName}}
						</view>
					</u-form-item>
				</view>
				<view v-if="fkFlow == '017'">
					<u-form-item label="用章人:" borderBottom ref="item1">
						<u--input v-model="content.createBy" border="none" readonly></u--input>
					</u-form-item>
					<u-form-item label="用章处室:" borderBottom prop="useDept" ref="item1">
						<u--input v-model="content.useDept" placeholder="请输入用章处室" border="none"></u--input>
					</u-form-item>
					<u-form-item label="用章日期:" borderBottom prop="useTime" @click="typeChange('yongzhang')">
						<view>
							{{content.useTime}}
						</view>
					</u-form-item>
					<u-form-item label="印章类别:" borderBottom prop="signetType">
						<uni-data-select v-model="content.signetType" :clear="false" placeholder="请选择印章类别"
							:localdata="yongzhangList"></uni-data-select>
					</u-form-item>
					<u-form-item label="用章事由:" borderBottom prop="usingReason" ref="item1">
						<u--textarea type="textarea" v-model="content.usingReason" placeholder="请输入用章事由"
							border="none"></u--textarea>
					</u-form-item>
					<u-form-item label="主送单位:" borderBottom prop="activeSend" ref="item1">
						<u--textarea type="textarea" v-model="content.activeSend" placeholder="请输入主送单位"
							border="none"></u--textarea>
					</u-form-item>
					<u-form-item label="盖章份数:" borderBottom prop="signetCopies" ref="item1">
						<u--input type="textarea" v-model="content.signetCopies" placeholder="请输入盖章份数"
							border="none"></u--input>
					</u-form-item>
					<u-form-item label="接收人:" borderBottom prop="toEmpsName" v-if="fzr == true" @click="peoShow = true">
						<view :style="{color:content.toEmpsName==null?'rgb(192, 196, 204)':''}">
							{{content.params.toEmps == null?'请选择接收人':content.toEmpsName}}
						</view>
					</u-form-item>
				</view>
				<view v-if="fkFlow == '018'">
					<u-form-item label="用章人:" borderBottom ref="item1">
						<u--input v-model="content.createBy" border="none" readonly></u--input>
					</u-form-item>
					<u-form-item label="用章处室:" borderBottom prop="useDept" ref="item1">
						<u--input v-model="content.useDept" placeholder="请输入用章处室" border="none"></u--input>
					</u-form-item>
					<u-form-item label="用章日期:" borderBottom prop="useTime" @click="typeChange('yongzhang')">
						<view>
							{{content.useTime}}
						</view>
					</u-form-item>

					<u-form-item label="合同名称:" borderBottom prop="usingReason" ref="item1">
						<u--textarea type="textarea" v-model="content.usingReason" placeholder="请输入合同名称"
							border="none"></u--textarea>
					</u-form-item>
					<u-form-item label="主送单位:" borderBottom prop="activeSend" ref="item1">
						<u--textarea type="textarea" v-model="content.activeSend" placeholder="请输入主送单位"
							border="none"></u--textarea>
					</u-form-item>
					<u-form-item label="盖章份数:" borderBottom prop="signetCopies" ref="item1">
						<u--input type="textarea" v-model="content.signetCopies" placeholder="请输入盖章份数"
							border="none"></u--input>
					</u-form-item>
					<u-form-item label="接收人:" borderBottom prop="toEmpsName" v-if="fzr == true" @click="peoShow = true">
						<view :style="{color:content.toEmpsName==null?'rgb(192, 196, 204)':''}">
							{{content.params.toEmps == null?'请选择接收人':content.toEmpsName}}
						</view>
					</u-form-item>
				</view>
				<view v-if="fkFlow == '016'">
					<u-form-item label="督办事项:" borderBottom prop="title">
						<u--input placeholder='请输入督办事项' v-model="content.title" border="none"></u--input>
					</u-form-item>
					<!-- <u-form-item label="处室及负责人:" borderBottom prop="departmentHead">
						<u--input v-model="content.departmentHead" border="none" readonly></u--input>
					</u-form-item> -->
					<!-- <u-form-item label="信息类别:" borderBottom prop="infoType">
						<u--textarea type="textarea" v-model="content.infoType" placeholder="请输入信息类别"
							border="none"></u--textarea>
					</u-form-item> -->
					<u-form-item label="督办来源:" borderBottom prop="infoSource">
						<uni-data-select @change="infoSourceChange" v-model="content.infoSource" :clear="false"
							placeholder="请选择督办来源" :localdata="InfoList"></uni-data-select>
					</u-form-item>
					<u-form-item label="督办内容:" borderBottom prop="infoSourceContent">
						<u--textarea type="textarea" v-model="content.infoSourceContent"
							:placeholder="infoSourceContent" border="none"></u--textarea>
					</u-form-item>

					<u-form-item label="完成时限:" @click="typeChange('shixian')" borderBottom prop="doneTime">
						<view>
							{{content.doneTime}}
						</view>
						<!-- <u--input v-model="content.doneTime" border="none" readonly></u--input> -->
					</u-form-item>
					<!-- 	<u-form-item label="完成时限内容:" borderBottom prop="doneContent">
						<u--textarea type="textarea" v-model="content.doneContent" placeholder="**月**日
    ****要求/文件要求/部门确定" border="none"></u--textarea>
					</u-form-item> -->
					<!-- <u-form-item label="议定事项:" borderBottom prop="itemPostil">
						<u--textarea type="textarea" v-model="content.itemPostil" placeholder="请输入议定事项"
							border="none"></u--textarea>
					</u-form-item> -->
					<u-form-item label="责任处室:" borderBottom prop="prersonLiable">
						<u--textarea disabled style="width: 190rpx;" type="textarea" v-model="content.prersonLiable"
							placeholder="请选择责任处室" border="none"></u--textarea>
						<u-button size="small" type="primary" text="选择" @click="handelSelect"
							style="margin-top: 40rpx;width: 50rpx;margin-right: 10rpx;"></u-button>
					</u-form-item>
				</view>
				<view style="padding: 0 20rpx;">
					<u-button type="primary" v-if="fkFlow=='016'" text="保存" @click="keep"
						style="margin-top: 40rpx;"></u-button>
					<u-button type="primary" v-else text="提交" @click="submit" style="margin-top: 40rpx;"></u-button>
				</view>
			</u--form>
		</view>
		<u-calendar :show="show" mode="range" allowSameDay @confirm="confirm" @close="show = false"></u-calendar>
		<u-calendar placeholder="请选择日期" :show="show1" mode="single" allowSameDay @confirm="confirmOne"
			@close="show1 = false"></u-calendar>
		<u-modal :show="peoShow" title="选择接收人" showCancelButton @cancel="cancel" @confirm="queren">
			<view style="width: 100%;height: 40vh;overflow: auto;" v-if="peoShow == true">
				<u-radio-group v-model="value" @change="radioChange" iconPlacement="right">
					<u-collapse accordion style="width: 100%;">
						<u-collapse-item :title="v.Name" :name="v.No" :key="v.No" v-for="v in deptList"
							style="width: 100%;">
							<view style="font-size: 32rpx; padding: 20rpx 0; border-bottom: 1px solid #eaeaea;"
								v-for=" i in userList" :key="i.NO" v-if="i.FK_Dept == v.No">
								<u-radio :label="i.Name" :name="i"></u-radio>
							</view>
						</u-collapse-item>
					</u-collapse>
				</u-radio-group>
			</view>
		</u-modal>
		<u-modal :show="peoShow1" title="请选择带班领导" showCancelButton @cancel="cancel1" @confirm="queren1">
			<view style="width: 100%;height: 40vh;overflow: auto;" v-if="peoShow1 == true">
				<u-radio-group v-model="value1" @change="radioChange1" iconPlacement="right">
					<u-collapse accordion style="width: 100%;">
						<u-collapse-item :title="v.Name" :name="v.No" :key="v.No" v-for="v in deptList"
							style="width: 100%;">
							<view style="font-size: 32rpx; padding: 20rpx 0; border-bottom: 1px solid #eaeaea;"
								v-for=" i in userList" :key="i.NO" v-if="i.FK_Dept == v.No">
								<u-radio :label="i.Name" :name="i"></u-radio>
							</view>
						</u-collapse-item>
					</u-collapse>
				</u-radio-group>
			</view>
		</u-modal>
		<!-- <u-modal :show="peoShow1" title="请选择带班领导" showCancelButton @cancel="cancel1" @confirm="queren1">
			<view style="width: 100%;height: 40vh;overflow: auto;" v-if="peoShow1 == true">
				<u-radio-group v-model="value1" @change="radioChange1" iconPlacement="right">
					<u-collapse accordion style="width: 100%;">
						<u-collapse-item :title="v.Name" :name="v.No" :key="v.No" v-for="v in deptList"
							style="width: 100%;">
							<view style="font-size: 32rpx; padding: 20rpx 0; border-bottom: 1px solid #eaeaea;"
								v-for=" i in userList" :key="i.NO" v-if="i.FK_Dept == v.No">
								<u-radio :label="i.Name" :name="i.NO" :checked="value1.includes(i.NO)"></u-radio>
							</view>
						</u-collapse-item>
					</u-collapse>
				</u-radio-group>
			</view>
		</u-modal> -->
	</view>
</template>

<script>
	import {
		handleTree
	} from '../../utils/wjw'
	// import uButton from "../../uni_modules/uview-ui/components/u-button/u-button.vue"
	export default {
		data() {
			return {
				peoShow1: false,
				YorN: "1",
				InfoList: [],
				db_template: [],
				infoSourceContent: null,
				typeDate: null,
				yongzhangList: [],
				workid: null,
				flowNo: null,
				id: null,
				content: {},
				statusList: [],
				//上个页面传过来的参数
				parameter: null,
				fkFlow: null, // 006 中层出差  007 外出授课备案 021请假 015用车
				show: false, //日历
				show1: false, //日历
				fzr: false, //判断是否是负责人
				Jld: false,
				peoShow: false,
				deptList: [], //部门列表
				userList: [], //人员列表
				value: null,
				value1: [],
				rules: {},
				rules1: {
					destination: {
						type: 'string',
						required: true,
						message: '请填写目的地',
						trigger: ['blur', 'change']
					},
					startTime: {
						type: 'string',
						required: true,
						message: '请选择起止日期',
						trigger: ['blur', 'change']
					},
					reason: {
						type: 'string',
						required: true,
						message: '请填写出差事由',
						trigger: ['blur', 'change']
					},
					toEmpsName: {
						type: 'string',
						required: true,
						message: '请选择接收人',
						trigger: ['blur', 'change']
					},
				},
				rules2: {
					inviteUnit: {
						type: 'string',
						required: true,
						message: '请填写邀请单位',
						trigger: ['blur', 'change']
					},
					trainName: {
						type: 'string',
						required: true,
						message: '请填写培训名称',
						trigger: ['blur', 'change']
					},
					destination: {
						type: 'string',
						required: true,
						message: '请填写目的地',
						trigger: ['blur', 'change']
					},
					startTime: {
						type: 'string',
						required: true,
						message: '请选择起止时间',
						trigger: ['blur', 'change']
					},
					teacherTitle: {
						type: 'string',
						required: true,
						message: '请填写授课题目',
						trigger: ['blur', 'change']
					},
					numberOfParticipants: {
						type: 'number',
						required: true,
						message: '请填写参加人数',
						trigger: ['blur', 'change']
					},
				},
				rules3: {
					leaveTpye: {
						type: 'string',
						required: true,
						message: '请填写请假类别',
						trigger: ['blur', 'change']
					},
					leaveStartTime: {
						type: 'string',
						required: true,
						message: '请选择起止时间',
						trigger: ['blur', 'change']
					},
					leaveReason: {
						type: 'string',
						required: true,
						message: '请填写请假事由',
						trigger: ['blur', 'change']
					},
					toEmpsName: {
						type: 'string',
						required: true,
						message: '请选择接收人',
						trigger: ['blur', 'change']
					},
					user: {
						type: 'string',
						required: true,
						message: '请选择调班人',
						trigger: ['blur', 'change']
					},
				},
				rules4: {
					phone: [{
							required: true,
							message: '请输入手机号',
							trigger: ['change', 'blur'],
						},
						{
							// 自定义验证函数，见上说明
							validator: (rule, value, callback) => {
								// 上面有说，返回true表示校验通过，返回false表示不通过
								// uni.$u.test.mobile()就是返回true或者false的
								return uni.$u.test.mobile(value);
							},
							message: '手机号码不正确',
							// 触发器可以同时用blur和change
							trigger: ['change', 'blur'],
						}
					],
					addres: {
						type: 'string',
						required: true,
						message: '请填写目的地',
						trigger: ['blur', 'change']
					},
					startUseTime: {
						type: 'string',
						required: true,
						message: '请选择起止时间',
						trigger: ['blur', 'change']
					},
					useMessage: {
						type: 'string',
						required: true,
						message: '请填写用途',
						trigger: ['blur', 'change']
					},
					carNum: {
						type: 'number',
						required: true,
						message: '请填写乘车人数',
						trigger: ['blur', 'change']
					},
					toEmpsName: {
						type: 'string',
						required: true,
						message: '请选择接收人',
						trigger: ['blur', 'change']
					},
				},
				rules5: {
					srcDate: {
						type: 'string',
						required: true,
						message: '请选择值班日期',
						trigger: ['blur', 'change']
					},
					targetDate: {
						type: 'string',
						required: true,
						message: '请选择调班日期',
						trigger: ['blur', 'change']
					},
					toEmpsName: {
						type: 'string',
						required: true,
						message: '请选择接收人',
						trigger: ['blur', 'change']
					},
					user: {
						type: 'string',
						required: true,
						message: '请选择调班人',
						trigger: ['blur', 'change']
					},
					nickNameTh: {
						type: 'string',
						required: true,
						message: '请选择替换人',
						trigger: ['blur', 'change']
					}
				},
				rules6: {
					useTime: {
						type: 'string',
						required: true,
						message: '请选择用章日期',
						trigger: ['blur', 'change']
					},
					signetType: {
						type: 'string',
						required: true,
						message: '请选择印章类别',
						trigger: ['blur', 'change']
					},
					usingReason: [{
						required: true,
						trigger: "blur",
						message: "请输入用章事由"
					}, ],
					activeSend: [{
						required: true,
						trigger: "blur",
						message: "请输入主送单位"
					}, ],
					signetCopies: [{
						required: true,
						trigger: "blur",
						message: "请输入盖章份数"
					}, ],
					toEmpsName: {
						type: 'string',
						required: true,
						message: '请选择接收人',
						trigger: ['blur', 'change']
					},
				},
				rules7: {
					usingReason: [{
						required: true,
						trigger: "blur",
						message: "请输入合同名称"
					}, ],
					activeSend: [{
						required: true,
						trigger: "blur",
						message: "请输入主送单位"
					}, ],
					signetCopies: [{
						required: true,
						trigger: "blur",
						message: "请输入盖章份数"
					}, ],
					useTime: [{
						required: true,
						message: "请选择用章日期",
						trigger: "change",
					}, ],
					signetType: [{
						required: true,
						message: "请选择印章类型",
						trigger: "change",
					}, ],
					toEmpsName: {
						type: 'string',
						required: true,
						message: '请选择接收人',
						trigger: ['blur', 'change']
					},
				},
				rules8: {
					title: [{
						required: true,
						message: "请输入督办事项",
						trigger: "blur",
					}, ],
					infoType: [{
						required: true,
						message: "请输入信息类别",
						trigger: "blur",
					}, ],
					departmentHead: [{
						required: true,
						message: "请输入处室及负责人",
						trigger: "blur",
					}, ],
					infoSource: [{
						required: true,
						message: "请选择督办来源",
						trigger: "change",
					}, ],
					doneTime: [{
						required: true,
						message: "请选择完成时限",
						trigger: "change",
					}, ],
					infoSourceContent: [{
						required: true,
						message: "请输入督办内容",
						trigger: "blur",
					}, ],
					doneContent: [{
						required: true,
						message: "请输入完成时限内容",
						trigger: "blur",
					}, ],
					itemPostil: [{
						required: true,
						message: "请输入议定事项",
						trigger: "blur",
					}, ],
					prersonLiable: [{
						required: true,
						message: "请选择责任处室",
						trigger: "blur",
					}, ],
				}
			}
		},
		onLoad(options) {
			this.content.ywSupervisionStartUserList = null
			this.content.prersonLiable = null
			getApp().globalData.zerenList = null
			getApp().globalData.ywListZR = null
			let that = this
			let roles = uni.getStorageSync('userInfo').roles
			if (options.fkFlow == '006' || options.fkFlow == '016' || options.fkFlow == '020') {
				this.getPeoList(options.fkFlow)
			}
			for (let i in roles) {
				if (roles[i].roleKey == 'chushifzr' && options.fkFlow == '021' || roles[i].roleKey == 'chushifzr' &&
					options.fkFlow == '015' || roles[i].roleKey == 'chushifzr' && options.fkFlow == '020' || roles[i]
					.roleKey == 'chushifzr' && options.fkFlow == '017') {
					this.fzr = true
					this.getPeoList(options.fkFlow)
					break
				}
				if (roles[i].roleKey == 'jld') {
					this.Jld = true
				}
			}
			that.parameter = options
			that.fkFlow = options.fkFlow
			that.type = options.type
			that.workid = options.workid
			that.flowNo = options.flowNo
			uni.setNavigationBarTitle({
				title: options.title
			})
			if (options.fkFlow == '021') {
				this.getDicts()
			}
			if (options.fkFlow == '017' || options.fkFlow == '018') {
				this.getDictsYongzhang()
			}
			if (options.fkFlow == '016') {
				this.getDictsInfo()
			}
			this.getContent(options.fkFlow)
			this.getRules(options.fkFlow)
		},
		onShow() {
			uni.$once('query', (query) => {
				if (query.a == 'one') {
					this.content.adjustUserId = getApp().globalData.adjustUserId
					this.content.user = getApp().globalData.user
					console.log('this.content.adjustUserId', this.content.adjustUserId)
					// this.content.userList = getApp().globalData.peoList
					// this.$forceUpdate()
				} else if (query.a == 'two') {
					// let arrPeo = this.content.prersonLiable.split(",");
					// let arr = getApp().globalData.zerenList.split(',')
					// arr = arr.concat(this.content.prersonLiable)
					this.content.prersonLiable = getApp().globalData.zerenList
					// this.content.prersonLiable = arr.join(" , ");
					this.content.ywSupervisionStartUserList = getApp().globalData.ywListZR
					console.log('content', this.content)
					// else {
					// 	this.content.prersonLiable = getApp().globalData.zerenList
					// }
				} else if (query.a == 'three') {
					this.content.replaceUserId = getApp().globalData.thList
					this.content.nickNameTh = getApp().globalData.tihuanList
					console.log('this.content.replaceUserId', this.content.replaceUserId)
					console.log('this.content.nickNameTh', this.content.nickNameTh)
					// this.content.userList=getApp().globalData.peoList2.join(",")
					// this.$forceUpdate()
				}
			})
		},
		methods: {
			keep() {
				this.$refs.uForm.validate().then(res => {
					uni.showLoading({
						title: "请稍等...",
						mask: true
					})

					uni.$u.http.post("/offcial/supervision", this.content).then(res => {
						uni.showToast({
							title: "保存成功",
							icon: "none",
							mask: true,
							duration: 3000
						})
						uni.hideLoading()
						uni.$emit('query', {
							a: 'back'
						})
						setTimeout(() => {
							getApp().globalData.ywListZR = []
							getApp().globalData.zerenList = []
							uni.navigateBack()
						}, 2000)
					}).catch((err) => {
						uni.showToast({
							title: err.msg,
							icon: "none",
							mask: true,
							duration: 3000
						})
						uni.hideLoading()
					})
				})
			},
			changePeople2() {
				console.log(333)
				uni.navigateTo({
					url: `/pages/tihuanren/tihuanren`
				})
			},
			handelSelect() {
				uni.navigateTo({
					url: `/pages/zerenchushi/zerenchushi`
				})
			},
			queren1() {
				// let arr = this.content.params.toEmps.split(',')
				// console.log('arr', arr)
				// if (arr.length < 2) {
				// 	uni.showToast({
				// 		title: "请选择两位带班领导",
				// 		icon: "none",
				// 		mask: true,
				// 		duration: 1000
				// 	})
				// } else {
				this.peoShow1 = false
				// }
			},
			checkboxChange(newValues) {
				// let selectedCount = newValues.filter(value => value).length;
				// if (selectedCount > 2) {
				// 	// 如果选中项超过两个，取消最早选中的复选框
				// 	let earliestSelectedIndex = newValues.findIndex(value => value);
				// 	newValues[earliestSelectedIndex] = false;
				// 	uni.showToast({
				// 		title: "只能选择两位带班领导",
				// 		icon: "none",
				// 		mask: true,
				// 		duration: 1000
				// 	})
				// }
				this.value1 = newValues;
				this.content.params.toEmps = newValues.join(',')
				let arr = []
				this.userList.forEach(res => {
					newValues.forEach(res1 => {
						console.log(res.NO, res1)
						if (res.NO == res1) {
							arr.push(res.Name)
						}
					})
				})
				this.content.toEmpsName = arr.join(',')
			},

			infoSourceChange(val) {
				console.log("db_template", this.db_template);
				console.log('val', val);
				this.infoSourceContent = this.db_template[val - 1].text;
			},
			changePeople1() {
				if (this.content.targetDate == null || this.content.targetDate == undefined || this.content.targetDate ==
					'') {
					uni.showToast({
						title: "请先选择调班日期",
						icon: "none"
					})
				} else {
					uni.navigateTo({
						url: "/pages/tiaobanPeople/tiaobanPeople?dataChange=" + this.content.targetDate
					})
				}
			},
			typeChange(e) {
				this.show1 = true
				this.typeDate = e
			},
			// 查询请假类型
			getDicts() {
				uni.$u.http.get('/system/dict/data/type/leave_type').then(res => {
					this.statusList = res.data.map((item, index) => {
						let obj = {
							value: item.dictValue,
							id: item.dictValue,
							text: item.dictLabel
						}
						return obj
					})
				})
			},
			// 印章类型
			getDictsYongzhang() {
				uni.$u.http.get('/system/dict/data/type/signet_type').then(res => {
					this.yongzhangList = res.data.map((item, index) => {
						let obj = {
							value: item.dictValue,
							id: item.dictValue,
							text: item.dictLabel
						}
						return obj
					})
				})
			},
			// 信息来源
			getDictsInfo() {
				uni.$u.http.get('/system/dict/data/type/info_source').then(res => {
					this.InfoList = res.data.map((item, index) => {
						let obj = {
							value: item.dictValue,
							id: item.dictValue,
							text: item.dictLabel
						}
						return obj
					})
				})
				uni.$u.http.get('/system/dict/data/type/db_template').then(res => {
					this.db_template = res.data.map((item, index) => {
						let obj = {
							value: item.dictValue,
							id: item.dictValue,
							text: item.dictLabel
						}
						return obj
					})
				})
			},
			//提交待办
			submit() {
				console.log("this.content", this.content);
				this.$refs.uForm.validate().then(res => {
					uni.showLoading({
						title: "请稍等...",
						mask: true
					})
					switch (this.fkFlow) {
						case '006':
							uni.$u.http.post("/system/work/startOutWork", this.content).then(res => {
								if (res.data.VarAcceptersName != "" && res.data.VarAcceptersName != "结束") {
									uni.showToast({
										title: "已发送到" + res.data.VarToNodeName + "节点，接收人：" + res
											.data.VarAcceptersName,
										icon: "none",
										mask: true,
										duration: 3000
									})
								} else if (res.data.VarAcceptersName == "结束") {
									uni.showToast({
										title: res.data.Message,
										icon: "none",
										mask: true,
										duration: 3000
									})
								} else {
									uni.showToast({
										title: res.data.Message.replace(/[@]/g, ""),
										icon: "none",
										mask: true,
										duration: 3000
									})
								}
								uni.$emit('query', {
									a: 'back'
								})
								setTimeout(() => {
									uni.navigateBack()
								}, 2000)
							}).catch(res => {
								uni.hideLoading()
								uni.showToast({
									title: res.msg,
									icon: "none"
								})
							})
							break
						case '007':
							uni.$u.http.post("/system/registration/startTeacherOut", this.content).then(res => {
								if (res.data.VarAcceptersName != "" && res.data.VarAcceptersName != "结束") {
									uni.showToast({
										title: "已发送到" + res.data.VarToNodeName + "节点，接收人：" + res
											.data.VarAcceptersName,
										icon: "none",
										mask: true,
										duration: 3000
									})
								} else if (res.data.VarAcceptersName == "结束") {
									uni.showToast({
										title: res.data.Message,
										icon: "none",
										mask: true,
										duration: 3000
									})
								} else {
									uni.showToast({
										title: res.data.Message.replace(/[@]/g, ""),
										icon: "none",
										mask: true,
										duration: 3000
									})
								}
								uni.$emit('query', {
									a: 'back'
								})
								setTimeout(() => {
									uni.navigateBack()
								}, 2000)
							}).catch(res => {
								uni.hideLoading()
								uni.showToast({
									title: "请稍后重试",
									icon: "none"
								})
							})
							break
						case '021':
							uni.$u.http.post("/dzoa/leave/startLeave", this.content).then(res => {
								if (res.data.VarAcceptersName != "" && res.data.VarAcceptersName != "结束") {
									uni.showToast({
										title: "已发送到" + res.data.VarToNodeName + "节点，接收人：" + res
											.data.VarAcceptersName,
										icon: "none",
										mask: true,
										duration: 3000
									})
								} else if (res.data.VarAcceptersName == "结束") {
									uni.showToast({
										title: res.data.Message,
										icon: "none",
										mask: true,
										duration: 3000
									})
								} else {
									uni.showToast({
										title: res.data.Message.replace(/[@]/g, ""),
										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: res.msg,
									icon: "none"
								})
							})
							break
						case '015':
							uni.$u.http.post("/offcial/car/startApplyCar", this.content).then(res => {
								if (res.data.VarAcceptersName != "" && res.data.VarAcceptersName != "结束") {
									uni.showToast({
										title: "已发送到" + res.data.VarToNodeName + "节点，接收人：" + res
											.data.VarAcceptersName,
										icon: "none",
										mask: true,
										duration: 3000
									})
								} else if (res.data.VarAcceptersName == "结束") {
									uni.showToast({
										title: res.data.Message,
										icon: "none",
										mask: true,
										duration: 3000
									})
								} else {
									uni.showToast({
										title: res.data.Message.replace(/[@]/g, ""),
										icon: "none",
										mask: true,
										duration: 3000
									})
								}
								uni.$emit('query', {
									a: 'back'
								})
								setTimeout(() => {
									uni.navigateBack()
								}, 2000)
							}).catch(res => {
								uni.hideLoading()
								uni.showToast({
									title: res.msg,
									icon: "none"
								})
							})
							break
						case '020':
							uni.$u.http.post("duty/dutyAdjust/startDutyAdjust", this.content).then(res => {
								if (res.data.VarToNodeID == 2004) {
									uni.$u.http.post('duty/dutyAdjust/updateYwDutyAdjustAudit', {
											workId: res.data.workid,
											status: this.YorN,
											msg: "无",
										}, {
											header: {
												// 'content-Type: 'multipart/form-data'
												'content-Type': 'application/x-www-form-urlencoded'
											}
										}

									)
									if (this.YorN == 1) {
										uni.$u.http.post('/duty/dutyAdjust/execAdjustDuty', {
											workId: res.data.workid
										}, {
											header: {
												// 'content-Type: 'multipart/form-data'
												'content-Type': 'application/x-www-form-urlencoded'
											}
										})
									}
								}
								if (res.data.VarAcceptersName != "" && res.data.VarAcceptersName != "结束") {
									uni.showToast({
										title: "已发送到" + res.data.VarToNodeName + "节点，接收人：" + res
											.data.VarAcceptersName,
										icon: "none",
										mask: true,
										duration: 3000
									})
								} else if (res.data.VarAcceptersName == "结束") {
									uni.showToast({
										title: res.data.Message,
										icon: "none",
										mask: true,
										duration: 3000
									})
								} else {
									uni.showToast({
										title: res.data.Message.replace(/[@]/g, ""),
										icon: "none",
										mask: true,
										duration: 3000
									})
								}
								uni.$emit('query', {
									a: 'back'
								})
								setTimeout(() => {
									uni.navigateBack()
								}, 3000)
							}).catch(res => {
								console.log('res', res)
								uni.hideLoading()
								uni.showToast({
									title: res.msg,
									icon: "none"
								})
							})
							break
						case '017':
							uni.$u.http.post("/offcial/seal/startUsingSeal", this.content).then(res => {
								if (res.data.VarAcceptersName != "" && res.data.VarAcceptersName != "结束") {
									uni.showToast({
										title: "已发送到" + res.data.VarToNodeName + "节点，接收人：" + res
											.data.VarAcceptersName,
										icon: "none",
										mask: true,
										duration: 3000
									})
								} else if (res.data.VarAcceptersName == "结束") {
									uni.showToast({
										title: res.data.Message,
										icon: "none",
										mask: true,
										duration: 3000
									})
								} else {
									uni.showToast({
										title: res.data.Message.replace(/[@]/g, ""),
										icon: "none",
										mask: true,
										duration: 3000
									})
								}
								uni.$emit('query', {
									a: 'back'
								})
								setTimeout(() => {
									uni.navigateBack()
								}, 3000)
							}).catch(res => {
								console.log('res', res)
								uni.hideLoading()
								uni.showToast({
									title: res.msg,
									icon: "none"
								})
							})
							break
						case '018':
							uni.$u.http.post("/offcial/seal/startUsingHtSeal", this.content).then(res => {
								if (res.data.VarAcceptersName != "" && res.data.VarAcceptersName != "结束") {
									uni.showToast({
										title: "已发送到" + res.data.VarToNodeName + "节点，接收人：" + res
											.data.VarAcceptersName,
										icon: "none",
										mask: true,
										duration: 3000
									})
								} else if (res.data.VarAcceptersName == "结束") {
									uni.showToast({
										title: res.data.Message,
										icon: "none",
										mask: true,
										duration: 3000
									})
								} else {
									uni.showToast({
										title: res.data.Message.replace(/[@]/g, ""),
										icon: "none",
										mask: true,
										duration: 3000
									})
								}
								uni.$emit('query', {
									a: 'back'
								})
								setTimeout(() => {
									uni.navigateBack()
								}, 3000)
							}).catch(res => {
								console.log('res', res)
								uni.hideLoading()
								uni.showToast({
									title: res.msg,
									icon: "none"
								})
							})
							break
						case '016':
							uni.$u.http.post("/offcial/supervision", this.content).then(res => {

								uni.showToast({
									title: "保存成功",
									icon: "none",
									mask: true,
									duration: 3000
								})
								uni.$emit('query', {
									a: 'back'
								})
								setTimeout(() => {
									uni.navigateBack()
								}, 2000)
							}).catch(res => {
								uni.hideLoading()
								uni.showToast({
									title: "请稍后重试",
									icon: "none"
								})
							})
							break
					}
				}).catch(errors => {
					console.log(errors)
				})
			},
			//日历选择
			confirm(e) {
				switch (this.fkFlow) {
					case '006':
						this.content.startTime = e[0]
						this.content.endTime = e[e.length - 1]
						this.$refs.uForm.validateField("startTime")
						break
					case '007':
						this.content.startTime = e[0]
						this.content.endTime = e[e.length - 1]
						this.$refs.uForm.validateField("startTime")
						break
					case '021':
						this.content.leaveStartTime = e[0]
						this.content.leaveEndTime = e[e.length - 1]
						console.log(this.content.leaveStartTime, this.content.leaveEndTime)
						uni.$u.http.post(
							`/oa/attendance/getDays?startDate=${this.content.leaveStartTime}&endDate=${this.content.leaveEndTime}`
						).then(res => {
							this.content.leaveNumber = res.data
						})
						// if (e[0] == e[e.length - 1]) {
						// 	this.content.leaveNumber = 1
						// } else {
						// 	this.content.leaveNumber = e.length
						// }
						this.$refs.uForm.validateField("leaveStartTime")
						break
					case '015':
						this.content.startUseTime = e[0]
						this.content.endUseTime = e[e.length - 1]
						if (e[0] == e[e.length - 1]) {
							this.content.dayNum = 1
						} else {
							this.content.dayNum = e.length
						}
						this.$refs.uForm.validateField("startUseTime")
						break

				}
				this.show = false
			},
			confirmOne(e) {
				console.log('e', e)
				console.log(this.typeDate)
				switch (this.fkFlow) {
					case '020':
						if (this.typeDate == 'zhiban') {
							this.content.srcDate = e[0]
						} else if (this.typeDate == 'tiaoban') {
							this.content.targetDate = e[0]
						}
						break
					case '017':
						if (this.typeDate == 'yongzhang') {
							console.log('11')
							this.content.useTime = e[0]
						}
						break
					case '018':
						if (this.typeDate == 'yongzhang') {
							console.log('11')
							this.content.useTime = e[0]
						}
						break
					case '016':
						if (this.typeDate == 'shixian') {
							console.log('11')
							this.content.doneTime = e[0]
						}
						break
				}
				this.show1 = false
			},
			groupChange(e) {
				this.content.provinceType = e
			},
			radioChange(e) {
				console.log(e)
				this.content.params.toEmps = e.NO
				this.content.toEmpsName = e.Name

			},
			radioChange1(e) {
				console.log('65846', e)
				this.content.params.toEmps = e.NO
				this.content.toEmpsName = e.Name
			},
			cancel() {
				this.peoShow = false
				this.content.params.toEmps = null
				this.content.toEmpsName = null
				this.value = null
			},
			cancel1() {
				this.peoShow1 = false
				this.content.params.toEmps = null
				this.content.toEmpsName = null
				this.value1 = null
			},
			queren() {
				this.peoShow = false
			},
			getContent(v) {
				switch (v) {
					case '006':
						this.content = {
							outWorkDept: uni.getStorageSync('userInfo').dept.deptName,
							userName: uni.getStorageSync('userInfo').nickName,
							destination: null,
							provinceType: '0',
							startTime: null,
							endTime: null,
							reason: null,
							toEmpsName: null,
							params: {
								toEmps: null
							}
						}
						break
					case '007':
						this.content = {
							userName: uni.getStorageSync('userInfo').nickName,
							leaveTpye: null,
							trainName: null,
							destination: null,
							startTime: null,
							endTime: null,
							teacherTitle: null,
							numberOfParticipants: null
						}
						break
					case '021':
						this.content = {
							name: uni.getStorageSync('userInfo').nickName,
							deptId: uni.getStorageSync('userInfo').dept.deptId,
							inviteUnit: null,
							leaveStartTime: null,
							leaveEndTime: null,
							leaveNumber: null,
							leaveReason: null,
							params: {}
						}
						if (this.fzr == true) {
							this.content.params.toEmps = null
							this.content.toEmpsName = null
						}
						break
					case '015':
						this.content = {
							startUseTime: null,
							phone: null,
							endUseTime: null,
							dayNum: null,
							addres: null,
							useMessage: null,
							carNum: null,
							createBy: uni.getStorageSync('userInfo').nickName,
							params: {}
						}
						if (this.fzr == true) {
							this.content.params.toEmps = null
							this.content.toEmpsName = null
						}
						break
					case '020':
						this.content = {
							outWorkDept: uni.getStorageSync('userInfo').dept.deptName,
							srcDate: null,
							phone: null,
							dayNum: null,
							addres: null,
							nickNameTh: null,
							targetDate: null,
							carNum: null,
							userId: uni.getStorageSync('userInfo').userId,
							deptId: uni.getStorageSync('userInfo').deptId,
							createBy: uni.getStorageSync('userInfo').nickName,
							params: {},
							adjustUserId: null,
							user: null
						}
						if (this.Jld == false) {
							console.log('222222')
							this.content.params.toEmps = null
							this.content.toEmpsName = null
						}
						break
					case '017':
						this.content = {
							useDept: uni.getStorageSync('userInfo').dept.deptName,
							useTime: null,
							phone: null,
							dayNum: null,
							addres: null,
							carNum: null,
							userId: uni.getStorageSync('userInfo').userId,
							deptId: uni.getStorageSync('userInfo').deptId,
							createBy: uni.getStorageSync('userInfo').nickName,
							params: {},
							adjustUserId: null,
							user: null
						}
						if (this.fzr == true) {
							this.content.params.toEmps = null
							this.content.toEmpsName = null
						}
						break
					case '018':
						this.content = {
							useDept: uni.getStorageSync('userInfo').dept.deptName,
							useTime: null,
							phone: null,
							dayNum: null,
							addres: null,
							carNum: null,
							userId: uni.getStorageSync('userInfo').userId,
							deptId: uni.getStorageSync('userInfo').deptId,
							createBy: uni.getStorageSync('userInfo').nickName,
							params: {},
							adjustUserId: null,
							user: null
						}
						if (this.fzr == true) {
							this.content.params.toEmps = null
							this.content.toEmpsName = null
						}
						break
					case '016':
						this.content = {
							title: null,
							departmentHead: uni.getStorageSync('userInfo').nickName + '-' + uni.getStorageSync(
								'userInfo').dept.deptName,
							userId: uni.getStorageSync('userInfo').userId,
							deptId: uni.getStorageSync('userInfo').deptId,
							params: {},
							adjustUserId: null,
							prersonLiable: null
						}
						break
				}
			},
			getRules(v) {
				switch (v) {
					case '006':
						this.rules = this.rules1
						break
					case '007':
						this.rules = this.rules2
						break
					case '021':
						this.rules = this.rules3
						break
					case '015':
						this.rules = this.rules4
						break
					case '020':
						this.rules = this.rules5
						break
					case '017':
						this.rules = this.rules6
						break
					case '018':
						this.rules = this.rules7
						break
					case '016':
						this.rules = this.rules8
						break
				}
			},
			//获取接收人信息
			getPeoList(v) {
				uni.$u.http.get(`/jflow/restful/GenerNextStepNodeEmpsNoWorkId?flowNo=${v}&toNodeID=2003`).then(res => {
					this.deptList = res.Depts
					this.userList = res.Emps
					console.log(this.deptList)
					console.log(this.userList)
				})
			}
		},
		onReady() {
			//如果需要兼容微信小程序，并且校验规则中含有方法等，只能通过setRules方法设置规则。
			// if()
			this.$refs.uForm.setRules(this.rules)
		},
	}
</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
	}
</style>