Quellcode durchsuchen

入职关联钉钉操作

huangguoce vor 1 Monat
Ursprung
Commit
5fd60c3461

+ 23 - 16
src/api/human/depart/HandoverRecoveryService.js

@@ -2,25 +2,32 @@ import request from "@/utils/httpRequest";
 import { REGISTER_PATH as prefix } from "../../AppPath";
 
 export default {
-	save (inputForm) {
+	save(inputForm) {
 		return request({
-			url: prefix +  `/handoverRecovery/save`,
-			method: 'post',
-			data: inputForm
-		})
+			url: prefix + `/handoverRecovery/save`,
+			method: "post",
+			data: inputForm,
+		});
 	},
-	findById (id) {
+	findById(id) {
 		return request({
-			url: prefix + '/handoverRecovery/findById',
-			method: 'get',
-			params: {id: id}
-		})
+			url: prefix + "/handoverRecovery/findById",
+			method: "get",
+			params: { id: id },
+		});
 	},
-	updateStatusById (param) {
+	updateStatusById(param) {
 		return request({
-			url: prefix + '/handoverRecovery/updateStatusById',
-			method: 'post',
-			data: param
-		})
+			url: prefix + "/handoverRecovery/updateStatusById",
+			method: "post",
+			data: param,
+		});
 	},
-}
+	deleteDingTalkByTenantId(param) {
+		return request({
+			url: prefix + "/handoverRecovery/deleteDingTalkByTenantId",
+			method: "post",
+			params: param,
+		});
+	},
+};

+ 30 - 5
src/api/test/dd/dd.js

@@ -2,20 +2,23 @@ import request from "@/utils/httpRequest";
 import { TEST_PATH as prefix } from "../../AppPath";
 
 export default {
-	list(params) {
+	list(data) {
 		return request({
 			url: prefix + "/test/addressBook/list",
-			method: "get",
-			params: params,
+			method: "post",
+			data: data,
 		});
 	},
-	deptList(params) {
+	deptList(id) {
 		return request({
 			url: prefix + "/test/addressBook/deptList",
 			method: "get",
-			params: params,
+			params: {
+				deptId: id,
+			},
 		});
 	},
+
 	getWorkListCord(params) {
 		return request({
 			url: prefix + "/test/attendance/getWorkListCord",
@@ -81,4 +84,26 @@ export default {
 			params: params,
 		});
 	},
+	// 新建用户
+	addUser(data) {
+		return request({
+			url: prefix + "/test/addressBook/addUser",
+			method: "post",
+			data: data,
+		});
+	},
+	selectUserById(params) {
+		return request({
+			url: prefix + "/test/addressBook/selectUserById",
+			method: "get",
+			params: params,
+		});
+	},
+	updateUser(data) {
+		return request({
+			url: prefix + "/test/addressBook/updateUser",
+			method: "post",
+			data: data,
+		});
+	},
 };

+ 294 - 0
src/views/dd/UserAddForm.vue

@@ -0,0 +1,294 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+	<div>
+		<el-dialog :title="title" :close-on-click-modal="false" width="60%" @close="close" @keyup.enter.native=""
+			v-model="visible" @open="handleOpen">
+			<el-form :model="inputForm" :rules="rules" ref="inputForm" v-loading="loading"
+				:class="method === 'view' ? 'readonly' : ''"
+				:disabled="status === 'audit' || status === 'taskFormDetail' || method === 'view'" label-width="150px"
+				@submit.native.prevent>
+				<el-divider content-position="left"><i class="el-icon-user"></i> 基本信息</el-divider>
+				<el-row :gutter="15">
+					<el-col :span="12">
+						<el-form-item label="员工名称" prop="name">
+							<el-tooltip content="请输入员工真实姓名" placement="top">
+								<el-input placeholder="请填写员工名称" v-model="inputForm.name"></el-input>
+							</el-tooltip>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="工号" prop="jobNumber">
+							<el-input placeholder="请填写工号" v-model="inputForm.jobNumber"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="手机号" prop="mobile">
+							<el-input placeholder="请填写手机号" v-model="inputForm.mobile"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="是否隐藏手机号" prop="hideMobile">
+							<el-switch v-model="inputForm.hideMobile" size="large" active-text="是" inactive-text="否" />
+						</el-form-item>
+					</el-col>
+				</el-row>
+				<el-divider content-position="left"><i class="el-icon-office-building"></i> 职位信息</el-divider>
+				<el-row :gutter="15">
+					<el-col :span="12">
+						<el-form-item label="职位" prop="title">
+							<el-input placeholder="请填写职位" v-model="inputForm.title"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="办公地点" prop="workPlace">
+							<el-input placeholder="请填写办公地点" v-model="inputForm.workPlace"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="所属部门" prop="deptIdList">
+							<el-tree-select style="width: 100%;" v-model="inputForm.deptIdList" node-key="deptId"
+								:props="props" check-strictly default-expand-all :data="deptList" show-checkbox
+								check-on-click-node multiple />
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="入职时间" prop="hiredDate">
+							<el-date-picker v-model="inputForm.hiredDate" type="date" placeholder="请填写入职日期"
+								format="YYYY/MM/DD" value-format="x" />
+						</el-form-item>
+					</el-col>
+				</el-row>
+				<el-divider content-position="left"><i class="el-icon-message"></i> 联系方式</el-divider>
+				<el-row :gutter="15">
+					<el-col :span="12">
+						<el-form-item label="邮箱" prop="email">
+							<el-input placeholder="请填写邮箱" v-model="inputForm.email"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="企业邮箱" prop="orgEmail">
+							<el-input placeholder="请填写企业邮箱" v-model="inputForm.orgEmail"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="24">
+						<el-form-item label="备注" prop="remark">
+							<el-input type="textarea" :rows="3" placeholder="请填写备注"
+								v-model="inputForm.remark"></el-input>
+						</el-form-item>
+					</el-col>
+				</el-row>
+			</el-form>
+			<template #footer>
+				<span class="dialog-footer">
+					<el-button @click="close()" icon="el-icon-circle-close">关闭</el-button>
+					<el-button type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check"
+						v-noMoreClick>确定</el-button>
+				</span>
+			</template>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+import ddService from "@/api/test/dd/dd.js"
+import { ElDatePicker } from 'element-plus';
+// eslint-disable-next-line no-unused-vars
+import moment from 'moment'
+export default {
+	props: {
+		formReadOnly: {
+			type: Boolean,
+			default: false
+		},
+		status: {
+			type: String,
+			default: ''
+		}
+	},
+	data() {
+		return {
+			props: {
+				label: 'name',
+				children: 'children',
+			},
+			title: '',
+			method: '',
+			loading: false,
+			visible: false,
+			inputForm: {
+				userid: '',
+				name: '',
+				deptIdList: []
+			},
+			deptList: [],
+			rules: {
+				deptIdList: [
+					{ required: true, message: "请选择所属部门", trigger: "change" },
+				],
+				name: [
+					{ required: true, message: "请填写员工名称", trigger: "blur" },
+					{ min: 2, max: 20, message: "长度在 2 到 20 个字符", trigger: "blur" }
+				],
+				mobile: [
+					{ required: true, message: "请填写手机号", trigger: "blur" },
+					{ pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号格式", trigger: "blur" }
+				],
+				email: [
+					{ type: "email", message: "请输入正确的邮箱格式", trigger: "blur" }
+				],
+				orgEmail: [
+					{ type: "email", message: "请输入正确的邮箱格式", trigger: "blur" }
+				],
+				jobNumber: [
+					{ required: true, message: "请填写工号", trigger: "blur" }
+				],
+				title: [
+					{ required: true, message: "请填写职位", trigger: "blur" }
+				],
+				hiredDate: [
+					{ required: true, message: "请选择入职日期", trigger: "change" }
+				]
+			},
+		}
+	},
+	created() {
+	},
+	mounted() {
+	},
+	activated() {
+	},
+	components: {
+		ElDatePicker,
+	},
+	methods: {
+		load(node, resolve) {
+			ddService.deptList({
+				deptId: node.data.deptId
+			}).then(res => {
+				resolve(res.result)
+			})
+
+		},
+		handleGetById() {
+			this.loading = true
+			ddService.selectUserById({
+				id: this.inputForm.userid
+			}).then(res => {
+				console.log(res);
+				this.inputForm = res.result
+				this.loading = false
+			})
+		},
+		init(method, id) {
+			this.method = method
+			this.visible = true
+			if (method === 'add') {
+				this.title = `创建用户`
+			} else if (method === 'edit') {
+				this.inputForm.userid = id
+				this.title = '修改用户'
+			}
+			this.visible = true
+			this.$nextTick(() => {
+				this.loading = true
+				this.$refs.inputForm.resetFields()
+				// ddService.deptList(1).then(res => {
+				// 	res.unshift({
+				// 		deptId: 1,
+				// 		name: '顶级部门节点',
+				// 		parentId: 0
+				// 	})
+				// 	this.deptList = this.buildTree(res)
+				if (this.commonJS.isNotEmpty(this.inputForm.userid)) {
+					this.handleGetById()
+				} else {
+					this.loading = false
+
+				}
+				// })
+
+			})
+		},
+		buildTree(data) {
+			const map = new Map();
+			const tree = [];
+			console.log(data);
+
+			// 先把所有项存到 Map 里,并初始化 children
+			data.forEach(item => {
+				map.set(item.deptId, { ...item, children: [] });
+			});
+			// 组装树结构
+			data.forEach(item => {
+				if (item.parentId) {
+					// 找到父级并添加到 children
+					const parent = map.get(item.parentId);
+					if (parent) {
+						parent.children.push(map.get(item.deptId));
+					}
+				} else {
+					// parentId 为空的就是根节点
+					tree.push(map.get(item.deptId));
+				}
+			});
+
+			return tree;
+		},
+		// 表单提交
+		async doSubmit() {
+			this.loading = true
+			this.$refs['inputForm'].validate(async (valid) => {
+				if (valid) {
+					this.loading = true
+					console.log(this.inputForm);
+
+					if (this.inputForm.userid) {
+						//将数组转成字符串,以逗号分隔
+						this.inputForm.deptIdList = this.inputForm.deptIdList.join(',');
+						const res = await ddService.updateUser(this.inputForm)
+						if (res.errcode == 0) {
+							this.visible = false
+							this.$emit('refreshList')
+							this.$refs.inputForm.resetFields()
+							this.$message.success("修改成功");
+							this.loading = false
+						} else {
+							this.$message.error("添加失败,请重试");
+							this.loading = false
+						}
+					} else {
+						const res = await ddService.addUser(this.inputForm)
+						if (res.errcode == 0) {
+							this.visible = false
+							this.$emit('refreshList')
+							this.$refs.inputForm.resetFields()
+							this.$message.success("添加成功");
+							this.loading = false
+						} else {
+							this.$message.error("添加失败,请重试");
+							this.loading = false
+						}
+					}
+				} else {
+					this.loading = false
+				}
+			})
+		},
+		close() {
+			this.inputForm = {
+				id: '',
+			}
+			this.visible = false
+		},
+	}
+
+}
+</script>
+<style scoped>
+/deep/ .el-input-number .el-input__inner {
+	text-align: left;
+}
+
+/deep/ .vxe-footer--row .vxe-footer--column:nth-child(1) .vxe-cell--item {
+	font-weight: 700;
+}
+</style>

+ 88 - 78
src/views/dd/UserList.vue

@@ -4,20 +4,13 @@
             @keyup.enter="refreshList()" @submit.prevent>
             <!-- 搜索框-->
             <el-form-item prop="deptId" label="所属部门:">
-                <el-tree-select @change="handleChange" v-model="searchForm.deptId" lazy :load="load" node-key="deptId"
-                    :props="props" :data="deptList" check-strictly :render-after-expand="false" check-on-click-node
-                    style="width: 240px" />
+                <el-tree-select style="width: 100%;" v-model="searchForm.deptId" node-key="deptId" :props="props"
+                    default-expand-all :data="deptList" check-strictly show-checkbox check-on-click-node />
+            </el-form-item>
+            <el-form-item label="工作时间" prop="workDates">
+                <el-date-picker style="width:50%;" v-model="searchForm.workDates" type="datetimerange"
+                    value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择日期" @change="handleDateChange" />
             </el-form-item>
-			<el-form-item label="工作时间" prop="workDates">
-				<el-date-picker
-					style="width:50%;"
-					v-model="searchForm.workDates"
-					type="datetimerange"
-					value-format="YYYY-MM-DD HH:mm:ss"
-					placeholder="请选择日期"
-					@change="handleDateChange"
-				/>
-			</el-form-item>
             <el-form-item>
                 <el-button type="primary" @click="refreshList()" icon="search">查询</el-button>
                 <el-button type="default" @click="resetSearch()" icon="refresh-right">重置</el-button>
@@ -47,63 +40,67 @@
                     </vxe-column>
                     <vxe-column field="requiredAttDays" title="应出勤天数(天)">
                     </vxe-column>
-					<vxe-column field="attDays" title="出勤天数(天)">
-					</vxe-column>
-					<vxe-column field="restDays" title="休息天数(天)">
-					</vxe-column>
-					<vxe-column field="lateTimes" title="迟到次数(次)">
-					</vxe-column>
+                    <vxe-column field="attDays" title="出勤天数(天)">
+                    </vxe-column>
+                    <vxe-column field="restDays" title="休息天数(天)">
+                    </vxe-column>
+                    <vxe-column field="lateTimes" title="迟到次数(次)">
+                    </vxe-column>
                     <vxe-column fixed="right" align="center" width="320" title="操作">
                         <template #default="scope">
-<!--                            <el-button type="success" text @click="handleAdd(scope.row)">打卡</el-button>-->
+                            <!-- <el-button type="success" text @click="handleAdd(scope.row)">打卡</el-button> -->
+                            <el-button type="success" text @click="edit(scope.row.userid)">修改基本信息</el-button>
                             <el-button type="success" text @click="attendance(scope.row)">考勤统计</el-button>
                         </template>
                     </vxe-column>
                 </vxe-table>
                 <vxe-pager background size="small" :current-page="tablePage.currentPage" :page-size="tablePage.pageSize"
                     :total="tablePage.total" :page-sizes="[
-                        10,
-                        20,
-                        100,
-                        1000,
-                        { label: '全量数据', value: 1000000 },
-                    ]" :layouts="[
-                        'PrevPage',
-                        'JumpNumber',
-                        'NextPage',
-                        'FullJump',
-                        'Sizes',
-                        'Total',
-                    ]" @page-change="currentChangeHandle">
+            10,
+            20,
+            100,
+            1000,
+            { label: '全量数据', value: 1000000 },
+        ]" :layouts="[
+            'PrevPage',
+            'JumpNumber',
+            'NextPage',
+            'FullJump',
+            'Sizes',
+            'Total',
+        ]" @page-change="currentChangeHandle">
                 </vxe-pager>
             </div>
         </div>
         <PunchCardListDia ref="punchCardListDia"></PunchCardListDia>
         <AttendanceListDia ref="attendanceListDia"></AttendanceListDia>
+        <UserAddForm ref="userAddForm"></UserAddForm>
     </div>
 </template>
 
 <script>
 import ddService from "@/api/test/dd/dd.js"
 import PunchCardListDia from "./PunchCardListDia";
+import UserAddForm from "./UserAddForm";
 import AttendanceListDia from "./AttendanceListDia";
 export default {
     components: {
         PunchCardListDia,
-		AttendanceListDia
+        AttendanceListDia,
+        UserAddForm
     },
     data() {
         return {
             props: {
-                isLeaf: 'isLeaf',
                 label: 'name',
+                chindren: 'children'
             },
             url: "",
             showViewer: false,
             searchVisible: true,
             searchForm: {
                 deptId: null,
-				workDates:[]
+                workDates: []
             },
             dataList: [],
             deptList: [],
@@ -133,40 +130,53 @@ export default {
             $table.connect($toolbar);
         });
         this.loading = true
-        ddService.deptList().then(res => {
-            res.result.unshift({
+        ddService.deptList(1).then(res => {
+            res.unshift({
                 deptId: 1,
-                name: "根部门",
-                isLeaf: true
+                name: '顶级部门节点',
+                parentId: 0
             })
-            this.deptList = res.result
-            this.searchForm.deptId = 1
-            this.refreshList();
+            this.deptList = this.buildTree(res)
         })
+        this.searchForm.deptId = 1
+        this.refreshList();
     },
     methods: {
+        buildTree(data) {
+            const map = new Map();
+            const tree = [];
+            // 先把所有项存到 Map 里,并初始化 children
+            data.forEach(item => {
+                map.set(item.deptId, { ...item, children: [] });
+            });
+            // 组装树结构
+            data.forEach(item => {
+                if (item.parentId) {
+                    // 找到父级并添加到 children
+                    const parent = map.get(item.parentId);
+                    if (parent) {
+                        parent.children.push(map.get(item.deptId));
+                    }
+                } else {
+                    // parentId 为空的就是根节点
+                    tree.push(map.get(item.deptId));
+                }
+            });
+
+            return tree;
+        },
         handleChange(value) {
             console.log(value);
             this.searchForm.deptId = value
             this.refreshList()
         },
-        load(node, resolve) {
-            console.log(node);
-            ddService.deptList({
-                deptId: node.data.deptId
-            }).then(res => {
-                resolve(res.result)
-            })
-
-        },
         handleAdd(row) {
-            console.log('row', row)
             this.$refs.punchCardListDia.init(row.userid, row.name, row.title)
         },
-		//考勤统计
-		attendance(row){
-			this.$refs.attendanceListDia.init(row.userid, row.name, row.title);
-		},
+        //考勤统计
+        attendance(row) {
+            this.$refs.attendanceListDia.init(row.userid, row.name, row.title);
+        },
         handleClick(tab, event) {
             console.log(tab.props.name);
             this.getUserList(tab.props.name)
@@ -185,12 +195,11 @@ export default {
             this.loading = true;
             ddService
                 .list({
-                    deptId: this.searchForm.deptId,
-					dateFrom:this.searchForm.workDates[0],
-					dateTo:this.searchForm.workDates[1]
+                    deptId: this.searchForm.deptId ?? 1,
+                    dateFrom: this.searchForm.workDates[0],
+                    dateTo: this.searchForm.workDates[1]
                 })
                 .then((data) => {
-					console.log('data',data)
                     this.userDataList = data;
                     // this.tablePage.total = data.total;
                     this.loading = false;
@@ -216,12 +225,13 @@ export default {
         },
         // 新增
         add() {
-            this.$refs.workCollectAccessoryRef.init("add")
+            this.$refs.userAddForm.deptList = this.deptList
+            this.$refs.userAddForm.init("add")
         },
         // 编辑
         edit(id) {
-            console.log(id);
-            this.$refs.workCollectAccessoryRef.init("edit", id)
+            this.$refs.userAddForm.deptList = this.deptList
+            this.$refs.userAddForm.init("edit", id)
         },
         // 查看
         view(id) {
@@ -262,21 +272,21 @@ export default {
             this.searchForm.workDates = []
             this.refreshList();
         },
-		handleDateChange(val) {
-			if (val && val[0] && val[1]) {
-				const startDate = new Date(val[0]);
-				const endDate = new Date(val[1]);
-				const diffDays = (endDate - startDate) / (1000 * 3600 * 24); // 计算日期差距
+        handleDateChange(val) {
+            if (val && val[0] && val[1]) {
+                const startDate = new Date(val[0]);
+                const endDate = new Date(val[1]);
+                const diffDays = (endDate - startDate) / (1000 * 3600 * 24); // 计算日期差距
 
-				if (diffDays > 31) {
-					this.$message.warning('选择的时间范围不能超过31天');
-					// 限制选中的日期范围为31天内
-					const newEndDate = new Date(startDate);
-					newEndDate.setDate(startDate.getDate() + 31);
-					this.searchForm.workDates = [startDate, newEndDate];
-				}
-			}
-		},
+                if (diffDays > 31) {
+                    this.$message.warning('选择的时间范围不能超过31天');
+                    // 限制选中的日期范围为31天内
+                    const newEndDate = new Date(startDate);
+                    newEndDate.setDate(startDate.getDate() + 31);
+                    this.searchForm.workDates = [startDate, newEndDate];
+                }
+            }
+        },
     },
 };
 </script>

+ 197 - 186
src/views/human/depart/handover/HandoverRecoveryAddForm.vue

@@ -5,225 +5,236 @@
 </template>
 
 <script>
-	import handoverRecoveryService from '@/api/human/depart/HandoverRecoveryService'
-	import CommonApi from '@/api/cw/common/CommonApi'
+import handoverRecoveryService from '@/api/human/depart/HandoverRecoveryService'
+import CommonApi from '@/api/cw/common/CommonApi'
 
-	export default {
-		props: {
-			businessId: {
-				type: String,
-				default: ''
+export default {
+	props: {
+		businessId: {
+			type: String,
+			default: ''
+		},
+		formReadOnly: {
+			type: Boolean,
+			default: false
+		},
+		status: {
+			type: String,
+			default: ''
+		}
+	},
+	data() {
+		return {
+			title: '',
+			method: '',
+			visible: false,
+			loading: false,
+			inputForm: {
+				userId: '',
+				name: '',
+				procInsId: '',
+				handoverId: '',
+				assigneeId: '',
+				draftAdministrator: '',
+				type: '',
 			},
-			formReadOnly: {
-				type: Boolean,
-				default: false
+			keyWatch: '',
+		}
+	},
+	commonApi: null,
+	created() {
+		this.commonApi = new CommonApi()
+	},
+	components: {
+	},
+	computed: {
+		bus: {
+			get() {
+				return this.businessId
 			},
-			status: {
-				type: String,
-				default: ''
+			set(val) {
+				this.businessId = val
 			}
 		},
-		data () {
-			return {
-				title: '',
-				method: '',
-				visible: false,
-				loading: false,
-				inputForm: {
-					userId: '',
-					name: '',
-					procInsId: '',
-					handoverId: '',
-					assigneeId: '',
-					draftAdministrator: '',
-					type: '',
-				},
-				keyWatch: '',
+		name() {
+			return this.$store.state.user.name
+		},
+		userId() {
+			return this.$store.state.user.id
+		}
+	},
+	watch: {
+		'keyWatch': {
+			handler(newVal) {
+				if (this.commonJS.isNotEmpty(this.bus)) {
+					this.init('', this.bus)
+				} else {
+					this.$nextTick(() => {
+						this.$refs.inputForm.resetFields()
+					})
+				}
 			}
 		},
-		commonApi: null,
-		created () {
-			this.commonApi = new CommonApi()
+		'loading': {
+			handler(newVal) {
+				this.$emit('changeLoading', newVal)
+			}
+		}
+	},
+	methods: {
+		getKeyWatch(keyWatch) {
+			this.keyWatch = keyWatch
 		},
-		components: {
+		getUpload() {
 		},
-		computed: {
-			bus: {
-				get () {
-					return this.businessId
-				},
-				set (val) {
-					this.businessId = val
-				}
-			},
-			name () {
-				return this.$store.state.user.name
-			},
-			userId () {
-				return this.$store.state.user.id
+		init(method, id) {
+			this.method = method
+			this.inputForm = {
+				userId: '',
+				name: '',
+				procInsId: '',
+				handoverId: '',
+				assigneeId: '',
+				draftAdministrator: '',
+				type: '',
 			}
-		},
-		watch: {
-			'keyWatch': {
-				handler (newVal) {
-					if (this.commonJS.isNotEmpty(this.bus)) {
-						this.init('', this.bus)
-					} else {
-						this.$nextTick(() => {
-							this.$refs.inputForm.resetFields()
-						})
-					}
-				}
-			},
-			'loading': {
-				handler (newVal) {
-					this.$emit('changeLoading', newVal)
-				}
+			if (method === 'add') {
+				this.title = `新建门卡回收`
+			} else if (method === 'edit') {
+				this.title = '修改门卡回收信息'
 			}
+			this.inputForm.id = id
+			this.visible = true
+			this.loading = false
+			this.$nextTick(() => {
+				this.loading = true
+				handoverRecoveryService.findById(this.inputForm.id).then(async (data) => {
+					if (this.status === 'audit' || this.status === 'taskFormDetail') {
+						method = 'view'
+					}
+					this.inputForm = this.recover(this.inputForm, data)
+					this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+
+					this.loading = false
+				})
+			})
 		},
-		methods: {
-			getKeyWatch (keyWatch) {
-				this.keyWatch = keyWatch
-			},
-			getUpload () {
-			},
-			init (method, id) {
-				this.method = method
-				this.inputForm = {
-					userId: '',
-					name: '',
-					procInsId: '',
-					handoverId: '',
-					assigneeId: '',
-					draftAdministrator: '',
-					type: '',
-				}
-				if (method === 'add') {
-					this.title = `新建门卡回收`
-				} else if (method === 'edit') {
-					this.title = '修改门卡回收信息'
+		// 表单提交
+		doSubmit() {
+			this.loading = true
+			this.inputForm.id = this.businessId
+			handoverRecoveryService.save(this.inputForm).then((data) => {
+				this.close()
+				this.$message.success(data)
+				this.$emit('refreshDataList')
+				this.loading = false
+			}).catch(() => {
+				this.loading = false
+			})
+		},
+		close() {
+			this.fileList = []
+			this.fileList2 = []
+			this.visible = false
+		},
+		reapplyForm(callback) {
+			this.loading = true
+			handoverRecoveryService.findById(this.inputForm.id).then((data) => {
+				if (data.type !== '4') { // 审核状态不是“驳回”,就弹出提示
+					this.loading = false
+					this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+					throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+				} else {
+					this.startForm(callback)
 				}
-				this.inputForm.id = id
-				this.visible = true
+			})
+		},
+		// 送审
+		async startForm(callback) {
+			this.loading = true
+			this.inputForm.type = '2'
+			handoverRecoveryService.save(this.inputForm).then((data) => {
+				this.inputForm.title = `${this.$store.state.user.name} 发起了 [门卡回收]`
+				this.inputForm.id = data.businessId
+				callback(data.businessTable, data.businessId, this.inputForm)
 				this.loading = false
-				this.$nextTick(() => {
+			}).catch(() => {
+				this.loading = false
+			})
+		},
+
+		// 通过
+		async agreeForm(callback) {
+			this.loading = true
+			handoverRecoveryService.findById(this.inputForm.id).then((data) => {
+				if (data.type !== '2') { // 审核状态不是“审核中”,就弹出提示
+					this.loading = false
+					this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+					throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+				} else {
 					this.loading = true
-					handoverRecoveryService.findById(this.inputForm.id).then( async (data) => {
-						if (this.status === 'audit' || this.status === 'taskFormDetail') {
-							method = 'view'
-						}
-						this.inputForm = this.recover(this.inputForm, data)
-						this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+					this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((data) => {
+						if (this.commonJS.isNotEmpty(data)) {
+							if (data === '门卡注销') {
+								this.inputForm.type = '5'
 
-						this.loading = false
+								if (this.$dictUtils.getDictValue('dd_status', 'dd_status') == 1) {
+									//获取用户数据
+									let userInfo = this.$TOOL.data.get("USER_INFO");
+									if (userInfo.mobile && userInfo.mobile != "") {
+										//调用删除钉钉数据接口
+										handoverRecoveryService.deleteDingTalkByTenantId({
+											mobilePhone: userInfo.mobile
+										})
+									}
+								}
+
+							}
+						}
+						handoverRecoveryService.save(this.inputForm).then((data) => {
+							callback(data.businessTable, data.businessId, this.inputForm)
+							this.loading = false
+						}).catch(() => {
+							this.loading = false
+						})
 					})
-				})
-			},
-			// 表单提交
-			doSubmit () {
-				this.loading = true
-				this.inputForm.id = this.businessId
-				handoverRecoveryService.save(this.inputForm).then((data) => {
-					this.close()
-					this.$message.success(data)
-					this.$emit('refreshDataList')
-					this.loading = false
-				}).catch(() => {
-					this.loading = false
-				})
-			},
-			close () {
-				this.fileList = []
-				this.fileList2 = []
-				this.visible = false
-			},
-			reapplyForm (callback) {
+				}
+			})
+		},
+		// 修改状态
+		updateStatusById(type, callback) {
+			if (type === 'reject') {
 				this.loading = true
 				handoverRecoveryService.findById(this.inputForm.id).then((data) => {
-					if (data.type !== '4') { // 审核状态不是“驳回”,就弹出提示
+					if (data.type !== '2') { // 审核状态不是“审核中”,就弹出提示
 						this.loading = false
 						this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
 						throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
 					} else {
-						this.startForm(callback)
+						handoverRecoveryService.updateStatusById(this.inputForm).then(() => {
+							this.loading = false
+							callback()
+						})
+
 					}
 				})
-			},
-			// 送审
-			async startForm (callback) {
-				this.loading = true
-				this.inputForm.type = '2'
-				handoverRecoveryService.save(this.inputForm).then((data) => {
-					this.inputForm.title = `${this.$store.state.user.name} 发起了 [门卡回收]`
-					this.inputForm.id = data.businessId
-					callback(data.businessTable, data.businessId, this.inputForm)
-					this.loading = false
-				}).catch(() => {
-					this.loading = false
-				})
-			},
-
-			// 通过
-			async agreeForm (callback) {
+			} else if (type === 'hold') {
 				this.loading = true
 				handoverRecoveryService.findById(this.inputForm.id).then((data) => {
-					if (data.type !== '2') { // 审核状态不是“审核中”,就弹出提示
+					if (data.type !== '4') { // 审核状态不是“驳回”,就弹出提示
 						this.loading = false
 						this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
 						throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
 					} else {
-						this.loading = true
-						this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((data) => {
-							if (this.commonJS.isNotEmpty(data)) {
-								if (data === '门卡注销') {
-									this.inputForm.type = '5'
-								}
-							}
-							handoverRecoveryService.save(this.inputForm).then((data) => {
-								callback(data.businessTable, data.businessId, this.inputForm)
-								this.loading = false
-							}).catch(() => {
-								this.loading = false
-							})
+						this.inputForm.type = '1'
+						handoverRecoveryService.updateStatusById(this.inputForm).then(() => {
+							this.loading = false
+							callback()
 						})
-
 					}
 				})
-			},
-			// 修改状态
-			updateStatusById (type, callback) {
-				if (type === 'reject') {
-					this.loading = true
-					handoverRecoveryService.findById(this.inputForm.id).then((data) => {
-						if (data.type !== '2') { // 审核状态不是“审核中”,就弹出提示
-							this.loading = false
-							this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
-							throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
-						} else {
-							handoverRecoveryService.updateStatusById(this.inputForm).then(() => {
-								this.loading = false
-								callback()
-							})
-
-						}
-					})
-				} else if (type === 'hold') {
-					this.loading = true
-					handoverRecoveryService.findById(this.inputForm.id).then((data) => {
-						if (data.type !== '4') { // 审核状态不是“驳回”,就弹出提示
-							this.loading = false
-							this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
-							throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
-						} else {
-							this.inputForm.type = '1'
-							handoverRecoveryService.updateStatusById(this.inputForm).then(() => {
-								this.loading = false
-								callback()
-							})
-						}
-					})
-				}
-			},
-		}
+			}
+		},
 	}
+}
 </script>

+ 1 - 0
src/views/human/depart/registration/DepartRegistrationList.vue

@@ -237,6 +237,7 @@ export default {
 			$table.connect($toolbar);
 		})
 		this.refreshList()
+
 	},
 	activated() {
 		this.refreshList()

Datei-Diff unterdrückt, da er zu groß ist
+ 1085 - 1201
src/views/human/enrollment/registration/EnrollmentRegistrationEditForm.vue