|
|
@@ -8,12 +8,10 @@
|
|
|
<el-card class="box-card">
|
|
|
<div slot="header">
|
|
|
<span>
|
|
|
- <i class="icon icon-file-text"> 新增文档信息</i>
|
|
|
+ <i class="icon icon-file-text"> 文档编辑信息</i>
|
|
|
</span>
|
|
|
<span style="float: right;">
|
|
|
- <el-button type="primary" class="el-button--small" @click="saveclick()" style="margin-left:5px" :disabled="uploadform.AuditorStatus == 1||!permissions[permissionscode.cellsdocumentedit]">保存</el-button>
|
|
|
- <el-button :disabled="uploadform.AuditorStatus == 1||!permissions[permissionscode.cellsdocumentapprove]" type="primary" class="el-button--small"
|
|
|
- @click="auditorDocumentinfo">审核</el-button>
|
|
|
+ <el-button type="primary" class="el-button--small" @click="save()" style="margin-left:5px" >保存</el-button>
|
|
|
<router-link :to="'/documentmanage'">
|
|
|
<el-button type="primary" class="el-button--small" style="margin-left:5px">返回</el-button>
|
|
|
</router-link>
|
|
|
@@ -22,52 +20,47 @@
|
|
|
<el-form :model="uploadform" :rules="rules" ref="uploadform" label-width="110px">
|
|
|
<div class="el-row">
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="文档结构" prop="JLDirectoryId">
|
|
|
+ <el-form-item label="文档结构" prop="JLDirectoryIds">
|
|
|
<el-cascader :options="orgtreelist" style="width:100%" :props="orgtreeprops" change-on-select :show-all-levels="false" v-model="JLDirectoryIds"
|
|
|
- :disabled="uploadform.AuditorStatus == 1||!permissions[permissionscode.cellsdocumentedit]" placeholder="请选择文档结构"></el-cascader>
|
|
|
+ placeholder="请选择文档结构"></el-cascader>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="文档名称" prop="Name">
|
|
|
- <el-input v-model="uploadform.Name" placeholder="请输入文档名称" :disabled="uploadform.AuditorStatus == 1||!permissions[permissionscode.cellsdocumentedit]"></el-input>
|
|
|
+ <el-input v-model="uploadform.Name" placeholder="请输入文档名称" ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="版本信息" prop="VersionInfo">
|
|
|
- <el-input v-model="uploadform.VersionInfo" placeholder="请输入版本信息" :disabled="uploadform.AuditorStatus == 1||!permissions[permissionscode.cellsdocumentedit]"></el-input>
|
|
|
+ <el-input v-model="uploadform.VersionInfo" placeholder="请输入版本信息" ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="编辑人" prop="AuthorUser">
|
|
|
- <el-select v-if="uploadform.AuditorStatus == 0" ref="consigneeselect" v-model="AuthorUser" placeholder="请选择编辑人" style="width: 100%;"
|
|
|
- @change="selectAuthorUser" :disabled="!permissions[permissionscode.cellsdocumentedit]">
|
|
|
- <el-option v-for="item in acceptUsers" :key="item.id" :label="item.name" :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- <el-input v-if="uploadform.AuditorStatus == 1" v-model="uploadform.AuditorBy" disabled></el-input>
|
|
|
+ <el-form-item label="编辑人" prop="AuthorBy">
|
|
|
+ <el-input v-model="uploadform.AuthorBy" placeholder="请输入编辑人"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="备注">
|
|
|
- <el-input type="textarea" :rows="2" v-model="uploadform.Remark" placeholder="请输入备注信息" :disabled="uploadform.AuditorStatus == 1||!permissions[permissionscode.cellsdocumentedit]"></el-input>
|
|
|
+ <el-input type="textarea" :rows="2" v-model="uploadform.Remark" placeholder="请输入备注信息" ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="文档上传" prop="Diseaseinfo">
|
|
|
<el-upload style="margin-top: 10px;" multiple="true" action="" :limit="1" ref="refuploadattach" :http-request="uploadrequest"
|
|
|
- class="attach-uploader" :show-file-list="true" :before-upload="beforeAvatarUpload" :disabled="uploadform.AuditorStatus == 1||!permissions[permissionscode.cellsdocumentedit]">
|
|
|
+ class="attach-uploader" :show-file-list="true" :before-upload="beforeAvatarUpload" >
|
|
|
<i class="el-icon-plus attach-uploader-icon"></i>
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item class="maintainlog" label="" label-width="120px">
|
|
|
+ <el-form-item class="maintainlog" label="已有文档" label-width="120px">
|
|
|
<div style="overflow: auto;">
|
|
|
<template>
|
|
|
<el-row>
|
|
|
<el-col :span="24" v-for="(v,K) in maintainlogattrlist" :key="v">
|
|
|
<span>
|
|
|
- <el-button size="small" type="text" icon="el-icon-delete" title="删除" @click="deletedatafile(K)" :disabled="uploadform.AuditorStatus == 1||!permissions[permissionscode.cellsdocumentedit]"></el-button>
|
|
|
+ <el-button size="small" type="text" icon="el-icon-delete" title="删除" @click="deletedatafile(K)" ></el-button>
|
|
|
</span>
|
|
|
<a style="margin-left:10px" @click="clickachment(v.url)">{{ v.name }}</a>
|
|
|
</el-col>
|
|
|
@@ -121,19 +114,12 @@
|
|
|
},
|
|
|
data() {
|
|
|
var CheckDirectoryId = (rule, value, callback) => {
|
|
|
- if (this.JLDirectoryId && this.JLDirectoryId.length < 1) {
|
|
|
+ if (this.JLDirectoryIds && this.JLDirectoryIds.length < 1) {
|
|
|
callback(new Error('请选择文档结构'))
|
|
|
} else {
|
|
|
callback()
|
|
|
}
|
|
|
}
|
|
|
- var checkAuthorUser = (rule, value, callback) => {
|
|
|
- if (!this.AuthorUser || this.AuthorUser == '' || this.AuthorUser == 0) {
|
|
|
- callback(new Error('请输入接收人'))
|
|
|
- } else {
|
|
|
- callback()
|
|
|
- }
|
|
|
- }
|
|
|
return {
|
|
|
documentId: 0,
|
|
|
waituploads: [], // 等待上传的附件列表
|
|
|
@@ -148,33 +134,23 @@
|
|
|
JLDirectoryIds: [], //文档结构
|
|
|
list: [],
|
|
|
uploadform: {
|
|
|
+ DirectoryId: '', //目录结构Id
|
|
|
Name: '', //文档名称
|
|
|
VersionInfo: '', //文档版本
|
|
|
- DirectoryId: 0, //目录结构Id
|
|
|
- Remark: '', //备注
|
|
|
FileURL: '', //文档地址
|
|
|
- AuditorBy: '', //审核人
|
|
|
- AuthorUserId: 1, //审核人Id
|
|
|
- AuditorStatus: 0, //0未审核;1已审核
|
|
|
- AuditorOn: new Date() //审核时间
|
|
|
+ AuthorOn: new Date(),//编辑时间
|
|
|
+ AuthorBy: '',//编辑人
|
|
|
+ Remark: '', //备注
|
|
|
},
|
|
|
- AuthorUser: '', //编辑人
|
|
|
+ AuthorUser: '',
|
|
|
AuthorUserName: '',
|
|
|
loginDialogVisible: false, //登陆验证弹窗
|
|
|
isLoginSucceed: false,
|
|
|
- permissionscode: {
|
|
|
- cellsdocumentedit: 'cellbank.cell.cellsdocument.edit', //编辑
|
|
|
- cellsdocumentapprove: 'cellbank.cell.cellsdocument.approve' //审核
|
|
|
- },
|
|
|
- permissions: {
|
|
|
- 'cellbank.cell.cellsdocument.edit': false,
|
|
|
- 'cellbank.cell.cellsdocument.approve': false
|
|
|
- },
|
|
|
acceptUsers: [],
|
|
|
username: '',
|
|
|
password: '',
|
|
|
rules: {
|
|
|
- JLDirectoryId: [{
|
|
|
+ JLDirectoryIds: [{
|
|
|
required: true,
|
|
|
validator: CheckDirectoryId,
|
|
|
trigger: 'blur'
|
|
|
@@ -189,24 +165,17 @@
|
|
|
message: '请填写版本信息',
|
|
|
trigger: 'blur'
|
|
|
}],
|
|
|
- // AuthorUserId: [{
|
|
|
- // required: true,
|
|
|
- // message: '请选择编辑人',
|
|
|
- // trigger: 'blur'
|
|
|
- // }],
|
|
|
- AuthorUser: [{
|
|
|
- validator: checkAuthorUser,
|
|
|
+ AuthorBy: [{
|
|
|
required: true,
|
|
|
- trigger: 'blur',
|
|
|
+ message: '请输入编辑人',
|
|
|
+ trigger: 'blur'
|
|
|
}],
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.documentId = this.$route.params.opera
|
|
|
- //this.initinfo()
|
|
|
- this.getUsersByPerCode()
|
|
|
- this.getPermissions()
|
|
|
+ this.initinfo()
|
|
|
},
|
|
|
methods: {
|
|
|
initinfo() {
|
|
|
@@ -214,14 +183,7 @@
|
|
|
this.$axios.get('/document/geteditinitinfo/' + this.documentId, {})
|
|
|
.then(res => {
|
|
|
_this.uploadform = res.data.items
|
|
|
- if (_this.uploadform.AuthorUserId && _this.uploadform.AuthorUserId != 0) {
|
|
|
- for (var i = 0; i < _this.acceptUsers.length; i++) {
|
|
|
- if (_this.acceptUsers[i].id === _this.uploadform.AuthorUserId) {
|
|
|
- _this.AuthorUser = _this.uploadform.AuthorUserId
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- _this.gettreelist(217)
|
|
|
+ _this.gettreelist(218)
|
|
|
_this.getwendanginfo(res.data.items.FileURL)
|
|
|
|
|
|
})
|
|
|
@@ -237,7 +199,7 @@
|
|
|
}
|
|
|
_this.maintainlogattrlist.push(params)
|
|
|
},
|
|
|
- //获取文档树
|
|
|
+ //获取文档结构树
|
|
|
gettreelist(pid) {
|
|
|
let _this = this
|
|
|
let params = {
|
|
|
@@ -285,10 +247,10 @@
|
|
|
})
|
|
|
},
|
|
|
//保存编辑信息
|
|
|
- saveclick() {
|
|
|
+ save() {
|
|
|
+ let _this = this
|
|
|
this.$refs["uploadform"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- let _this = this
|
|
|
if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
|
|
|
// 上传附件是否完成判断
|
|
|
if (!this.attachissuccess()) {
|
|
|
@@ -304,6 +266,7 @@
|
|
|
}).then(() => {
|
|
|
_this.getattachissuccess()
|
|
|
_this.editdocumentinfo() //保存编辑信息
|
|
|
+ _this.getwendanginfo(_this.uploadform.FileURL) //更新已有文档列表
|
|
|
// 清空上传数据
|
|
|
if (_this.$refs.refuploadattach) {
|
|
|
_this.$refs.refuploadattach.clearFiles()
|
|
|
@@ -339,8 +302,6 @@
|
|
|
editdocumentinfo() {
|
|
|
let _this = this
|
|
|
_this.uploadform.DirectoryId = parseInt(_this.JLDirectoryIds[_this.JLDirectoryIds.length - 1])
|
|
|
- _this.uploadform.AuthorUserId = parseInt(_this.AuthorUser)
|
|
|
- _this.uploadform.AuthorBy = _this.$refs.consigneeselect.selectedLabel
|
|
|
this.$axios.put('/document/editdocumentinfo/' + _this.documentId, _this.uploadform)
|
|
|
.then(function (response) {
|
|
|
if (response.data.code === 0) {
|
|
|
@@ -348,7 +309,6 @@
|
|
|
type: 'success',
|
|
|
message: response.data.message
|
|
|
})
|
|
|
- _this.initinfo()
|
|
|
} else {
|
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
|
@@ -360,33 +320,6 @@
|
|
|
console.log(error)
|
|
|
})
|
|
|
},
|
|
|
- //文档审核
|
|
|
- auditorDocumentinfo() {
|
|
|
- let _this = this
|
|
|
- _this.$confirm('确定审核该文档?审核后所有信息将不可修改!', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- _this.uploadform.AuditorStatus = 1
|
|
|
- _this.uploadform.AuditorOn = new Date()
|
|
|
- this.$axios.put('/document/auditorDocumentinfo/' + _this.documentId, _this.uploadform)
|
|
|
- .then(function (response) {
|
|
|
- if (response.data.code === 0) {
|
|
|
- _this.$message({
|
|
|
- type: 'success',
|
|
|
- message: response.data.message
|
|
|
- })
|
|
|
- window.history.go(-1)
|
|
|
- } else {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: response.data.message
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch(() => {})
|
|
|
- },
|
|
|
beforeAvatarUpload(file) {
|
|
|
let isLt50m = file.size / 1024 / 1024 / 50 < 1
|
|
|
if (!isLt50m) {
|
|
|
@@ -452,33 +385,6 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- //获取人员列表
|
|
|
- getUsersByPerCode() {
|
|
|
- let _this = this
|
|
|
- // request
|
|
|
- this.$axios.get("/role/getUsersWithRolePermission?perCode=cellbank.cell.cellsdocument.editer", {})
|
|
|
- .then(res => {
|
|
|
- if (res.data instanceof Array && res.data.length > 0) {
|
|
|
- _this.acceptUsers = res.data
|
|
|
- _this.initinfo()
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- // handle error
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
- //选择编辑人信息
|
|
|
- selectAuthorUser() {
|
|
|
- if (this.AuthorUser != this.authUser.Profile.Id) {
|
|
|
- this.loginDialogVisible = true
|
|
|
- }
|
|
|
- for (var i = 0; i < this.acceptUsers.length; i++) {
|
|
|
- if (this.acceptUsers[i].id === this.AuthorUser) {
|
|
|
- this.AuthorUserName = this.acceptUsers[i].name
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
//取消验证
|
|
|
cancelLogin() {
|
|
|
if (this.isLoginSucceed) {
|
|
|
@@ -513,32 +419,10 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- //获取权限
|
|
|
- getPermissions() {
|
|
|
- let _this = this
|
|
|
- // request
|
|
|
- let params = {
|
|
|
- percodes: `'${this.permissionscode.cellsdocumentedit}','${this.permissionscode.cellsdocumentapprove}'`
|
|
|
- }
|
|
|
- this.$axios.get('/permissions/isauths', {
|
|
|
- params
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
- if (res.data instanceof Array && res.data.length > 0) {
|
|
|
- res.data.forEach(element => {
|
|
|
- _this.permissions[element.Code] = element.Isperm
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- // handle error
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
//删除文件
|
|
|
deletedatafile() {
|
|
|
let _this = this
|
|
|
- _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
+ _this.$confirm('此操作将彻底删除该数据, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|