Forráskód Böngészése

劳动合同上传功能

huangguoce 4 hete
szülő
commit
4a32548b2f

+ 29 - 0
src/api/human/enrollment/EnrollmentRegistrationService.js

@@ -483,4 +483,33 @@ export default {
 			params: params,
 		});
 	},
+	// 劳动合同接口
+	saveLaborContractInfo(data) {
+		return request({
+			url: prefix + "/laborContractInfo/save",
+			method: "post",
+			data: data,
+		});
+	},
+	deleteLaborContractInfoById(id) {
+		return request({
+			url: prefix + "/laborContractInfo/delete",
+			method: "post",
+			data: { id: id },
+		});
+	},
+	findLaborContractInfo(params) {
+		return request({
+			url: prefix + "/laborContractInfo/list",
+			method: "get",
+			params: params,
+		});
+	},
+	findLaborContractInfoById(params) {
+		return request({
+			url: prefix + "/laborContractInfo/findById",
+			method: "get",
+			params: params,
+		});
+	},
 };

+ 126 - 16
src/views/human/enrollment/registration/EnrollmentRegistrationEditForm.vue

@@ -1303,8 +1303,84 @@
 							</el-col>
 						</el-row>
 					</el-collapse-transition>
+					<!-- 劳动合同 -->
+				</el-card>
+				<el-card style="width: 100%" shadow="hover" class="card-info">
+					<template #header>
+						<el-divider content-position="left"><i class="el-icon-document"></i> <span
+								style="font-weight: 900; font-size: 16px; color: #606266;">劳动合同</span>
+							<el-divider direction="vertical" />
+							<el-button type="primary" @click="addLaborContract()">新增</el-button>
+							<el-divider direction="vertical" />
+							<el-button :type="changeFlag[8] ? 'warning' : 'success'" @click="changeInfoList(8)">{{
+								changeFlag[8] ? "收起" : "展开"
+							}}</el-button>
+						</el-divider>
+					</template>
+					<el-collapse-transition>
+						<el-row :gutter="26" v-if="changeFlag[8]">
+							<el-col :span="24">
+								<el-collapse
+									v-if="inputForm.laborContractInfoList && inputForm.laborContractInfoList.length > 0">
+									<div style="padding: 0 30px;"
+										v-for="(item, index) in inputForm.laborContractInfoList">
+										<el-collapse-item>
+											<template #title="{ isActive }">
+												<div class="collapseTitle">
+													<span style="font-size: 16px;"> {{
+														$dictUtils.getDictLabel("labor_contract_type", item.type, '-')
+													}}</span>
+													<span style="font-size: 16px;"> {{ "-" +
+														$dictUtils.getDictLabel("labor_contract_term",
+															item.term,
+															'-')
+													}}</span>
+													<div style="margin-left: auto;">
+														<el-button type="text"
+															@click.stop="editLaborContract(item.id)">修改</el-button>
+														<el-button type="text" @click.stop="delLaborContract(item.id)"
+															style="color: red;">删除</el-button>
+													</div>
+												</div>
+											</template>
+											<el-descriptions title="" border :column="2">
+												<el-descriptions-item label="合同类型:">{{
+													$dictUtils.getDictLabel("labor_contract_type", item.type,
+														'-')
+												}}</el-descriptions-item>
+												<el-descriptions-item label="合同编号:">{{ item.code
+												}}</el-descriptions-item>
+												<el-descriptions-item label="合同期限:">{{
+													$dictUtils.getDictLabel("labor_contract_term",
+														item.term,
+														'-')
+												}}</el-descriptions-item>
+												<el-descriptions-item label="合同起始日期:">{{
+													handleDateFormatter(item.startDate)
+												}}</el-descriptions-item>
+												<el-descriptions-item label="合同终止日期:">{{
+													handleDateFormatter(item.endDate)
+												}}</el-descriptions-item>
+												<el-descriptions-item label="试用期结束日期:">{{
+													handleDateFormatter(item.trialEndDate)
+												}}</el-descriptions-item>
+												<el-descriptions-item label="办理日期:">{{
+													handleDateFormatter(item.processeDate)
+												}}</el-descriptions-item>
+												<el-descriptions-item label="附件:">
+													<AttachmentView :fileList="item.files">
+													</AttachmentView>
+												</el-descriptions-item>
+											</el-descriptions>
+										</el-collapse-item>
+									</div>
+								</el-collapse>
+								<el-empty image-size="80px" style="margin-top: 0 !important;padding: 0 !important;"
+									v-else description="暂无劳动合同"></el-empty>
+							</el-col>
+						</el-row>
+					</el-collapse-transition>
 				</el-card>
-
 
 			</el-form>
 			<template #footer>
@@ -1330,6 +1406,9 @@
 			<FamilyInfo ref="familyInfo" @addFamilyInfo="handleAddFamilyInfo"></FamilyInfo>
 			<!-- 表彰与奖励 -->
 			<RewardInfo ref="rewardInfo" @addRewardInfo="handleAddRewardInfo"></RewardInfo>
+			<!-- 劳动合同 -->
+			<LaborContractInfo ref="laborContractInfo" @addLaborContractInfo="handleAddLaborContractInfo">
+			</LaborContractInfo>
 
 		</el-dialog>
 	</div>
@@ -1353,6 +1432,7 @@ import LanguageInfo from "./components/LanguageInfo";
 import FamilyInfo from "./components/FamilyInfo";
 import RewardInfo from "./components/RewardInfo";
 import AttachmentView from './components/AttachmentView'
+import LaborContractInfo from "./components/LaborContractInfo"
 
 import postService from "@/api/sys/postService";
 import roleService from "@/api/sys/roleService";
@@ -1542,14 +1622,8 @@ export default {
 					}
 				],
 				rewardInfoList: [
-					{
-						enrollmentRegistrationId: '',
-						name: "",       // 奖项
-						rewardDate: "",       // 获奖日期
-						description: "", // 简述
-						files: []
-					}
-				]
+				],
+				laborContractInfoList: []
 			},
 			workActiveNames: [],
 			eduActiveNames: [],
@@ -1557,7 +1631,7 @@ export default {
 			roleList: [],
 			postList: [],
 			changeFlag: [
-				true, true, true, true, true, true, true, true
+				true, true, true, true, true, true, true, true, true
 			]
 
 		}
@@ -1575,7 +1649,8 @@ export default {
 		LanguageInfo,
 		FamilyInfo,
 		RewardInfo,
-		AttachmentView
+		AttachmentView,
+		LaborContractInfo
 	},
 	computed: {
 		bus: {
@@ -1741,6 +1816,7 @@ export default {
 				languageInfoList: [],
 				familyInfoList: [],
 				rewardInfoList: [],
+				laborContractInfoList: [],
 				loginName: ""
 			}
 			if (method === 'add') {
@@ -1808,6 +1884,11 @@ export default {
 					if (this.commonJS.isEmpty(this.inputForm.rewardInfoList)) {
 						this.inputForm.rewardInfoList = []
 					}
+					// 劳动合同
+					if (this.commonJS.isEmpty(this.inputForm.laborContractInfoList)) {
+						this.inputForm.laborContractInfoList = []
+					}
+
 					this.inputForm.certificateInfoList.forEach(temp => {
 						this.changeType(temp.type, temp)
 					})
@@ -2576,6 +2657,40 @@ export default {
 				this.inputForm.rewardInfoList = res
 			})
 		},
+		//表彰与奖励处理
+		addLaborContract() {
+			this.$refs.laborContractInfo.init("add", null, this.inputForm.userId)
+		},
+		editLaborContract(id) {
+			this.$refs.laborContractInfo.init("edit", id, this.inputForm.userId)
+		},
+		delLaborContract(id) {
+			this.$confirm('确定删除此条合同信息吗?', '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				this.loading = true
+				enrollmentRegistrationService.deleteLaborContractInfoById(id).then(res => {
+					this.$message.success(res)
+					this.loading = false
+					this.handleGetLaborContractInfo()
+				})
+
+			}).catch(() => {
+
+			});
+		},
+		handleAddLaborContractInfo(id) {
+			this.handleGetLaborContractInfo()
+		},
+		handleGetLaborContractInfo() {
+			enrollmentRegistrationService.findLaborContractInfo({
+				userId: this.inputForm.userId
+			}).then(res => {
+				this.inputForm.laborContractInfoList = res
+			})
+		},
 		// 日期格式化
 		handleDateFormatter(dateStr) {
 			if (!dateStr) return ''; // 如果为空,返回空字符串
@@ -2616,11 +2731,6 @@ export default {
 					row.profession = obj.label
 				}
 			}
-			console.log(row);
-			console.log(row);
-			console.log(row);
-			console.log(row);
-			console.log(row);
 
 		},
 	}

+ 268 - 0
src/views/human/enrollment/registration/components/LaborContractInfo.vue

@@ -0,0 +1,268 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+	<div>
+		<el-dialog :title="title" :close-on-click-modal="false" draggable width="1200px" height="500px" @close="close"
+			append-to-body v-model="visible">
+			<el-form :model="inputForm" ref="inputForm" v-loading="loading" :rules="rules"
+				:class="method === 'view' ? 'readonly' : ''"
+				:disabled="status === 'audit' || status === 'taskFormDetail' || method === 'view'" label-width="100px"
+				@submit.native.prevent>
+				<el-row :gutter="26">
+
+					<el-col :span="12">
+						<el-form-item label="合同类型" prop="type">
+							<el-select size="default" v-model="inputForm.type" placeholder="请选择合同类型"
+								style="width: 100%;">
+								<el-option v-for="item in $dictUtils.getDictList('labor_contract_type')"
+									:key="item.value" :label="item.label" :value="item.value">
+								</el-option>
+							</el-select>
+						</el-form-item>
+					</el-col>
+
+					<el-col :span="12">
+						<el-form-item label="合同编号" prop="code">
+							<el-input v-model="inputForm.code" placeholder="请输入合同编号"></el-input>
+						</el-form-item>
+					</el-col>
+
+
+					<el-col :span="12">
+
+						<el-form-item label="合同期限" prop="term">
+							<el-select size="default" v-model="inputForm.term" placeholder="请选择合同期限"
+								style="width: 100%;">
+								<el-option v-for="item in $dictUtils.getDictList('labor_contract_term')"
+									:key="item.value" :label="item.label" :value="item.value">
+								</el-option>
+							</el-select>
+						</el-form-item>
+
+					</el-col>
+
+					<el-col :span="12">
+						<el-form-item label="合同起始日期" prop="startDate">
+							<el-date-picker v-model="inputForm.startDate" type="date" placeholder="选择合同起始日期"
+								style="width: 100%;"></el-date-picker>
+						</el-form-item>
+					</el-col>
+
+					<el-col :span="12">
+						<el-form-item label="合同终止日期" prop="endDate">
+							<el-date-picker v-model="inputForm.endDate" type="date" placeholder="选择合同终止日期"
+								style="width: 100%;"></el-date-picker>
+						</el-form-item>
+					</el-col>
+
+					<el-col :span="12">
+						<el-form-item label="试用期结束日期" prop="trialEndDate">
+							<el-date-picker v-model="inputForm.trialEndDate" type="date" placeholder="请选择试用期结束日期"
+								style="width: 100%;"></el-date-picker>
+						</el-form-item>
+					</el-col>
+
+					<el-col :span="12">
+						<el-form-item label="办理日期" prop="processeDate">
+							<el-date-picker v-model="inputForm.processeDate" type="date" placeholder="请选择办理日期"
+								style="width: 100%;"></el-date-picker>
+						</el-form-item>
+					</el-col>
+
+					<el-col :span="12">
+						<el-form-item label="附件" prop="degreeFile">
+							<UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+						</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 v-if="method === 'edit' || method == 'add'" type="primary" icon="el-icon-circle-check"
+						@click="doSubmit()">确定</el-button>
+				</span>
+			</template>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+import UpLoadComponent from '@/views/common/UpLoadComponentCardStyle'
+import enrollmentRegistrationService from '@/api/human/enrollment/EnrollmentRegistrationService'
+export default {
+	props: {
+		businessId: {
+			type: String,
+			default: ''
+		},
+		formReadOnly: {
+			type: Boolean,
+			default: false
+		},
+		status: {
+			type: String,
+			default: ''
+		}
+	},
+	data() {
+		return {
+			disabled: false,
+			title: '',
+			method: '',
+			visible: false,
+			loading: false,
+			inputForm: {
+				enrollmentRegistrationId: '',
+				type: "",
+				code: "",
+				term: "",
+				startDate: "",
+				endDate: "",
+				trialEndDate: "",
+				processeDate: "",
+				files: []
+			},
+			keyWatch: '',
+			rules: {
+				type: [
+					{ required: true, message: '请选择合同类型', trigger: 'blur' },
+				],
+				term: [
+					{ required: true, message: '请选择合同期限', trigger: 'blur' },
+				],
+
+			}
+		}
+	},
+	created() {
+	},
+	components: {
+		UpLoadComponent
+	},
+	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
+		}
+	},
+	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)
+			}
+		}
+	},
+	methods: {
+		getKeyWatch(keyWatch) {
+			this.keyWatch = keyWatch
+		},
+		init(method, id, reId) {
+			this.method = method
+			this.inputForm = {
+				id: "",
+				enrollmentRegistrationId: '',
+				type: "",
+				code: "",
+				term: "",
+				startDate: "",
+				endDate: "",
+				trialEndDate: "",
+				processeDate: "",
+				files: []
+			}
+			if (method === 'add') {
+				this.title = `新增劳动合同`
+			} else if (method === 'edit') {
+				this.title = '修改劳动合同'
+			} else if (method === 'view') {
+				this.title = '查看劳动合同'
+			}
+			this.inputForm.id = id
+			this.inputForm.userId = reId
+			this.visible = true
+			this.loading = true
+			this.$nextTick(() => {
+				if (id) {
+					enrollmentRegistrationService.findLaborContractInfoById({
+						id: this.inputForm.id
+					}).then(res => {
+						this.inputForm = this.recover(this.inputForm, res)
+						this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+						this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'laborContract')
+						this.loading = false
+					})
+				} else {
+					this.inputForm.id = id
+					this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'laborContract')
+					this.loading = false
+				}
+			})
+		},
+		// 表单提交
+		doSubmit() {
+			if (this.$refs.uploadComponent.checkProgress()) {
+				return
+			}
+			this.$refs['inputForm'].validate((valid) => {
+				if (valid) {
+					if (this.inputForm.startDate) {
+						this.inputForm.startDate = new Date(this.inputForm.startDate).getTime();
+					}
+					if (this.inputForm.endDate) {
+						this.inputForm.endDate = new Date(this.inputForm.endDate).getTime();
+					}
+					if (this.inputForm.trialEndDate) {
+						this.inputForm.trialEndDate = new Date(this.inputForm.trialEndDate).getTime();
+					}
+					if (this.inputForm.processeDate) {
+						this.inputForm.processeDate = new Date(this.inputForm.processeDate).getTime();
+					}
+					this.inputForm.files = this.$refs.uploadComponent.getDataList()
+					this.inputForm.status = "5"
+					enrollmentRegistrationService.saveLaborContractInfo(this.inputForm).then(res => {
+						this.close()
+						this.$message.success(res)
+						this.$emit("addLaborContractInfo", this.inputForm.enrollmentRegistrationId)
+						this.loading = false
+					})
+				}
+			})
+		},
+		close() {
+			this.$refs.inputForm.resetFields()
+			this.$refs.uploadComponent.clearUpload()
+			this.visible = false
+		},
+	}
+}
+</script>
+
+
+<style lang="less">
+.fileUpload {
+	.el-form-item__content {
+		width: 100%;
+	}
+}
+</style>

+ 83 - 1
src/views/sys/user/UserInfo.vue

@@ -1480,6 +1480,81 @@
 							</el-collapse-transition>
 						</el-card>
 					</el-tab-pane>
+					<el-tab-pane label="劳动合同">
+						<el-card style="width: 100%" shadow="hover" class="card-info">
+							<template #header>
+								<el-divider content-position="left"><i class="el-icon-document"></i> <span
+										style="font-weight: 900; font-size: 16px; color: #606266;">劳动合同</span>
+									<!-- <el-button type="primary" @click="addReward()"
+										:disabled="auditStatus == 2">新增</el-button> -->
+									<el-divider direction="vertical" />
+									<el-button :type="changeFlag[8] ? 'warning' : 'success'"
+										@click="changeInfoList(8)">{{
+											changeFlag[8] ? "收起" : "展开"
+										}}</el-button>
+								</el-divider>
+							</template>
+							<el-collapse-transition>
+								<el-row :gutter="26" v-if="changeFlag[8]">
+									<el-col :span="24">
+										<el-collapse v-if="laborContractInfoList && laborContractInfoList.length > 0">
+											<div style="padding: 0 30px;"
+												v-for="(item, index) in laborContractInfoList">
+												<el-collapse-item>
+													<template #title="{ isActive }">
+														<div class="collapseTitle">
+															<span style="font-size: 16px;"> {{
+																$dictUtils.getDictLabel("labor_contract_type",
+																	item.type, '-')
+															}}</span>
+															<span style="font-size: 16px;"> {{ "-" +
+																$dictUtils.getDictLabel("labor_contract_term",
+																	item.term,
+																	'-')
+															}}</span>
+
+														</div>
+													</template>
+													<el-descriptions title="" border :column="2">
+														<el-descriptions-item label="合同类型:">{{
+															$dictUtils.getDictLabel("labor_contract_type", item.type,
+																'-')
+														}}</el-descriptions-item>
+														<el-descriptions-item label="合同编号:">{{ item.code
+														}}</el-descriptions-item>
+														<el-descriptions-item label="合同期限:">{{
+															$dictUtils.getDictLabel("labor_contract_term",
+																item.term,
+																'-')
+														}}</el-descriptions-item>
+														<el-descriptions-item label="合同起始日期:">{{
+															handleDateFormatter(item.startDate)
+														}}</el-descriptions-item>
+														<el-descriptions-item label="合同终止日期:">{{
+															handleDateFormatter(item.endDate)
+														}}</el-descriptions-item>
+														<el-descriptions-item label="试用期结束日期:">{{
+															handleDateFormatter(item.trialEndDate)
+														}}</el-descriptions-item>
+														<el-descriptions-item label="办理日期:">{{
+															handleDateFormatter(item.processeDate)
+														}}</el-descriptions-item>
+														<el-descriptions-item label="附件:">
+															<AttachmentView :fileList="item.files">
+															</AttachmentView>
+														</el-descriptions-item>
+													</el-descriptions>
+												</el-collapse-item>
+											</div>
+										</el-collapse>
+										<el-empty image-size="80px"
+											style="margin-top: 0 !important;padding: 0 !important;" v-else
+											description="暂无表彰与奖励"></el-empty>
+									</el-col>
+								</el-row>
+							</el-collapse-transition>
+						</el-card>
+					</el-tab-pane>
 					<el-tab-pane label="上传头像">
 						<el-form :model="photoForm" ref="photoForm" label-width="100px">
 							<el-form-item prop="photo">
@@ -1944,7 +2019,7 @@ export default {
 				{ validator: validatePass2, trigger: "blur" },
 			],
 			changeFlag: [
-				true, true, true, true, true, true, true, true
+				true, true, true, true, true, true, true, true, true
 			],
 			//教育经历
 			eduInfoList: [
@@ -1975,6 +2050,7 @@ export default {
 			rewardInfoList: [
 
 			],
+			laborContractInfoList: [],
 			auditStatus: "0",
 			flowData: []
 		};
@@ -2111,6 +2187,11 @@ export default {
 				if (this.commonJS.isNotEmpty(data.rewardInfoList)) {
 					this.rewardInfoList = data.rewardInfoList
 				}
+				// 劳动合同
+				if (this.commonJS.isNotEmpty(data.laborContractInfoList)) {
+					this.laborContractInfoList = data.laborContractInfoList
+				}
+
 				if (this.commonJS.isEmpty(this.generalForm.idCardFront)) {
 					this.generalForm.idCardFront = []
 				}
@@ -2228,6 +2309,7 @@ export default {
 					this.languageInfoList = data.languageInfoList
 					this.trainingInfoList = data.trainingInfoList
 					this.rewardInfoList = data.rewardInfoList
+					this.laborContractInfoList = data.laborContractInfoList
 					this.workInfoList = data.workInfoList
 					this.concatForm.email = data.email
 					if (this.commonJS.isEmpty(this.generalForm.idCardFront)) {