|
|
@@ -2,11 +2,11 @@
|
|
|
<div class="container">
|
|
|
<el-form :model="form" label-position="top" :rules="rules" ref="form" label-width="80px">
|
|
|
<el-form-item label="入职人" prop="entryName">
|
|
|
- <el-input v-model="form.entryName" placeholder='请输入'></el-input>
|
|
|
+ <el-input v-model="form.entryName" placeholder='请输入入职人'></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="部门">
|
|
|
<treeselect :default-expand-level="1" v-model="form.deptId" :options="deptOptions" :normalizer="normalizer"
|
|
|
- placeholder="选择部门" />
|
|
|
+ placeholder="请选选择部门" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="职位">
|
|
|
<el-select v-model="form.position" filterable allow-create default-first-option placeholder="请选择"
|
|
|
@@ -47,8 +47,8 @@
|
|
|
<el-input maxlength="200" rows="4" show-word-limit type="textarea" v-model="form.workExperience"
|
|
|
placeholder='请输入'></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="入职日期" prop="startDate">
|
|
|
- <el-date-picker value-format="yyyy-MM-dd" v-model="form.startDate" type="date" placeholder="选择日期"
|
|
|
+ <el-form-item label="入职日期" prop="entryDate">
|
|
|
+ <el-date-picker value-format="yyyy-MM-dd" v-model="form.entryDate" type="date" placeholder="选择日期"
|
|
|
style="width: 100%;">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
@@ -62,22 +62,48 @@
|
|
|
<el-input maxlength="200" rows="4" show-word-limit type="textarea" v-model="form.remarks" placeholder="请输入备注" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="审批人" prop="peopleList">
|
|
|
- <el-input type="textarea" v-model="form.peopleList" style="display: none;" />
|
|
|
+ <el-input v-model="form.peopleList" style="display: none;" />
|
|
|
<el-button class="button-new-tag" @click="openPS">+ 添加</el-button>
|
|
|
- <span v-for="(tag,index) in peopleList" :key="index" >
|
|
|
+ <span v-for="(tag,index) in nikeNamelist" :key="index" >
|
|
|
<i class="el-icon-arrow-right"></i>
|
|
|
<el-tag type="info" closable :disable-transitions="false" @close="handleClose(index)">
|
|
|
<span class="user-avatar">{{ tag.substring(0, 1) || 'U' }}</span>
|
|
|
{{ tag }}
|
|
|
</el-tag>
|
|
|
</span>
|
|
|
-
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="流程动态" v-if="tasks.length > 0">
|
|
|
+ <el-timeline>
|
|
|
+ <el-timeline-item v-for="(item, index) in tasks" :key="index" :icon="getTimelineItemIcon(item)"
|
|
|
+ :type="getTimelineItemType(item)">
|
|
|
+ <p style="font-weight: 700">任务:{{ item.name }}</p>
|
|
|
+ <el-card :body-style="{ padding: '10px' }">
|
|
|
+ <label v-if="item.assigneeUser" style="font-weight: normal; margin-right: 30px;">
|
|
|
+ 审批人:{{ item.assigneeUser.nickname }}
|
|
|
+ <el-tag type="info" size="mini">{{ item.assigneeUser.deptName }}</el-tag>
|
|
|
+ </label>
|
|
|
+ <label style="font-weight: normal" v-if="item.createTime">创建时间:</label>
|
|
|
+ <label style="color:#8a909c; font-weight: normal">{{ parseTime(item.createTime) }}</label>
|
|
|
+ <label v-if="item.endTime" style="margin-left: 30px;font-weight: normal">审批时间:</label>
|
|
|
+ <label v-if="item.endTime" style="color:#8a909c;font-weight: normal"> {{
|
|
|
+ parseTime(item.endTime)
|
|
|
+ }}</label>
|
|
|
+ <!-- <label v-if="item.durationInMillis" style="margin-left: 30px;font-weight: normal">耗时:</label>
|
|
|
+ <label v-if="item.durationInMillis" style="color:#8a909c;font-weight: normal">
|
|
|
+ {{ getDateStar(item.durationInMillis) }} </label> -->
|
|
|
+ <p v-if="item.reason">
|
|
|
+ <el-tag :type="getTimelineItemType(item)">{{ item.reason }}</el-tag>
|
|
|
+ </p>
|
|
|
+ </el-card>
|
|
|
+ </el-timeline-item>
|
|
|
+ </el-timeline>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="onSubmit()">提交</el-button>
|
|
|
- <el-button v-if="!form.auditStatus || form.auditStatus==0" @click="onSave()">暂存</el-button>
|
|
|
- <el-button v-if="form.auditStatus==5" type="warning" @click="onDelete()">关闭</el-button>
|
|
|
- <el-button v-if="form.auditStatus==0" type="danger" @click="onDelete()">删除</el-button>
|
|
|
+ <el-button v-if="form.auditStatus==5 || form.auditStatus==6" type="primary" @click="onReCommit()" v-loading.fullscreen.lock="fullscreenLoading">提交</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmit()" v-loading.fullscreen.lock="fullscreenLoading">提交</el-button>
|
|
|
+ <el-button v-if="!form.auditStatus || form.auditStatus==0" @click="onSave()" v-loading.fullscreen.lock="fullscreenLoading">暂存</el-button>
|
|
|
+ <el-button v-if="form.auditStatus==5 || form.auditStatus==6" type="warning" @click="onClose()" v-loading.fullscreen.lock="fullscreenLoading">关闭</el-button>
|
|
|
+ <el-button v-if="form.auditStatus==0" type="danger" @click="onDelete()" v-loading.fullscreen.lock="fullscreenLoading">删除</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<PeopleSelect ref="peopleSelect" :type="type" :isCheck="true" :open="peopleOpen" @cancel="peopleOpen = false"
|
|
|
@@ -88,10 +114,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getDetail, create, deteleById } from "@/api/oa/entry"
|
|
|
+import { getDetail, create,reCommit, save, deleteById,closeById } from "@/api/oa/entry"
|
|
|
+import {getDate} from "@/utils/dateUtils";
|
|
|
+import { getUserProfile } from "@/api/system/user";
|
|
|
import { listDept } from "@/api/system/dept";
|
|
|
import PeopleSelect from "@/components/PeopleSelect/index.vue";
|
|
|
-import FileUpload from "@/components/FileUpload";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
import { getBaseHeader } from "@/utils/request";
|
|
|
@@ -99,7 +126,6 @@ export default {
|
|
|
name: 'Index',
|
|
|
components: {
|
|
|
PeopleSelect,
|
|
|
- FileUpload,
|
|
|
Treeselect,
|
|
|
},
|
|
|
props: {
|
|
|
@@ -111,18 +137,19 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
|
|
|
+ fullscreenLoading:false,
|
|
|
+ tasks:[],
|
|
|
+ loading:false,
|
|
|
files: [],
|
|
|
// 设置上传的请求头部
|
|
|
headers: getBaseHeader(),
|
|
|
// 上传的地址
|
|
|
fileUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/uploaData',
|
|
|
// fileUrl: 'http://192.168.100.249:48080/admin-api/infra/file/uploaData',
|
|
|
- entryId: undefined, // 编号
|
|
|
// 部门树选项
|
|
|
posOptions: [],
|
|
|
deptOptions: [],
|
|
|
- peopleList: [],
|
|
|
- userIdList:[],
|
|
|
+ nikeNamelist: [],
|
|
|
form: {
|
|
|
entryName: undefined,
|
|
|
deptId: undefined,
|
|
|
@@ -174,7 +201,7 @@ export default {
|
|
|
trigger: ["blur", "change"]
|
|
|
}
|
|
|
],
|
|
|
- startDate: [
|
|
|
+ entryDate: [
|
|
|
{ required: true, message: '请选择日期', trigger: 'change' }
|
|
|
],
|
|
|
peopleList: [
|
|
|
@@ -186,7 +213,6 @@ export default {
|
|
|
type: 'multiple',
|
|
|
//是否打开选人组件,默认不打开
|
|
|
peopleOpen: false,
|
|
|
- fileAccept: ".crt",
|
|
|
queryParams: {
|
|
|
name: undefined,
|
|
|
status: undefined
|
|
|
@@ -195,15 +221,33 @@ export default {
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
- this.entryId = this.id || this.$route.query.id;
|
|
|
- console.log(this.entryId);
|
|
|
- if (this.entryId) {
|
|
|
- this.getDetail();
|
|
|
- }
|
|
|
-
|
|
|
this.getDeptList();
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ id: {
|
|
|
+ immediate: true,
|
|
|
+ handler(val) {
|
|
|
+ if(val){
|
|
|
+ this.getDetail(val);
|
|
|
+ }else{
|
|
|
+ // this.getUser();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ getDateStar(ms) {
|
|
|
+ return getDate(ms);
|
|
|
+ },
|
|
|
+ getUser() {
|
|
|
+ getUserProfile().then(response => {
|
|
|
+ let userInfo = response.data;
|
|
|
+ this.form.employeeName = userInfo.nickname;
|
|
|
+ this.form.deptName = userInfo.dept.name;
|
|
|
+ this.form.position = userInfo.posts[0].name;
|
|
|
+ this.form.employeePhone = userInfo.mobile;
|
|
|
+ });
|
|
|
+ },
|
|
|
handleRemove(file, fileList) {
|
|
|
console.log(file, fileList);
|
|
|
let fileIds = [];
|
|
|
@@ -211,7 +255,6 @@ export default {
|
|
|
let id = fileList[i].response.data.id;
|
|
|
fileIds.push(id);
|
|
|
}
|
|
|
- // this.dataFormCite.fileIdList = fileIds.join(",");
|
|
|
this.form.fileIdList = fileIds;
|
|
|
},
|
|
|
beforeUploadFile(file) {
|
|
|
@@ -240,19 +283,20 @@ export default {
|
|
|
fileIds.push(id);
|
|
|
}
|
|
|
}
|
|
|
- // this.dataFormCite.fileIdList = fileIds.join(",");
|
|
|
this.form.fileIdList = fileIds;
|
|
|
},
|
|
|
/** 获得表单信息 */
|
|
|
- getDetail() {
|
|
|
- getDetail(this.entryId).then(response => {
|
|
|
+ getDetail(val) {
|
|
|
+ this.$parent.$parent.detailLoading = true;
|
|
|
+ getDetail(val).then(response => {
|
|
|
+ this.$parent.$parent.detailLoading = false;
|
|
|
this.form = response.data;
|
|
|
- let files = response.data.files;
|
|
|
+ let files = response.data.fileList;
|
|
|
if (files) {
|
|
|
this.files = [];
|
|
|
for (let i in files) {
|
|
|
let url = files[i].url;
|
|
|
- let name = files[i].oldName;
|
|
|
+ let name = files[i].name;
|
|
|
let id = files[i].id;
|
|
|
|
|
|
this.files.push({
|
|
|
@@ -262,6 +306,24 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if(response.data.auditUserList){
|
|
|
+ let auditUserList = response.data.auditUserList;
|
|
|
+ let peopleList = [];
|
|
|
+ let nikeNamelist = [];
|
|
|
+ auditUserList.map(item => {
|
|
|
+ peopleList.push(item.id);
|
|
|
+ nikeNamelist.push(item.nickname)
|
|
|
+ });
|
|
|
+ this.$set(this.form, 'peopleList', peopleList.join(','));
|
|
|
+ this.nikeNamelist = nikeNamelist;
|
|
|
+ }else{
|
|
|
+ this.$set(this.form, 'peopleList', '');
|
|
|
+ this.nikeNamelist = [];
|
|
|
+ }
|
|
|
+
|
|
|
+ this.tasks = response.data.auditRecordList?response.data.auditRecordList:[];
|
|
|
+
|
|
|
});
|
|
|
},
|
|
|
/** 查询部门列表 */
|
|
|
@@ -283,15 +345,45 @@ export default {
|
|
|
},
|
|
|
//提交
|
|
|
onSubmit() {
|
|
|
+ console.log(this.form);
|
|
|
this.$refs.form.validate(valid => {
|
|
|
if (valid) {
|
|
|
console.log(this.form);
|
|
|
- this.form.startUserSelectAssignees = this.userIdList,
|
|
|
+ this.form.startUserSelectAssignees = this.form.peopleList.split(',');
|
|
|
this.form.auditPass = true;
|
|
|
+ this.fullscreenLoading = true;
|
|
|
create(this.form).then(response => {
|
|
|
- // this.$message.success('提交成功')
|
|
|
+ this.fullscreenLoading = false;
|
|
|
this.$modal.msgSuccess("提交成功");
|
|
|
- this.$router.push({ path: '/' })
|
|
|
+ if(this.id){
|
|
|
+ this.$parent.$parent.closeEdit();
|
|
|
+ }else{
|
|
|
+ this.$parent.$parent.setStatus(2);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //驳回或撤回后再次提交通用用事项审批流程信息
|
|
|
+ onReCommit() {
|
|
|
+ console.log(this.form);
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ console.log(this.form);
|
|
|
+ this.form.startUserSelectAssignees = this.form.peopleList.split(',');
|
|
|
+ this.form.auditPass = true;
|
|
|
+ this.fullscreenLoading = true;
|
|
|
+ reCommit(this.form).then(response => {
|
|
|
+ this.fullscreenLoading = false;
|
|
|
+ this.$modal.msgSuccess("提交成功");
|
|
|
+ if(this.id){
|
|
|
+ this.$parent.$parent.closeEdit();
|
|
|
+ }else{
|
|
|
+ this.$parent.$parent.setStatus(2);
|
|
|
+ }
|
|
|
});
|
|
|
} else {
|
|
|
console.log('error submit!!');
|
|
|
@@ -301,28 +393,49 @@ export default {
|
|
|
},
|
|
|
//暂存
|
|
|
onSave() {
|
|
|
- this.form.startUserSelectAssignees = {
|
|
|
- taskKey1: this.userIdList,
|
|
|
+ if(this.form.peopleList){
|
|
|
+ this.form.startUserSelectAssignees = this.form.peopleList.split(',');
|
|
|
}
|
|
|
this.form.auditPass = false;
|
|
|
- create(this.form).then(response => {
|
|
|
- // this.$message.success('提交成功')
|
|
|
+ this.fullscreenLoading = true;
|
|
|
+ save(this.form).then(response => {
|
|
|
+ this.fullscreenLoading = false;
|
|
|
this.$modal.msgSuccess("暂存成功");
|
|
|
- this.$router.push({ path: '/' })
|
|
|
+ if(this.id){
|
|
|
+ this.$parent.$parent.closeEdit();
|
|
|
+ }else{
|
|
|
+ this.$parent.$parent.setStatus(2);
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
//暂存删除
|
|
|
- onDelete(){
|
|
|
- this.$modal.confirm('是否确认删除?').then(function() {
|
|
|
- return deteleById(this.id);
|
|
|
- }).then(() => {
|
|
|
+ async onDelete() {
|
|
|
+ this.$modal.confirm('是否确认删除?').then(() => {
|
|
|
+ this.fullscreenLoading = true;
|
|
|
+ deleteById(this.id).then(response => {
|
|
|
+ this.fullscreenLoading = false;
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ this.$parent.$parent.closeEdit();
|
|
|
+ })
|
|
|
+ }).catch(() => { });
|
|
|
+ },
|
|
|
+ //暂存删除
|
|
|
+ async onClose() {
|
|
|
+ this.$modal.confirm('是否确认关闭?').then(() => {
|
|
|
+ this.fullscreenLoading = true;
|
|
|
+ closeById(this.id).then(response => {
|
|
|
+ this.fullscreenLoading = false;
|
|
|
+ this.$modal.msgSuccess("流程已关闭");
|
|
|
+ this.$parent.$parent.closeEdit();
|
|
|
+ })
|
|
|
+ }).catch(() => { });
|
|
|
},
|
|
|
// 关闭标签
|
|
|
handleClose(index) {
|
|
|
- this.peopleList.splice(index, 1);
|
|
|
- this.userIdList.splice(index, 1);
|
|
|
+ this.nikeNamelist.splice(index, 1);
|
|
|
+ let peopleList = this.form.peopleList.split(',');
|
|
|
+ peopleList.splice(index, 1);
|
|
|
+ this.form.peopleList = peopleList.join(',');
|
|
|
},
|
|
|
//打开选人弹窗
|
|
|
openPS() {
|
|
|
@@ -330,12 +443,50 @@ export default {
|
|
|
},
|
|
|
//选择人的确定按钮事件 submitPeople(nikeNamelist)方法传参一个默认接收用户昵称数组 submitPeople(peopleList,nikeNamelist)方法传参两个则是接收用户昵称数组和用户账号数组
|
|
|
submitPeople(userNamelist, nikeNamelist,userIdList) {
|
|
|
- console.log(userIdList);
|
|
|
- this.peopleList = nikeNamelist;
|
|
|
- this.form.peopleList = userNamelist.join(",");
|
|
|
- this.userIdList = userIdList;
|
|
|
+ console.log(userNamelist);
|
|
|
+ this.nikeNamelist = nikeNamelist;
|
|
|
+ this.form.peopleList = userIdList.join(',');
|
|
|
this.peopleOpen = false;
|
|
|
},
|
|
|
+ getTimelineItemIcon(item) {
|
|
|
+ if (item.result === 1) {
|
|
|
+ return 'el-icon-time';
|
|
|
+ }
|
|
|
+ if (item.result === 2) {
|
|
|
+ return 'el-icon-check';
|
|
|
+ }
|
|
|
+ if (item.result === 3) {
|
|
|
+ return 'el-icon-close';
|
|
|
+ }
|
|
|
+ if (item.result === 4) {
|
|
|
+ return 'el-icon-remove-outline';
|
|
|
+ }
|
|
|
+ if (item.result === 5) {
|
|
|
+ return 'el-icon-back'
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ },
|
|
|
+ getTimelineItemType(item) {
|
|
|
+ if (item.result === 1) {
|
|
|
+ return 'primary';
|
|
|
+ }
|
|
|
+ if (item.result === 2) {
|
|
|
+ return 'success';
|
|
|
+ }
|
|
|
+ if (item.result === 3) {
|
|
|
+ return 'danger';
|
|
|
+ }
|
|
|
+ if (item.result === 4) {
|
|
|
+ return 'info';
|
|
|
+ }
|
|
|
+ if (item.result === 5) {
|
|
|
+ return 'warning';
|
|
|
+ }
|
|
|
+ if (item.result === 6) {
|
|
|
+ return 'default'
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
@@ -367,4 +518,12 @@ export default {
|
|
|
padding-top: 0;
|
|
|
padding-bottom: 0;
|
|
|
}
|
|
|
+
|
|
|
+ul {
|
|
|
+ padding-left: 0px !important;
|
|
|
+}
|
|
|
+
|
|
|
+.el-tag+.el-tag {
|
|
|
+ margin-left: 10px;
|
|
|
+}
|
|
|
</style>
|