master
parent
3266867a68
commit
0c04e932a9
@ -1,9 +0,0 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@ -0,0 +1,383 @@
|
||||
<template>
|
||||
<div>
|
||||
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="'审核'" :form="form"
|
||||
@submit="submit">
|
||||
<template v-slot:mission_name>
|
||||
<el-divider>任务信息</el-divider>
|
||||
<div>
|
||||
<el-descriptions class="margin-top" :column="2" border>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
任务名称
|
||||
</template>
|
||||
{{showform.name?showform.name:''}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
任务类型
|
||||
</template>
|
||||
<div v-for="item in unitTypeList">
|
||||
<span v-if="showform.unit_type==item.id">
|
||||
{{item.value}}
|
||||
</span>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
开始日期
|
||||
</template>
|
||||
{{showform.start_date?showform.start_date:''}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
结束日期
|
||||
</template>
|
||||
{{showform.end_date?showform.end_date:''}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="showform.audit_admin_id>0?'1':'2'">
|
||||
<template slot="label">
|
||||
是否审批
|
||||
</template>
|
||||
{{showform.audit_admin_id>0?"是":'否'}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item v-if="showform.audit_admin_id">
|
||||
<template slot="label">
|
||||
审批人
|
||||
</template>
|
||||
{{showform.audit_admin_id?showform.audit_admin_id:''}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span='2'>
|
||||
<template slot="label">
|
||||
附件
|
||||
</template>
|
||||
<div v-for="item in pictureList">
|
||||
<a :href="item.url">{{item.name}}</a>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label" span='2'>
|
||||
说明
|
||||
</template>
|
||||
{{showform.content?showform.content:''}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span='2'>
|
||||
<template slot="label">
|
||||
任务完成要求
|
||||
</template>
|
||||
<div v-for="item in endTypeList">
|
||||
<span v-if="showform.end_type==item.id">
|
||||
{{item.name}}
|
||||
</span>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span='2'>
|
||||
<template slot="label">
|
||||
任务完成详情
|
||||
</template>
|
||||
{{showform.end_content?showform.end_content:''}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span='2'>
|
||||
<template slot="label">
|
||||
用户类型
|
||||
</template>
|
||||
<div v-if="showform.accept_admin&&showform.accept_admin.length>0">
|
||||
<el-tag style='margin-right:10px' v-for='item in showform.accept_admin'>
|
||||
{{item.name}}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div v-if="showform.accept_department&&showform.accept_department.length>0">
|
||||
<el-tag style='margin-right:10px' v-for='item in showform.accept_department'>
|
||||
{{item.name}}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div v-if="showform.groups&&showform.groups.length>0">
|
||||
<div v-for="group in showform.groups">
|
||||
{{group.name}}:
|
||||
<el-tag v-for="detail in group.details"
|
||||
style="margin-right: 5px;margin-bottom: 2px;">{{detail.name}}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:audit_status v-if="type=='check'">
|
||||
<el-divider>审核</el-divider>
|
||||
<div>
|
||||
<el-select v-model="form.unit_type" filterable clearable placeholder="请选择状态" style="width: 400px;">
|
||||
<el-option v-for="item in auditStatusList" :key="item.id" :label="item.value" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-slot:footerContent>
|
||||
<Button v-if="type=='check'" type="primary"
|
||||
style='margin-left:5px;margin-bottom:5px;' @click="submit">审核</Button>
|
||||
<Button type="primary" ghost style='margin-left:5px;margin-bottom:5px;' @click="isShow=false">取消</Button>
|
||||
|
||||
|
||||
</template>
|
||||
</xy-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
Message
|
||||
} from 'element-ui'
|
||||
import {
|
||||
save,
|
||||
get
|
||||
} from "@/api/task/unit.js";
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
type: 'add',
|
||||
id: '',
|
||||
pictureList: [],
|
||||
unitTypeList: [{
|
||||
id: 1,
|
||||
value: '专项检查'
|
||||
}, {
|
||||
id: 2,
|
||||
value: '资料收集'
|
||||
}, {
|
||||
id: 3,
|
||||
value: '网络安全'
|
||||
}],
|
||||
endTypeList: [{
|
||||
id: 1,
|
||||
name: '提交文字'
|
||||
}, {
|
||||
id: 2,
|
||||
name: '提交附件'
|
||||
}, {
|
||||
id: 3,
|
||||
name: '提交文字与附件'
|
||||
}],
|
||||
auditStatusList:[{
|
||||
id:0,
|
||||
value:'待审核'
|
||||
},{
|
||||
id:1,
|
||||
value:'通过'
|
||||
},{
|
||||
id:2,
|
||||
value:'不通过'
|
||||
}],
|
||||
showform:{},
|
||||
form: {
|
||||
mission_name:'',
|
||||
type: '',
|
||||
name: '',
|
||||
unit_type: '',
|
||||
start_date: '',
|
||||
end_date: '',
|
||||
is_audit: 0,
|
||||
audit_admin_id: '',
|
||||
audit_status: 1,
|
||||
file_ids: '',
|
||||
content: '',
|
||||
|
||||
end_type: '',
|
||||
end_content: '',
|
||||
type: '',
|
||||
accept_admin_ids: [],
|
||||
accept_department_ids: [],
|
||||
mission_groups: []
|
||||
},
|
||||
mission_groups_list: [{
|
||||
name: '',
|
||||
type: 1,
|
||||
link_id: []
|
||||
}],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.$route.path) {
|
||||
let path = this.$route.path.split("_")
|
||||
this.form.type = path[1]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
async getDetail() {
|
||||
let res = await get(this.id)
|
||||
console.log(res)
|
||||
this.form = {
|
||||
mission_name:'',
|
||||
type: res?.type,
|
||||
name: res?.name,
|
||||
unit_type: res?.unit_type,
|
||||
start_date: res?.start_date,
|
||||
end_date: res?.end_date,
|
||||
is_audit: res.audit_admin_id ? 1 : 0,
|
||||
audit_admin_id: res.audit_admin_id ? res.audit_admin_id : '',
|
||||
audit_status: res.audit_status?res.audit_status:1,
|
||||
file_ids: res?.file_ids,
|
||||
content: res?.content,
|
||||
end_type: res?.end_type,
|
||||
end_content: res?.end_content,
|
||||
accept_admin_ids: res?.accept_admin_ids,
|
||||
accept_department_ids: res?.accept_department_ids,
|
||||
mission_groups: res?.groups
|
||||
}
|
||||
this.mission_groups_list = []
|
||||
for (var g of res.groups) {
|
||||
this.mission_groups_list.push({
|
||||
name: g.name,
|
||||
type: g.type,
|
||||
link_id: g.link_id
|
||||
})
|
||||
}
|
||||
// this.mission_groups_list = res?.mission_groups
|
||||
for (var f of res.files) {
|
||||
this.pictureList.push({
|
||||
id: f.id,
|
||||
url: f.url,
|
||||
name: f.original_name
|
||||
})
|
||||
}
|
||||
this.showform = res
|
||||
// res.guide_upload ? this.guidePictureList.push(res.guide_upload) : ''
|
||||
},
|
||||
submit() {
|
||||
let _files = []
|
||||
if (this.pictureList.length > 0) {
|
||||
for (var h of this.pictureList) {
|
||||
if (h.response) {
|
||||
_files.push(h.response.id)
|
||||
} else {
|
||||
_files.push(h.id)
|
||||
}
|
||||
}
|
||||
this.form.file_ids = _files
|
||||
} else {
|
||||
this.form.file_ids = []
|
||||
}
|
||||
|
||||
|
||||
this.form.mission_groups = this.mission_groups_list
|
||||
// return
|
||||
save({
|
||||
id: this.id,
|
||||
...this.form
|
||||
}).then(res => {
|
||||
Message({
|
||||
type: 'success',
|
||||
message: '审核成功'
|
||||
})
|
||||
this.isShow = false
|
||||
this.$emit('refresh')
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
isShow(newVal) {
|
||||
if (newVal) {
|
||||
console.log("newval",newVal)
|
||||
this.getDetail()
|
||||
} else {
|
||||
this.id = ''
|
||||
this.pictureList = []
|
||||
this.mission_groups_list = [{
|
||||
name: '',
|
||||
type: 1,
|
||||
link_id: []
|
||||
}]
|
||||
this.$refs['dialog'].reset()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .name7,::v-deep .content,
|
||||
::v-deep .end_type,
|
||||
::v-deep .file_ids,
|
||||
::v-deep .mission_name{
|
||||
flex-basis: 100%;
|
||||
}
|
||||
|
||||
::v-deep .type {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.xy-table-item-label {
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
.img__delete {
|
||||
transform: scale(0.8, 0.8);
|
||||
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
right: 4px;
|
||||
}
|
||||
|
||||
::v-deep .avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
::v-deep .avatar-uploader .el-upload:hover {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
::v-deep .el-upload--picture-card {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 80px !important;
|
||||
height: 80px !important;
|
||||
line-height: 80px !important;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
::v-deep .avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 80px !important;
|
||||
height: 80px !important;
|
||||
line-height: 80px !important;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
::v-deep .avatar {
|
||||
width: 80px !important;
|
||||
display: block;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
// ::v-deep .xy-table-item-label {
|
||||
// width: 160px !important;
|
||||
// }
|
||||
|
||||
::v-deep .el-date-editor .el-range-separator {
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
::v-deep .el-input-number .el-input__inner {
|
||||
text-align: left !important;
|
||||
}
|
||||
|
||||
.searchCompanys {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 16px;
|
||||
|
||||
.el-input {
|
||||
width: 80%
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue