入职流程完成
This commit is contained in:
@@ -9,6 +9,13 @@ export function listUser(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 查询用户列表
|
||||
export function tempRole(userId) {
|
||||
return request({
|
||||
url: '/system/user/tempRole/'+userId,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 查询员工列表
|
||||
export function listWorker(query) {
|
||||
|
||||
@@ -62,3 +62,10 @@ export function returnList(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function getTaskFormDetail(taskId) {
|
||||
return request({
|
||||
url: '/workflow/task/processVariables/'+taskId,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
@@ -159,18 +159,20 @@ export default {
|
||||
Authorization: "Bearer " + getToken(),
|
||||
}
|
||||
cur['on-success'] = (res, file, fileList) => {
|
||||
|
||||
formData[cur.__vModel__] = fileList;
|
||||
if (res.code === 200 && fileList) {
|
||||
config.defaultValue = fileList;
|
||||
fileList.forEach(val =>{
|
||||
val.url = val.response.data.url;
|
||||
val.ossId = val.response.data.ossId;
|
||||
val.url = val.response.url;
|
||||
val.fileName = val.response.fileName;
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
// 点击文件列表中已上传的文件时的钩子
|
||||
cur['on-preview'] = (file) => {
|
||||
this.$download(file.ossId)
|
||||
this.$download.resource(file.fileName)
|
||||
}
|
||||
}
|
||||
if (config.children) {
|
||||
@@ -235,7 +237,8 @@ export default {
|
||||
debugger
|
||||
this.$emit('getData', this[this.formConf.formModel])
|
||||
// this.$emit('getData',this.formConfCopy)
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
render(h) {
|
||||
return renderFrom.call(this, h)
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addUser, deptTreeSelect, listUser} from "@/api/system/user";
|
||||
import {addUser, deptTreeSelect, listUser, tempRole} from "@/api/system/user";
|
||||
import {addOnboarding} from "@/api/oa/onboarding";
|
||||
|
||||
export default {
|
||||
@@ -227,34 +227,28 @@ export default {
|
||||
});
|
||||
},
|
||||
/** 新增入职 */
|
||||
//TODO status:0 现在新增后账号立马开通不走流程
|
||||
saveFormToOnboarding(){
|
||||
this.loading=true;
|
||||
let userForm = {
|
||||
userName: this.form.userName,
|
||||
nickName: this.form.nickName,
|
||||
phonenumber: this.form.phonenumber,
|
||||
email: this.form.email,
|
||||
address: this.form.address,
|
||||
password: "123456",
|
||||
sex:this.form.sex,
|
||||
userType:"sys_user",
|
||||
deptId:this.form.deptId,
|
||||
avatar:this.form.idPhoto,
|
||||
status:0,
|
||||
idCard:this.form.idCard,
|
||||
bankCard:this.form.bankCard,
|
||||
}
|
||||
// 添加入职后添加用户账号
|
||||
addUser(userForm).then(response => {
|
||||
userForm.password = null;
|
||||
listUser(userForm).then(response => {
|
||||
this.form.userId = response.rows[0].userId;
|
||||
addOnboarding(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.loading = false;
|
||||
this.goBack()
|
||||
let userId = response.rows[0].userId;
|
||||
this.form.userId = userId
|
||||
tempRole(userId).then(response => {
|
||||
addOnboarding(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.loading = false;
|
||||
this.goBack()
|
||||
})
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
@@ -38,21 +38,11 @@
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="toAddOnboarding"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:onboarding:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:onboarding:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
@@ -83,61 +73,12 @@
|
||||
<el-table-column label="姓名" align="center" prop="nickName"/>
|
||||
<el-table-column label="入职日期" align="center" prop="joiningDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.joiningDate, '{y}-{m}-{d}') }}</span>
|
||||
<span>{{scope.row.joiningDate!==null?scope.row.joiningDate:'未完成审批流程'}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="试用结束" align="center" prop="confirmDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.probationPeriodEnd, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入职资料" align="center" prop="documentsSubmitted">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.documentsSubmitted===1?'success':'warning'">{{ scope.row.documentsSubmitted===1?'完成':'未完成' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="入职培训" align="center" prop="orientationCompleted" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.orientationCompleted===1?'success':'warning'">{{ scope.row.orientationCompleted===1?'完成':'未完成' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入职状态" align="center" prop="joiningStatus">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.joining_status" :value="scope.row.joiningStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="完成面试" align="center" prop="recruitmentCompleted" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.recruitmentCompleted===1?'success':'warning'">{{ scope.row.recruitmentCompleted===1?'完成':'未完成' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="Offer发放" align="center" prop="offerIssued" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.offerIssued===1?'success':'warning'">{{ scope.row.offerIssued===1?'完成':'未完成' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="签署合同" align="center" prop="contractSigned" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.contractSigned===1?'success':'warning'">{{ scope.row.contractSigned===1?'完成':'未完成' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="条件准备" align="center" prop="workConditionsPrepared" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.workConditionsPrepared===1?'success':'warning'">{{ scope.row.workConditionsPrepared===1?'完成':'未完成' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="学历" align="center" prop="highestDegree" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:onboarding:edit']"
|
||||
>完善信息</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@@ -159,54 +100,20 @@
|
||||
|
||||
<!-- 添加或修改入职管理对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="用户ID (外键)" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户ID (外键)" />
|
||||
<el-form ref="form" :model="form" :rules="rules">
|
||||
<el-form-item label="输入新员工姓名" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入新员工姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入职日期" prop="joiningDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.joiningDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择入职日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="试用期结束日期" prop="probationPeriodEnd">
|
||||
<el-date-picker clearable
|
||||
v-model="form.probationPeriodEnd"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择试用期结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="直属经理ID" prop="managerId">
|
||||
<el-input v-model="form.managerId" placeholder="请输入直属经理ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否提交入职资料" prop="documentsSubmitted">
|
||||
<el-input v-model="form.documentsSubmitted" placeholder="请输入是否提交入职资料" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否完成入职培训" prop="orientationCompleted">
|
||||
<el-input v-model="form.orientationCompleted" placeholder="请输入是否完成入职培训" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入职状态(pending,completed,onboarding)" prop="joiningStatus">
|
||||
<el-select v-model="form.joiningStatus" placeholder="请选择入职状态(pending,completed,onboarding)">
|
||||
<el-option
|
||||
v-for="dict in dict.type.joining_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="parseInt(dict.value)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="最高学历" prop="highestDegree">
|
||||
<el-input v-model="form.highestDegree" placeholder="请输入最高学历" />
|
||||
<el-form-item label="输入新员工账号" prop="userName">
|
||||
<el-input v-model="form.userName" placeholder="请输入新员工账号,建议使用员工拼音" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
<el-input v-model="form.remark" placeholder="请输入备注内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button type="primary" @click="saveFormToOnboarding">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@@ -215,6 +122,7 @@
|
||||
|
||||
<script>
|
||||
import { listOnboarding, getOnboarding, delOnboarding, addOnboarding, updateOnboarding } from "@/api/oa/onboarding";
|
||||
import {addUser, listUser, tempRole} from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
name: "Onboarding",
|
||||
@@ -245,75 +153,18 @@ export default {
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
idPhoto: undefined,
|
||||
userId: undefined,
|
||||
joiningDate: undefined,
|
||||
probationPeriodEnd: undefined,
|
||||
managerId: undefined,
|
||||
documentsSubmitted: undefined,
|
||||
orientationCompleted: undefined,
|
||||
joiningStatus: undefined,
|
||||
recruitmentCompleted: undefined,
|
||||
offerIssued: undefined,
|
||||
contractSigned: undefined,
|
||||
materialsPrepared: undefined,
|
||||
trainingCompleted: undefined,
|
||||
workConditionsPrepared: undefined,
|
||||
highestDegree: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
onboardingId: [
|
||||
{ required: true, message: "入职记录ID不能为空", trigger: "blur" }
|
||||
userName: [
|
||||
{ required: true, message: "系统账号不能为空", trigger: "blur" }
|
||||
],
|
||||
idPhoto: [
|
||||
{ required: true, message: "证件照不能为空", trigger: "blur" }
|
||||
nickName: [
|
||||
{ required: true, message: "姓名不能为空", trigger: "blur" }
|
||||
],
|
||||
userId: [
|
||||
{ required: true, message: "用户ID (外键)不能为空", trigger: "blur" }
|
||||
],
|
||||
joiningDate: [
|
||||
{ required: true, message: "入职日期不能为空", trigger: "blur" }
|
||||
],
|
||||
probationPeriodEnd: [
|
||||
{ required: true, message: "试用期结束日期不能为空", trigger: "blur" }
|
||||
],
|
||||
managerId: [
|
||||
{ required: true, message: "直属经理ID不能为空", trigger: "blur" }
|
||||
],
|
||||
documentsSubmitted: [
|
||||
{ required: true, message: "是否提交入职资料不能为空", trigger: "blur" }
|
||||
],
|
||||
orientationCompleted: [
|
||||
{ required: true, message: "是否完成入职培训不能为空", trigger: "blur" }
|
||||
],
|
||||
joiningStatus: [
|
||||
{ required: true, message: "入职状态(pending,completed,onboarding)不能为空", trigger: "change" }
|
||||
],
|
||||
recruitmentCompleted: [
|
||||
{ required: true, message: "是否完成招聘与面试不能为空", trigger: "change" }
|
||||
],
|
||||
offerIssued: [
|
||||
{ required: true, message: "是否已发放Offer不能为空", trigger: "change" }
|
||||
],
|
||||
contractSigned: [
|
||||
{ required: true, message: "是否已签署合同不能为空", trigger: "change" }
|
||||
],
|
||||
materialsPrepared: [
|
||||
{ required: true, message: "入职材料/工作准备是否完成不能为空", trigger: "change" }
|
||||
],
|
||||
trainingCompleted: [
|
||||
{ required: true, message: "是否完成入职培训不能为空", trigger: "change" }
|
||||
],
|
||||
workConditionsPrepared: [
|
||||
{ required: true, message: "是否完成工作条件准备不能为空", trigger: "change" }
|
||||
],
|
||||
highestDegree: [
|
||||
{ required: true, message: "最高学历不能为空", trigger: "blur" }
|
||||
],
|
||||
|
||||
}
|
||||
};
|
||||
},
|
||||
@@ -324,7 +175,6 @@ export default {
|
||||
|
||||
/** 新增入职员工界面 */
|
||||
toAddOnboarding(){
|
||||
|
||||
this.$router.push({
|
||||
path: '/people/addOnboarding',
|
||||
})
|
||||
@@ -334,7 +184,6 @@ export default {
|
||||
this.loading = true;
|
||||
listOnboarding(this.queryParams).then(response => {
|
||||
this.onboardingList = response.rows;
|
||||
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
@@ -350,19 +199,6 @@ export default {
|
||||
onboardingId: undefined,
|
||||
idPhoto: undefined,
|
||||
userId: undefined,
|
||||
joiningDate: undefined,
|
||||
probationPeriodEnd: undefined,
|
||||
managerId: undefined,
|
||||
documentsSubmitted: undefined,
|
||||
orientationCompleted: undefined,
|
||||
joiningStatus: undefined,
|
||||
recruitmentCompleted: undefined,
|
||||
offerIssued: undefined,
|
||||
contractSigned: undefined,
|
||||
materialsPrepared: undefined,
|
||||
trainingCompleted: undefined,
|
||||
workConditionsPrepared: undefined,
|
||||
highestDegree: undefined,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
@@ -392,36 +228,34 @@ export default {
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加入职管理";
|
||||
this.title = "添加入职账户";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.$router.push('/people/updateOnboarding/'+row.onboardingId);
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.onboardingId != null) {
|
||||
updateOnboarding(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
|
||||
/** 新增入职 */
|
||||
saveFormToOnboarding(){
|
||||
let userForm = {
|
||||
userName: this.form.userName,
|
||||
password: "123456",
|
||||
userType:"sys_user",
|
||||
status:0,
|
||||
nickName:this.form.nickName,
|
||||
}
|
||||
// 添加入职后添加用户账号
|
||||
addUser(userForm).then(response => {
|
||||
userForm.password = null;
|
||||
listUser(userForm).then(response => {
|
||||
let userId = response.rows[0].userId;
|
||||
this.form.userId = userId
|
||||
tempRole(userId).then(response => {
|
||||
addOnboarding(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.reset()
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
<!-- 初始状态 -->
|
||||
<div v-if="currentStep === 0" class="initiation-card">
|
||||
<div class="welcome-section">
|
||||
<el-image
|
||||
src="https://example.com/onboarding-illustration.svg"
|
||||
<el-image
|
||||
src="https://example.com/onboarding-illustration.svg"
|
||||
class="welcome-illustration"
|
||||
:preview-src-list="[]">
|
||||
<div slot="error" class="image-slot">
|
||||
@@ -30,8 +30,8 @@
|
||||
<p class="welcome-subtitle">让我们开始您的入职流程</p>
|
||||
</div>
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
<el-button
|
||||
type="primary"
|
||||
class="start-button"
|
||||
@click="startOnboarding"
|
||||
:loading="loading">
|
||||
@@ -50,31 +50,19 @@
|
||||
<!-- 表单状态 -->
|
||||
<transition name="el-fade-in">
|
||||
<div v-if="currentStep === 1" class="form-container">
|
||||
<el-skeleton :rows="5" animated v-if="loading" />
|
||||
|
||||
<el-skeleton :rows="5" animated v-if="loading"/>
|
||||
|
||||
<div v-else class="form-content">
|
||||
<div class="form-header">
|
||||
<h3>入职信息登记(1/2)</h3>
|
||||
<el-progress :percentage="50" :show-text="false" />
|
||||
|
||||
</div>
|
||||
<div class="form-conf" v-if="formOpen">
|
||||
<parser :key="new Date().getTime()" :form-conf="formData" @submit="submit" ref="parser" @getData="getData"/>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<el-button @click="currentStep = 0">上一步</el-button>
|
||||
</div>
|
||||
|
||||
<el-form
|
||||
:model="employeeData"
|
||||
class="employee-form"
|
||||
label-position="top">
|
||||
<!-- 表单字段 -->
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="employeeData.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="邮箱">
|
||||
<el-input v-model="employeeData.email"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<div class="form-actions">
|
||||
<el-button @click="currentStep = 0">上一步</el-button>
|
||||
<el-button type="primary" @click="submitForm">提交审核</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
@@ -93,31 +81,98 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Parser from "@/utils/generator/parser";
|
||||
import {
|
||||
detailProcess,
|
||||
getProcessForm,
|
||||
listOwnProcess,
|
||||
listProcess,
|
||||
listTodoProcess,
|
||||
startProcess
|
||||
} from "@/api/workflow/process";
|
||||
import {complete} from "@/api/workflow/task";
|
||||
|
||||
export default {
|
||||
components: {Parser},
|
||||
data() {
|
||||
return {
|
||||
currentStep: 0, // 0-开启流程 1-填写资料 2-等待审核
|
||||
loading: false,
|
||||
employeeData: {
|
||||
name: "",
|
||||
email: ""
|
||||
}
|
||||
formOpen: false,
|
||||
formData: {
|
||||
|
||||
},
|
||||
taskForm: {},
|
||||
queryParams: {
|
||||
category: "onboarding",
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
},
|
||||
deployId: "",
|
||||
definitionId: "",
|
||||
procInsId: null,
|
||||
dateRange: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOwnProcess(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.todoList = response.rows;
|
||||
console.log(response);
|
||||
if (response.rows.length > 0) {
|
||||
this.currentStep=2
|
||||
this.loading = false
|
||||
}else{
|
||||
listProcess(this.queryParams).then(response => {
|
||||
this.deployId = response.rows[0].deploymentId;
|
||||
this.definitionId = response.rows[0].definitionId;
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
submit(data) {
|
||||
if (data && this.definitionId) {
|
||||
// 启动流程并将表单数据加入流程变量
|
||||
startProcess(this.definitionId, JSON.stringify(data.valData)).then(res => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.currentStep = 2;
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
async startOnboarding() {
|
||||
this.loading = true
|
||||
try {
|
||||
await new Promise(resolve => setTimeout(resolve, 1500))
|
||||
this.initData()
|
||||
this.currentStep = 1
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
// 这里添加实际提交逻辑
|
||||
this.currentStep = 2
|
||||
},
|
||||
}
|
||||
,
|
||||
|
||||
initData() {
|
||||
getProcessForm({
|
||||
definitionId: this.definitionId,
|
||||
deployId: this.deployId,
|
||||
procInsId: this.procInsId
|
||||
}).then(res => {
|
||||
if (res.data) {
|
||||
this.formData = res.data;
|
||||
this.formOpen = true
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
}
|
||||
,
|
||||
|
||||
|
||||
async logout() {
|
||||
this.$confirm('确定注销并退出系统吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
@@ -129,7 +184,32 @@ export default {
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
}
|
||||
,
|
||||
|
||||
/** 接收子组件传的值 */
|
||||
getData(data) {
|
||||
if (data) {
|
||||
const variables = [];
|
||||
data.fields.forEach(item => {
|
||||
let variableData = {};
|
||||
variableData.label = item.__config__.label
|
||||
// 表单值为多个选项时
|
||||
if (item.__config__.defaultValue instanceof Array) {
|
||||
const array = [];
|
||||
item.__config__.defaultValue.forEach(val => {
|
||||
array.push(val)
|
||||
})
|
||||
variableData.val = array;
|
||||
} else {
|
||||
variableData.val = item.__config__.defaultValue
|
||||
}
|
||||
variables.push(variableData)
|
||||
})
|
||||
this.variables = variables;
|
||||
}
|
||||
}
|
||||
,
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -163,6 +243,14 @@ export default {
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.form-content {
|
||||
padding-top: 360px;
|
||||
}
|
||||
|
||||
.form-conf {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.form-actions {
|
||||
margin-top: 40px;
|
||||
display: flex;
|
||||
@@ -175,7 +263,6 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
padding: 2rem;
|
||||
height: 100vh;
|
||||
}
|
||||
@@ -253,6 +340,7 @@ export default {
|
||||
|
||||
.process-steps {
|
||||
margin: 2rem 0;
|
||||
|
||||
::v-deep .el-step__head {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
@@ -286,7 +374,7 @@ export default {
|
||||
.form-container {
|
||||
background: white;
|
||||
border-radius: 16px;
|
||||
padding: 40px;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
max-width: 800px;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
|
||||
@@ -294,7 +382,8 @@ export default {
|
||||
z-index: 1;
|
||||
|
||||
.form-header {
|
||||
margin-bottom: 2rem;
|
||||
margin-bottom: 5rem;
|
||||
|
||||
h3 {
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 1rem;
|
||||
@@ -327,14 +416,14 @@ export default {
|
||||
top: 10px;
|
||||
width: 95%;
|
||||
padding: 10px;
|
||||
|
||||
|
||||
::v-deep .el-step__title {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.onboarding-container {
|
||||
padding-top: 80px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<span>填写表单</span>
|
||||
</div>
|
||||
<el-col :span="20" :offset="2">
|
||||
<parser :form-conf="taskFormData" ref="taskFormParser"/>
|
||||
<parser :form-conf="taskFormData" ref="taskFormParser" @submit="submit"/>
|
||||
</el-col>
|
||||
</el-card>
|
||||
<el-card class="box-card" shadow="hover">
|
||||
@@ -21,7 +21,7 @@
|
||||
<el-form-item label="审批意见" prop="comment">
|
||||
<el-input type="textarea" :rows="5" v-model="taskForm.comment" placeholder="请输入 审批意见"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="抄送人" prop="copyUserIds">
|
||||
<el-form-item label="抄送人" prop="copyUserIds">
|
||||
<el-tag
|
||||
:key="index"
|
||||
v-for="(item, index) in copyUser"
|
||||
@@ -30,7 +30,8 @@
|
||||
@close="handleClose('copy', item)">
|
||||
{{ item.nickName }}
|
||||
</el-tag>
|
||||
<el-button class="button-new-tag" type="primary" icon="el-icon-plus" size="mini" circle @click="onSelectCopyUsers" />
|
||||
<el-button class="button-new-tag" type="primary" icon="el-icon-plus" size="mini" circle
|
||||
@click="onSelectCopyUsers"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="指定审批人" prop="copyUserIds">
|
||||
<el-tag
|
||||
@@ -41,7 +42,8 @@
|
||||
@close="handleClose('next', item)">
|
||||
{{ item.nickName }}
|
||||
</el-tag>
|
||||
<el-button class="button-new-tag" type="primary" icon="el-icon-plus" size="mini" circle @click="onSelectNextUsers" />
|
||||
<el-button class="button-new-tag" type="primary" icon="el-icon-plus" size="mini" circle
|
||||
@click="onSelectNextUsers"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
@@ -72,7 +74,7 @@
|
||||
<!--流程处理表单模块-->
|
||||
<el-col :span="20" :offset="2">
|
||||
<claim-detail :form="form" :detailList="detailList" v-if="formType ==='claim'"></claim-detail>
|
||||
<parser :form-conf="formInfo" v-else/>
|
||||
<parser :form-conf="formInfo" v-else @getData="getData"/>
|
||||
</el-col>
|
||||
</el-card>
|
||||
</div>
|
||||
@@ -210,15 +212,16 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {detailProcess} from '@/api/workflow/process'
|
||||
import {detailProcess, startProcess} from '@/api/workflow/process'
|
||||
import Parser from '@/utils/generator/parser'
|
||||
import {complete, delegate, transfer, rejectTask, returnList, returnTask} from '@/api/workflow/task'
|
||||
import {selectUser, deptTreeSelect} from '@/api/system/user'
|
||||
import {complete, delegate, transfer, rejectTask, returnList, returnTask, getTaskFormDetail} from '@/api/workflow/task'
|
||||
import {selectUser, deptTreeSelect, updateUser} from '@/api/system/user'
|
||||
import ProcessViewer from '@/components/ProcessViewer'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import ClaimDetail from "../../components/ClaimDetail/index.vue";
|
||||
import {getOaClaim, getOaClaimByProcInsId} from "../../../api/oa/claim";
|
||||
import {updateOnboarding} from "@/api/oa/onboarding";
|
||||
|
||||
export default {
|
||||
name: "WorkDetail",
|
||||
@@ -348,10 +351,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
this.loading = true
|
||||
this.taskForm.procInsId = this.$route.params && this.$route.params.procInsId;
|
||||
this.taskForm.taskId = this.$route.query && this.$route.query.taskId;
|
||||
|
||||
this.formType = this.$route.query.category;
|
||||
|
||||
this.processed = this.$route.query && eval(this.$route.query.processed || false);
|
||||
if (this.$route.query.category === 'claim') {
|
||||
getOaClaimByProcInsId(this.$route.params.procInsId).then(res => {
|
||||
@@ -462,8 +466,8 @@ export default {
|
||||
getProcessDetails(procInsId, taskId) {
|
||||
const params = {procInsId: procInsId, taskId: taskId}
|
||||
detailProcess(params).then(res => {
|
||||
console.log(res.data)
|
||||
const data = res.data;
|
||||
|
||||
this.xmlData = data.bpmnXml;
|
||||
this.processFormList = data.processFormList;
|
||||
this.taskFormOpen = data.existTaskForm;
|
||||
@@ -515,10 +519,32 @@ export default {
|
||||
//执行是否同意的任务
|
||||
complete(this.taskForm).then(response => {
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
if (this.formType==="onboarding"){
|
||||
// 如果为入职流程则
|
||||
this.getOnboardingForm()
|
||||
}
|
||||
this.goBack();
|
||||
});
|
||||
})
|
||||
},
|
||||
getOnboardingForm() {
|
||||
// 如果为入职申请则将其记录到档案中,
|
||||
getTaskFormDetail(this.taskForm.taskId).then(res => {
|
||||
console.log(res.data)
|
||||
let form = res.data;
|
||||
form.idPhoto = res.data.idPhoto[0].fileName
|
||||
form.checkInFile = res.data.checkInFile[0].fileName;
|
||||
form.registerFile = res.data.registerFile[0].fileName;
|
||||
form.trainFile = res.data.trainFile[0].fileName;
|
||||
form.userId = res.data.initiator;
|
||||
form.avatar = form.idPhoto
|
||||
updateUser(form).then(res => {
|
||||
updateOnboarding(form).then(res => {
|
||||
// TODO 调用新增档案将此form存入档案表中,接下来 转正 各种记录 均进行更新档案表操作
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
/** 委派任务 */
|
||||
handleDelegate() {
|
||||
this.$refs["taskForm"].validate(valid => {
|
||||
@@ -541,6 +567,9 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
getData(data) {
|
||||
console.log(JSON.stringify(data.valData))
|
||||
},
|
||||
/** 拒绝任务 */
|
||||
handleReject() {
|
||||
this.$refs["taskForm"].validate(valid => {
|
||||
@@ -564,28 +593,7 @@ export default {
|
||||
this.$tab.closePage(this.$route)
|
||||
this.$router.back()
|
||||
},
|
||||
/** 接收子组件传的值 */
|
||||
getData(data) {
|
||||
if (data) {
|
||||
const variables = [];
|
||||
data.fields.forEach(item => {
|
||||
let variableData = {};
|
||||
variableData.label = item.__config__.label
|
||||
// 表单值为多个选项时
|
||||
if (item.__config__.defaultValue instanceof Array) {
|
||||
const array = [];
|
||||
item.__config__.defaultValue.forEach(val => {
|
||||
array.push(val)
|
||||
})
|
||||
variableData.val = array;
|
||||
} else {
|
||||
variableData.val = item.__config__.defaultValue
|
||||
}
|
||||
variables.push(variableData)
|
||||
})
|
||||
this.variables = variables;
|
||||
}
|
||||
},
|
||||
|
||||
submitUserData() {
|
||||
let type = this.userData.type;
|
||||
if (type === 'copy' || type === 'next') {
|
||||
@@ -656,7 +664,8 @@ export default {
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -153,7 +153,6 @@ export default {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listProcess(this.queryParams).then(response => {
|
||||
console.log(3333,response)
|
||||
this.processList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false
|
||||
|
||||
@@ -49,6 +49,7 @@ export default {
|
||||
this.formOpen = true
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
/** 接收子组件传的值 */
|
||||
getData(data) {
|
||||
|
||||
@@ -144,6 +144,7 @@ export default {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listTodoProcess(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
console.log(response);
|
||||
if(this.queryParams.description != null){
|
||||
this.todoList = this.searchList(response.rows, this.queryParams.description);
|
||||
}else {
|
||||
@@ -170,7 +171,7 @@ export default {
|
||||
query: {
|
||||
taskId: row.taskId,
|
||||
processed: true,
|
||||
category:row.category,
|
||||
category:row.procDefName==="入职流程"?'onboarding':row.category,
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user