|
|
@@ -30,7 +30,7 @@
|
|
|
<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 nikeNamelist" :key="index" >
|
|
|
<i class="el-icon-arrow-right"></i>
|
|
|
@@ -39,12 +39,38 @@
|
|
|
{{ 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 v-if="form.auditStatus==5 || form.auditStatus==6" type="primary" @click="onReCommit()">提交</el-button>
|
|
|
<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==5 || form.auditStatus==6" type="warning" @click="onClose()">关闭</el-button>
|
|
|
<el-button v-if="form.auditStatus==0" type="danger" @click="onDelete()">删除</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
@@ -56,7 +82,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getDetail, create, save, deleteById } from "@/api/oa/universal"
|
|
|
+import { getDetail, create,reCommit, save, deleteById,closeById } from "@/api/oa/universal"
|
|
|
+import {getDate} from "@/utils/dateUtils";
|
|
|
import { getUserProfile } from "@/api/system/user";
|
|
|
import { listDept } from "@/api/system/dept";
|
|
|
import PeopleSelect from "@/components/PeopleSelect/index.vue";
|
|
|
@@ -79,6 +106,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ tasks:[],
|
|
|
loading:false,
|
|
|
files: [],
|
|
|
// 设置上传的请求头部
|
|
|
@@ -147,6 +175,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ getDateStar(ms) {
|
|
|
+ return getDate(ms);
|
|
|
+ },
|
|
|
getUser() {
|
|
|
getUserProfile().then(response => {
|
|
|
let userInfo = response.data;
|
|
|
@@ -197,7 +228,9 @@ export default {
|
|
|
},
|
|
|
/** 获得表单信息 */
|
|
|
getDetail(val) {
|
|
|
+ this.$parent.$parent.detailLoading = true;
|
|
|
getDetail(val).then(response => {
|
|
|
+ this.$parent.$parent.detailLoading = false;
|
|
|
this.form = response.data;
|
|
|
let files = response.data.fileList;
|
|
|
if (files) {
|
|
|
@@ -214,7 +247,20 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- this.form.peopleList = undefined;
|
|
|
+
|
|
|
+ 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.form.peopleList = peopleList.join(',');
|
|
|
+ this.nikeNamelist = nikeNamelist;
|
|
|
+ }
|
|
|
+ this.tasks = response.data.auditRecordList?response.data.auditRecordList:[];
|
|
|
+
|
|
|
});
|
|
|
},
|
|
|
/** 查询部门列表 */
|
|
|
@@ -240,11 +286,35 @@ export default {
|
|
|
this.$refs.form.validate(valid => {
|
|
|
if (valid) {
|
|
|
console.log(this.form);
|
|
|
- this.form.startUserSelectAssignees = this.form.peopleList;
|
|
|
+ this.form.startUserSelectAssignees = this.form.peopleList.split(',');
|
|
|
this.form.auditPass = true;
|
|
|
- this.$parent.$parent.editLoading = true;
|
|
|
+ this.$parent.$parent.detailLoading = true;
|
|
|
create(this.form).then(response => {
|
|
|
- this.$parent.$parent.editLoading = false;
|
|
|
+ this.$parent.$parent.detailLoading = false;
|
|
|
+ this.$modal.msgSuccess("提交成功");
|
|
|
+ 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.$parent.$parent.detailLoading = true;
|
|
|
+ reCommit(this.form).then(response => {
|
|
|
+ this.$parent.$parent.detailLoading = false;
|
|
|
this.$modal.msgSuccess("提交成功");
|
|
|
if(this.id){
|
|
|
this.$parent.$parent.closeEdit();
|
|
|
@@ -260,11 +330,13 @@ export default {
|
|
|
},
|
|
|
//暂存
|
|
|
onSave() {
|
|
|
- this.form.startUserSelectAssignees = this.form.peopleList
|
|
|
+ if(this.form.peopleList){
|
|
|
+ this.form.startUserSelectAssignees = this.form.peopleList.split(',');
|
|
|
+ }
|
|
|
this.form.auditPass = false;
|
|
|
- this.$parent.$parent.editLoading = true;
|
|
|
+ this.$parent.$parent.detailLoading = true;
|
|
|
save(this.form).then(response => {
|
|
|
- this.$parent.$parent.editLoading = false;
|
|
|
+ this.$parent.$parent.detailLoading = false;
|
|
|
this.$modal.msgSuccess("暂存成功");
|
|
|
if(this.id){
|
|
|
this.$parent.$parent.closeEdit();
|
|
|
@@ -281,11 +353,22 @@ export default {
|
|
|
this.$parent.$parent.closeEdit();
|
|
|
})
|
|
|
}).catch(() => { });
|
|
|
+ },
|
|
|
+ //暂存删除
|
|
|
+ async onClose() {
|
|
|
+ this.$modal.confirm('是否确认关闭?').then(() => {
|
|
|
+ closeById(this.id).then(response => {
|
|
|
+ this.$modal.msgSuccess("流程已关闭");
|
|
|
+ this.$parent.$parent.closeEdit();
|
|
|
+ })
|
|
|
+ }).catch(() => { });
|
|
|
},
|
|
|
// 关闭标签
|
|
|
handleClose(index) {
|
|
|
this.nikeNamelist.splice(index, 1);
|
|
|
- this.form.peopleList.splice(index, 1);
|
|
|
+ let peopleList = this.form.peopleList.split(',');
|
|
|
+ peopleList.splice(index, 1);
|
|
|
+ this.form.peopleList = peopleList.join(',');
|
|
|
},
|
|
|
//打开选人弹窗
|
|
|
openPS() {
|
|
|
@@ -295,9 +378,48 @@ export default {
|
|
|
submitPeople(userNamelist, nikeNamelist,userIdList) {
|
|
|
console.log(userNamelist);
|
|
|
this.nikeNamelist = nikeNamelist;
|
|
|
- this.form.peopleList = userIdList;
|
|
|
+ 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>
|
|
|
@@ -329,4 +451,12 @@ export default {
|
|
|
padding-top: 0;
|
|
|
padding-bottom: 0;
|
|
|
}
|
|
|
+
|
|
|
+ul {
|
|
|
+ padding-left: 0px !important;
|
|
|
+}
|
|
|
+
|
|
|
+.el-tag+.el-tag {
|
|
|
+ margin-left: 10px;
|
|
|
+}
|
|
|
</style>
|