|
|
@@ -22,18 +22,18 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="附件">
|
|
|
<el-upload :action="fileUrl" :headers="headers" :file-list="files" :on-success="handleFileSuccessCite"
|
|
|
- :before-upload="beforeUploadFile" :on-remove="handleRemove">
|
|
|
+ :before-upload="beforeUploadFile" :on-remove="handleRemove" :on-preview="handlePreview">
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备注">
|
|
|
<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 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" >
|
|
|
+ <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>
|
|
|
@@ -56,7 +56,7 @@
|
|
|
<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>
|
|
|
<!-- <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> -->
|
|
|
@@ -68,16 +68,17 @@
|
|
|
</el-timeline>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <div v-if="name=='todo'">
|
|
|
+ <div v-if="name == 'todo'">
|
|
|
<el-button type="primary" @click="onReCommit()" v-loading.fullscreen.lock="fullscreenLoading">提交</el-button>
|
|
|
<el-button type="warning" @click="onClose()" v-loading.fullscreen.lock="fullscreenLoading">关闭</el-button>
|
|
|
</div>
|
|
|
- <div v-else>
|
|
|
- <el-button type="primary" @click="onSubmit()" v-loading.fullscreen.lock="fullscreenLoading">提交</el-button>
|
|
|
- <el-button @click="onSave()" 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>
|
|
|
- </div>
|
|
|
-
|
|
|
+ <div v-else>
|
|
|
+ <el-button type="primary" @click="onSubmit()" v-loading.fullscreen.lock="fullscreenLoading">提交</el-button>
|
|
|
+ <el-button @click="onSave()" 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>
|
|
|
+ </div>
|
|
|
+
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<PeopleSelect ref="peopleSelect" :type="type" :isCheck="true" :open="peopleOpen" @cancel="peopleOpen = false"
|
|
|
@@ -88,8 +89,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getDetail, create,reCommit, save, deleteById,closeById } from "@/api/oa/universal"
|
|
|
-import {getDate} from "@/utils/dateUtils";
|
|
|
+import { getDetail, create, reCommit, save, deleteById, closeById } from "@/api/oa/universal"
|
|
|
+import { getDate } from "@/utils/dateUtils";
|
|
|
import { listDept } from "@/api/system/dept";
|
|
|
import PeopleSelect from "@/components/PeopleSelect/index.vue";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
@@ -113,9 +114,9 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- fullscreenLoading:false,
|
|
|
- tasks:[],
|
|
|
- loading:false,
|
|
|
+ fullscreenLoading: false,
|
|
|
+ tasks: [],
|
|
|
+ loading: false,
|
|
|
files: [],
|
|
|
// 设置上传的请求头部
|
|
|
headers: getBaseHeader(),
|
|
|
@@ -166,9 +167,9 @@ export default {
|
|
|
id: {
|
|
|
immediate: true,
|
|
|
handler(val) {
|
|
|
- if(val){
|
|
|
+ if (val) {
|
|
|
this.getDetail(val);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.getUser();
|
|
|
}
|
|
|
}
|
|
|
@@ -179,11 +180,11 @@ export default {
|
|
|
return getDate(ms);
|
|
|
},
|
|
|
getUser() {
|
|
|
- let userInfo = JSON.parse(this.$store.getters.userInfo);
|
|
|
- this.form.employeeName = userInfo.nickname;
|
|
|
- this.form.deptName = userInfo.deptName;
|
|
|
- this.form.position = userInfo.position;
|
|
|
- this.form.employeePhone = userInfo.mobile;
|
|
|
+ let userInfo = JSON.parse(this.$store.getters.userInfo);
|
|
|
+ this.form.employeeName = userInfo.nickname;
|
|
|
+ this.form.deptName = userInfo.deptName;
|
|
|
+ this.form.position = userInfo.position;
|
|
|
+ this.form.employeePhone = userInfo.mobile;
|
|
|
},
|
|
|
handleRemove(file, fileList) {
|
|
|
console.log(file, fileList);
|
|
|
@@ -194,6 +195,22 @@ export default {
|
|
|
}
|
|
|
this.form.fileIdList = fileIds;
|
|
|
},
|
|
|
+ handlePreview(file) {
|
|
|
+ console.log("file", file);
|
|
|
+ var link = document.createElement("a"); //定义一个a标签
|
|
|
+ link.download = file.name; //下载后的文件名称
|
|
|
+ link.href = file.url; //需要生成一个 URL 来实现下载
|
|
|
+ link.click(); //模拟在按钮上实现一次鼠标点击
|
|
|
+ window.URL.revokeObjectURL(link.href);
|
|
|
+ },
|
|
|
+ handlePreview(file) {
|
|
|
+ console.log("file", file);
|
|
|
+ var link = document.createElement("a"); //定义一个a标签
|
|
|
+ link.download = file.name; //下载后的文件名称
|
|
|
+ link.href = file.url; //需要生成一个 URL 来实现下载
|
|
|
+ link.click(); //模拟在按钮上实现一次鼠标点击
|
|
|
+ window.URL.revokeObjectURL(link.href);
|
|
|
+ },
|
|
|
beforeUploadFile(file) {
|
|
|
console.log(file);
|
|
|
const size = file.size / 1024 / 1024;
|
|
|
@@ -243,8 +260,8 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if(response.data.auditUserList){
|
|
|
+
|
|
|
+ if (response.data.auditUserList) {
|
|
|
let auditUserList = response.data.auditUserList;
|
|
|
let peopleList = [];
|
|
|
let nikeNamelist = [];
|
|
|
@@ -254,12 +271,12 @@ export default {
|
|
|
});
|
|
|
this.$set(this.form, 'peopleList', peopleList.join(','));
|
|
|
this.nikeNamelist = nikeNamelist;
|
|
|
- } else{
|
|
|
+ } else {
|
|
|
this.$set(this.form, 'peopleList', '');
|
|
|
this.nikeNamelist = [];
|
|
|
}
|
|
|
- this.tasks = response.data.auditRecordList?response.data.auditRecordList:[];
|
|
|
-
|
|
|
+ this.tasks = response.data.auditRecordList ? response.data.auditRecordList : [];
|
|
|
+
|
|
|
});
|
|
|
},
|
|
|
/** 查询部门列表 */
|
|
|
@@ -291,9 +308,9 @@ export default {
|
|
|
create(this.form).then(response => {
|
|
|
this.fullscreenLoading = false;
|
|
|
this.$modal.msgSuccess("提交成功");
|
|
|
- if(this.id){
|
|
|
+ if (this.id) {
|
|
|
this.$parent.$parent.closeEdit();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.$parent.$parent.setStatus(2);
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
@@ -305,8 +322,8 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- //驳回或撤回后再次提交通用用事项审批流程信息
|
|
|
- onReCommit() {
|
|
|
+ //驳回或撤回后再次提交通用用事项审批流程信息
|
|
|
+ onReCommit() {
|
|
|
console.log(this.form);
|
|
|
this.$refs.form.validate(valid => {
|
|
|
if (valid) {
|
|
|
@@ -317,9 +334,9 @@ export default {
|
|
|
reCommit(this.form).then(response => {
|
|
|
this.fullscreenLoading = false;
|
|
|
this.$modal.msgSuccess("提交成功");
|
|
|
- if(this.id){
|
|
|
+ if (this.id) {
|
|
|
this.$parent.$parent.closeEdit();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.$parent.$parent.setStatus(2);
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
@@ -333,22 +350,22 @@ export default {
|
|
|
},
|
|
|
//暂存
|
|
|
onSave() {
|
|
|
- if(this.form.peopleList){
|
|
|
- this.form.startUserSelectAssignees = this.form.peopleList.split(',');
|
|
|
- }
|
|
|
- this.form.auditPass = false;
|
|
|
- this.fullscreenLoading = true;
|
|
|
- save(this.form).then(response => {
|
|
|
- this.fullscreenLoading = false;
|
|
|
- this.$modal.msgSuccess("暂存成功");
|
|
|
- if(this.id){
|
|
|
- this.$parent.$parent.closeEdit();
|
|
|
- }else{
|
|
|
- this.$parent.$parent.setStatus(2);
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- this.fullscreenLoading = false;
|
|
|
- });
|
|
|
+ if (this.form.peopleList) {
|
|
|
+ this.form.startUserSelectAssignees = this.form.peopleList.split(',');
|
|
|
+ }
|
|
|
+ this.form.auditPass = false;
|
|
|
+ this.fullscreenLoading = true;
|
|
|
+ save(this.form).then(response => {
|
|
|
+ this.fullscreenLoading = false;
|
|
|
+ this.$modal.msgSuccess("暂存成功");
|
|
|
+ if (this.id) {
|
|
|
+ this.$parent.$parent.closeEdit();
|
|
|
+ } else {
|
|
|
+ this.$parent.$parent.setStatus(2);
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ this.fullscreenLoading = false;
|
|
|
+ });
|
|
|
},
|
|
|
//暂存删除
|
|
|
async onDelete() {
|
|
|
@@ -361,8 +378,8 @@ export default {
|
|
|
})
|
|
|
}).catch(() => { });
|
|
|
},
|
|
|
- //暂存删除
|
|
|
- async onClose() {
|
|
|
+ //暂存删除
|
|
|
+ async onClose() {
|
|
|
this.$modal.confirm('是否确认关闭?').then(() => {
|
|
|
this.fullscreenLoading = true;
|
|
|
closeById(this.id).then(response => {
|
|
|
@@ -384,7 +401,7 @@ export default {
|
|
|
this.peopleOpen = true;
|
|
|
},
|
|
|
//选择人的确定按钮事件 submitPeople(nikeNamelist)方法传参一个默认接收用户昵称数组 submitPeople(peopleList,nikeNamelist)方法传参两个则是接收用户昵称数组和用户账号数组
|
|
|
- submitPeople(userNamelist, nikeNamelist,userIdList) {
|
|
|
+ submitPeople(userNamelist, nikeNamelist, userIdList) {
|
|
|
console.log(userNamelist);
|
|
|
this.nikeNamelist = nikeNamelist;
|
|
|
this.form.peopleList = userIdList.join(',');
|