master
lion 3 years ago
parent bc4e1e2e99
commit 62d5e97eba

@ -0,0 +1,38 @@
import request from '@/utils/request'
export function listasklog(params) {
return request({
url: '/api/admin/ask_log/index',
method: 'get',
params:params
})
}
export function save(data) {
return request({
url: '/api/admin/ask_log/save',
method: 'post',
data
})
}
export function del(id) {
return request({
url: '/api/admin/ask_log/destroy',
method: 'get',
params: {
id
}
})
}
export function get(id) {
return request({
url: '/api/admin/ask_log/show',
method: 'get',
params: {
id
}
})
}

@ -0,0 +1,37 @@
import request from '@/utils/request'
export function listplan(params) {
return request({
url: '/api/admin/mission-plan/index',
method: 'get',
params:params
})
}
export function save(data) {
return request({
url: '/api/admin/mission-plan/save',
method: 'post',
data
})
}
export function del(id) {
return request({
url: '/api/admin/mission-plan/destroy',
method: 'get',
params: {
id
}
})
}
export function get(id) {
return request({
url: '/api/admin/mission-plan/show',
method: 'get',
params: {
id
}
})
}

@ -0,0 +1,468 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '发起计划' : '编辑计划'" :form="form"
:rules='rules' @submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>计划名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" placeholder="请输入计划名称" clearable style="width: 400px;"></el-input>
</div>
</div>
</template>
<template v-slot:unit_type>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>计划类型
</div>
<div class="xy-table-item-content">
<el-select v-model="form.unit_type" filterable clearable placeholder="请选择计划类型" style="width: 400px;">
<el-option v-for="item in unitTypeList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:start_date>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>开始日期
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 400px;" v-model="form.start_date" value-format="yyyy-MM-dd" type="date"
placeholder="选择开始日期">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:end_date>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>结束日期
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 400px;" v-model="form.end_date" value-format="yyyy-MM-dd" type="date"
placeholder="选择结束日期">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:count>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>任务数量
</div>
<div class="xy-table-item-content">
<el-input v-model="form.count" placeholder="请输入预期任务数量" clearable style="width: 400px;"></el-input>
</div>
</div>
</template>
<template v-slot:is_audit>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>是否审批
</div>
<div class="xy-table-item-content">
<el-radio-group v-model="form.is_audit" @change='changeAudit'>
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</div>
</div>
</template>
<template v-slot:audit_admin_id v-if="form.is_audit==1">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>审批人
</div>
<div class="xy-table-item-content">
<el-select v-model="form.audit_admin_id" filterable clearable placeholder="请选择审批人" style="width: 400px;">
<el-option v-for="item in userdata" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:file_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>附件
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class='upload-demo' :file-list="pictureList" ref="pictureUpload"
style="width:600px" :auto-upload="true" :data="uploadOther" :on-success="handlesuccess"
:on-remove="handleRemove">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</template>
<template v-slot:content>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>说明
</div>
<div class="xy-table-item-content">
<el-input v-model="form.content" :rows='5' type='textarea' placeholder="请输入说明" clearable
style="width:400px"></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
Message
} from 'element-ui'
import {
getparameteritem
} from "@/api/system/dictionary.js";
import {
save,
get
} from "@/api/task/plan.js";
import {
listCommonuser
} from "@/api/common.js"
import {
getToken
} from '@/utils/auth'
export default {
components: {
},
data() {
return {
isShow: false,
type: 'add',
mission_type:'',
id: '',
department_id:'',
uploadOther: {
token: ""
},
action: `${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
pictureList: [],
deptOptions: [],
checkAll: false,
isIndeterminate: true,
userdata: [],
filterMethod(query, item) {
return item.name.indexOf(query) > -1;
},
unitTypeList: [{
id: 1,
value: '专项检查'
}, {
id: 2,
value: '资料收集'
}, {
id: 3,
value: '网络安全'
}],
endTypeList: [{
id: 1,
name: '提交文字'
}, {
id: 2,
name: '提交附件'
}, {
id: 3,
name: '提交文字与附件'
}],
studyEndTypeList:[{
id: 4,
name: '查看即可'
}, {
id: 5,
name: '需要答题'
}],
form: {
type: '',
name: '',
unit_type: '',
start_date: '',
end_date: '',
count:'',
lefts:'',
name7: 1,
is_need_answer:'',
is_audit: 0,
audit_admin_id: '',
audit_status: 1,
file_ids: '',
content: '',
end_type: '',
end_content: '',
type: '',
accept_admin_ids: [],
accept_department_ids: [],
ask:[]
},
rules: {
name: [{
required: true,
message: '请输入任务名称'
}],
start_date: [{
required: true,
message: '请选择开始时间'
}],
end_date: [{
required: true,
message: '请选择结束时间'
}],
unit_type: [{
required: true,
message: '请选择任务类型'
}]
}
}
},
created() {
this.uploadOther.token = getToken();
this.loadUser()
},
methods: {
openQs(){
this.$refs.addQuestion.qsShow=true
this.$refs.addQuestion.topicList = this.form.ask
},
submitQs(e){
this.form.ask = e
},
changeAudit(e) {
console.log("e",e)
if (e == 1) {
this.form.audit_status = 0
this.form.audit_admin_id = ''
} else {
this.form.audit_status = 1
this.form.audit_admin_id = 0
}
},
loadUser() {
listCommonuser({
page_size: 999,
department_id:this.department_id
}).
then((res) => {
this.userdata = res.data ? res.data.reverse() : [];
}).catch(error => {
console.log(error)
})
},
async getDetail() {
const res = await get(this.id)
this.form = {
type: res?.type,
name: res?.name,
unit_type: res?.unit_type,
start_date: res?.start_date,
end_date: res?.end_date,
count:res?.count,
lefts:'',
name7: res.accept_department_ids.length > 0 ? 2 : (res.accept_admin_ids.length > 0 ? 1 : (res
.groups.length > 0 ? 3 : 1)),
is_need_answer:'',
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,
ask:res.ask?res.ask:[]
}
for (var f of res.files) {
this.pictureList.push({
id: f.id,
url: f.url,
name: f.original_name
})
}
// 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 = []
}
if(this.form.is_audit==0){
this.form.audit_admin_id = 0
this.audit_status = 1
}else{
this.audit_status = 0
if(!this.form.audit_admin_id){
Message({
type: 'warning',
message: `请选择审批人`
})
return
}
}
// return
if (this.type === 'add') {
save({
...this.form
}).then(res => {
Message({
type: 'success',
message: '新增任务成功'
})
this.isShow = false
this.$emit('refresh')
})
return
}
if (this.type === 'editor') {
save({
id: this.id,
...this.form
}).then(res => {
Message({
type: 'success',
message: '编辑任务成功'
})
this.isShow = false
this.$emit('refresh')
})
}
},
handleRemove(file, fileList) {
this.pictureList = fileList
},
handlesuccess(response, file, fileList) {
this.pictureList = fileList
},
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.pictureList = []
this.mission_type = ''
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .content,
::v-deep .end_type,
::v-deep .file_ids,
::v-deep .is_need_answer{
flex-basis: 100%;
}
::v-deep .type {
display: none;
}
::v-deep .el-form>div{
align-items: flex-start!important;
}
.xy-table-item{
padding-right:0
}
::v-deep .xy-table-item-label {
padding-right:0
}
.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>

@ -1,7 +1,17 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '发起任务' : '编辑任务'" :form="form"
:rules='rules' @submit="submit">
:rules='rules' @submit="submit">
<template v-slot:mission_name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>计划名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.mission_name" placeholder="请输入计划名称" clearable style="width: 400px;"></el-input>
</div>
</div>
</template>
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -49,20 +59,96 @@
</div>
</div>
</template>
<template v-slot:is_audit>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>是否审批
</div>
<div class="xy-table-item-content">
<el-radio-group v-model="form.is_audit" @change='changeAudit'>
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</div>
<template v-slot:lefts>
<div>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>是否审批
</div>
<div class="xy-table-item-content">
<el-radio-group v-model="form.is_audit" @change='changeAudit'>
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</div>
</div>
</div>
<div v-if="form.is_audit==1">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>审批人
</div>
<div class="xy-table-item-content">
<el-select v-model="form.audit_admin_id" filterable clearable placeholder="请选择审批人" style="width: 400px;">
<el-option v-for="item in userdata" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</div>
<div>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>附件
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class='upload-demo' :file-list="pictureList" ref="pictureUpload"
style="width:600px" :auto-upload="true" :data="uploadOther" :on-success="handlesuccess"
:on-remove="handleRemove">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</div>
<div>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>说明
</div>
<div class="xy-table-item-content">
<el-input v-model="form.content" :rows='5' type='textarea' placeholder="请输入说明" clearable
style="width:400px"></el-input>
</div>
</div>
</div>
<div>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>{{mission_type==2?'学习方式':'完成要求'}}
</div>
<div class="xy-table-item-content" style='min-width:100px'>
<el-select v-if='mission_type==2' style="width: 400px;" v-model="form.end_type" filterable clearable placeholder="请选择完成要求">
<el-option v-for="item in studyEndTypeList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<el-select v-else style="width: 400px;" v-model="form.end_type" filterable clearable placeholder="请选择完成要求">
<el-option v-for="item in endTypeList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<Button type="primary" style="height: 40px;margin-left: 10px;vertical-align: top;" v-if="mission_type==2&&form.end_type==5" @click="openQs"></Button>
</div>
</div>
</div>
<div>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>{{mission_type==2?'学习要求':'完成详情'}}
</div>
<div class="xy-table-item-content">
<el-input v-model="form.end_content" :rows='5' type='textarea' placeholder="请输入完成详情" clearable
style="width: 400px;"></el-input>
</div>
</div>
</div>
</template>
<template v-slot:audit_admin_id v-if="form.is_audit==1">
<!-- <template v-slot:audit_admin_id v-if="form.is_audit==1">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>审批人
@ -107,7 +193,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>{{mission_type==2?'学习方式':'任务完成要求'}}
</div>
<div class="xy-table-item-content" style='min-width:600px'>
<div class="xy-table-item-content" style='min-width:100px'>
<el-select v-if='mission_type==2' style="width: 400px;" v-model="form.end_type" filterable clearable placeholder="请选择完成要求">
<el-option v-for="item in studyEndTypeList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
@ -116,7 +202,7 @@
<el-option v-for="item in endTypeList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<Button type="primary" style="height: 40px;margin-left: 10px;vertical-align: top;" v-if="mission_type==2&&form.end_type==5" @click="openQs"></Button>
<Button type="primary" style="height: 40px;margin-left: 10px;vertical-align: top;" v-if="mission_type==2&&form.end_type==5" @click="openQs"></Button>
</div>
</div>
</template>
@ -130,27 +216,95 @@
style="width: 400px;"></el-input>
</div>
</div>
</template>
<template v-slot:name7>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>参与用户选择
</div>
<div class="xy-table-item-content" style="width:400px">
<el-radio-group v-model="form.name7" @change='changeName7'>
<el-radio :label="1">人员</el-radio>
<el-radio :label="2" v-if='form.type!=4'>部门</el-radio>
<el-radio :label="3" v-if='form.type!=4'>组别</el-radio>
</el-radio-group>
</div>
</template> -->
<template v-slot:name7>
<div>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>参与用户选择
</div>
<div class="xy-table-item-content" style="width:400px">
<el-radio-group v-model="form.name7" @change='changeName7'>
<el-radio :label="1">人员</el-radio>
<el-radio :label="2" v-if='form.type!=4'>部门</el-radio>
<el-radio :label="3" v-if='!(form.type==4||form.type==2)'>组别</el-radio>
</el-radio-group>
</div>
</div>
</div>
<div v-if='form.name7==1'>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>
</div>
<div class="xy-table-item-content" style='min-width:600px'>
<el-transfer filterable :titles="['待选择', '已选择']" :props="{key: 'id',label: 'name'}"
:filter-method="filterMethod" :format="{ noChecked: '${total}',hasChecked: '${checked}/${total}' }"
filter-placeholder="请选择参与人员" v-model="form.accept_admin_ids" :data="userdata">
</el-transfer>
</div>
</div>
</div>
<div v-if='form.name7==2&&form.type!=4'>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>
</div>
<div class="xy-table-item-content" style='min-width:100px'>
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">
</el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="form.accept_department_ids" @change="handleCheckedDeptChange">
<el-checkbox @change="handleCheckedDeptSingleChange" v-for="dept in deptOptions" :label="dept.id"
:key="dept.id">{{dept.name}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</div>
<div v-if='form.name7==3&&!(form.type==4||form.type==2)'>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>
</div>
<div class="xy-table-item-content" style='min-width:100px'>
<Button type='primary' @click="mission_groups_list.push({name:'',type:1,link_id:[]})"></Button>
<div v-for="(item,index) in mission_groups_list" style='margin:10px;margin-left:0'>
<div>
<Button style="margin-right:10px" @click="mission_groups_list.splice(index,1)"></Button>
组别{{item.name=mission_groups_name[index]}}
<el-radio-group v-model="item.type" @change='item.link_id=[]' style="margin:10px;margin-right:20px">
<el-radio :label="1">人员</el-radio>
<el-radio :label="2">部门</el-radio>
</el-radio-group>
<el-select v-if='item.type==1' v-model="item.link_id" clearable filterable multiple placeholder="请选择人员">
<el-option v-for="item in userdata" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<el-select v-if='item.type==2' v-model="item.link_id" clearable filterable multiple placeholder="请选择部门">
<el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</div>
</div>
</div>
</template>
<template v-slot:accept_admin_ids v-if='form.name7==1'>
</template>
<!-- <template v-slot:accept_admin_ids v-if='form.name7==1'>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>
</div>
<div class="xy-table-item-content" style='min-width:600px'>
<div class="xy-table-item-content" style='min-width:100px'>
<el-transfer filterable :titles="['待选择', '已选择']" :props="{key: 'id',label: 'name'}"
:filter-method="filterMethod" :format="{ noChecked: '${total}',hasChecked: '${checked}/${total}' }"
filter-placeholder="请选择参与人员" v-model="form.accept_admin_ids" :data="userdata">
@ -163,7 +317,7 @@
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>
</div>
<div class="xy-table-item-content" style='min-width:600px'>
<div class="xy-table-item-content" style='min-width:100px'>
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">
</el-checkbox>
<div style="margin: 15px 0;"></div>
@ -180,7 +334,7 @@
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>
</div>
<div class="xy-table-item-content" style='min-width:600px'>
<div class="xy-table-item-content" style='min-width:100px'>
<Button type='primary' @click="mission_groups_list.push({name:'',type:1,link_id:[]})"></Button>
<div v-for="(item,index) in mission_groups_list" style='margin:10px;margin-left:0'>
<div>
@ -206,11 +360,11 @@
</div>
</div>
</template>
</template> -->
<!-- 答题 -->
<template v-slot:is_need_answer v-if="mission_type==2&&form.end_type==5">
<!-- <template v-slot:is_need_answer v-if="mission_type==2&&form.end_type==5">
</template>
</template> -->
@ -294,11 +448,15 @@
name: '需要答题'
}],
form: {
type: '',
type: '',
mission_name:'',
name: '',
unit_type: '',
start_date: '',
end_date: '',
end_date: '',
lefts:'',
name7: 1,
is_need_answer:'',
is_audit: 0,
audit_admin_id: '',
audit_status: 1,
@ -308,11 +466,10 @@
end_type: '',
end_content: '',
type: '',
name7: 1,
accept_admin_ids: [],
accept_department_ids: [],
mission_groups: [],
is_need_answer:''
ask:[]
},
mission_groups_list: [{
name: '',
@ -357,10 +514,11 @@
methods: {
openQs(){
this.$refs.addQuestion.qsShow=true
this.$refs.addQuestion.topicList = []
this.$refs.addQuestion.topicList = this.form.ask
},
submitQs(e){
console.log("e",e)
this.form.ask = e
},
changeName7(e) {
if (e) {
@ -447,10 +605,15 @@
const res = await get(this.id)
this.form = {
type: res?.type,
name: res?.name,
name: res?.name,
mission_name:res?.mission_name,
unit_type: res?.unit_type,
start_date: res?.start_date,
end_date: res?.end_date,
end_date: res?.end_date,
lefts:'',
name7: res.accept_department_ids.length > 0 ? 2 : (res.accept_admin_ids.length > 0 ? 1 : (res
.groups.length > 0 ? 3 : 1)),
is_need_answer:'',
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,
@ -458,13 +621,14 @@
content: res?.content,
end_type: res?.end_type,
end_content: res?.end_content,
name7: res.accept_department_ids.length > 0 ? 2 : (res.accept_admin_ids.length > 0 ? 1 : (res
.groups.length > 0 ? 3 : 1)),
accept_admin_ids: res?.accept_admin_ids,
accept_department_ids: res?.accept_department_ids,
mission_groups: res?.groups,
is_need_answer:'',
}
ask:res.ask?res.ask:[]
}
this.mission_type = this.form.type
this.mission_groups_list = []
for (var g of res.groups) {
this.mission_groups_list.push({
@ -593,18 +757,24 @@
</script>
<style scoped lang="scss">
::v-deep .name7,::v-deep .content,
::v-deep .content,
::v-deep .end_type,
::v-deep .file_ids{
::v-deep .file_ids,
::v-deep .is_need_answer{
flex-basis: 100%;
}
::v-deep .type {
display: none;
}
::v-deep .el-form>div{
align-items: flex-start!important;
}
.xy-table-item-label {
width: 140px;
.xy-table-item{
padding-right:0
}
::v-deep .xy-table-item-label {
padding-right:0
}
.img__delete {

@ -0,0 +1,197 @@
<template>
<div>
<Modal width="98%" :value.sync="isShow" fullScreen title="答题" :class-name="'vertical-center-modal'"
@on-visible-change="showChange">
<div v-if="isSubmit" style="text-align: center;font-size: 20px;">
<span style="color:red">{{askList.length}}</span>答对<span style="color:red">{{correct}}</span>正确率<span style="color:red">{{range}}</span>
</div>
<div v-for="(item,index) in askList">
<div class="asks">
<div class="ask_title">
{{index+1}}{{item.qsForm.type_name}}{{item.qsForm.title}}
<span v-for='ans in item.qsForm.answer' style="color:red" v-if="isSubmit">
{{ans}}
</span>
</div>
<div class="ask_content">
<div v-if="item.qsForm.type_name=='单选题'">
<RadioGroup v-model="item.checkAnswer">
<Radio :disabled="isSubmit" v-for="dom in item.qsForm.domains" :label="dom.id">{{dom.id}}{{dom.value}}
</Radio>
</RadioGroup>
</div>
<div v-if="item.qsForm.type_name=='多选题'">
<CheckboxGroup v-model="item.checkAnswer">
<Checkbox :disabled="isSubmit" v-for="dom in item.qsForm.domains" :label="dom.id">
{{dom.id}}{{dom.value}}
</Checkbox>
</CheckboxGroup>
</div>
<div v-if="item.qsForm.type_name=='简答题'">
<Input v-model="item.checkAnswer" :disabled="isSubmit" type="textarea" :rows="4" placeholder="" />
</div>
</div>
</div>
</div>
<template v-slot:footer>
<Button @click="calcelAnswer"></Button>
<Button type="primary" @click="submitAnswer"></Button>
</template>
</Modal>
</div>
</template>
<script>
import {
save
} from "@/api/task/ask.js"
import {
Message
} from 'element-ui'
export default {
props:{
isShow:{
type:Boolean,
default:false
},
},
data() {
return {
// isShow: false,
mission_id: '',
askList: [],
isSubmit: false,
correct:0,
range:0
}
},
created() {
},
watch: {
isShow(newval) {
if (newval) {
} else {
console.log("123")
this.mission_id = ''
this.askList = []
this.correct = 0
this.range = 0
this.isSubmit = false
this.$forceUpdate()
}
}
},
methods: {
showChange(e) {
this.$emit('update:isShow', e)
if(!e){
this.mission_id = ''
this.askList = []
this.correct = 0
this.range = 0
this.isSubmit = false
}
},
calcelAnswer() {
this.$emit('update:isShow', false)
this.mission_id = ''
this.askList = []
this.correct = 0
this.range = 0
this.isSubmit = false
},
submitAnswer() {
console.log(this.askList)
let that = this
Message({
type: 'success',
message: `提交成功`
})
that.range = that.correct==0?0:parseFloat(that.correct/that.askList.length).toFixed(2) + "%"
this.isSubmit = true
return
save({
mission_id:that.mission_id,
data:that.askList,
correct:that.correct
}).then(res=>{
that.range = parseFloat(that.correct/that.askList.length).toFixed(2) + "%"
Message({
type: 'success',
message: `提交成功`
})
this.isSubmit = true
})
// this.isShow = false
},
//
checkAnswers(callback){
let correctCount = 0
let isAnswerCount = 0
this.askList.map((item,index)=>{
if(!item.checkAnswer||item.checkAnswer.length==0){
isAnswerCount++
}
})
if(isAnswerCount>0){
Message({
type: 'warning',
message: `还有${isAnswerCount}题还未作答`
})
return
}
this.askList.map((item,index)=>{
if(item.qsForm.type_name=='多选题'){
if(item.checkAnswer){
if(item.checkAnswer.length==item.qsForm.answer.length){
let p = item.qsForm.answer.every((item1, index1) => {
return item.checkAnswer.indexOf(item1) !== -1;
});
p?correctCount++:""
}
}
}
if(item.qsForm.type_name=='单选题'){
if(item.checkAnswer&&item.checkAnswer==item.qsForm.answer.join("")){
correctCount++
}
}
if(item.qsForm.type_name=='简答题'){
if(item.checkAnswer.length>0){
correctCount++
}
}
})
this.correct = correctCount
}
}
}
</script>
<style scoped>
.asks {
font-size: 18px;
margin-bottom: 10px;
}
.ask_title {
margin-bottom: 10px;
}
.ask_content {
padding-left: 35px;
}
/deep/ .ask_content label {
margin-right: 100px
}
</style>

@ -0,0 +1,189 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" title="答题" :form='form'>
<template v-slot:normalContent>
<div v-if="isSubmit" style="text-align: center;font-size: 20px;">
<span style="color:red">{{askList.length}}</span>答对<span style="color:red">{{correct}}</span>正确率<span style="color:red">{{range}}</span>
</div>
<div v-for="(item,index) in askList">
<div class="asks">
<div class="ask_title">
{{index+1}}{{item.qsForm.type_name}}{{item.qsForm.title}}
<span v-for='ans in item.qsForm.answer' style="color:red" v-if="isSubmit">
{{ans}}
</span>
</div>
<div class="ask_content">
<div v-if="item.qsForm.type_name=='单选题'">
<RadioGroup v-model="item.checkAnswer">
<Radio :disabled="isSubmit" v-for="dom in item.qsForm.domains" :label="dom.id">{{dom.id}}{{dom.value}}
</Radio>
</RadioGroup>
</div>
<div v-if="item.qsForm.type_name=='多选题'">
<CheckboxGroup v-model="item.checkAnswer">
<Checkbox :disabled="isSubmit" v-for="dom in item.qsForm.domains" :label="dom.id">
{{dom.id}}{{dom.value}}
</Checkbox>
</CheckboxGroup>
</div>
<div v-if="item.qsForm.type_name=='简答题'">
<Input v-model="item.checkAnswer" :disabled="isSubmit" type="textarea" :rows="4" placeholder="" />
</div>
</div>
</div>
</div>
</template>
<template v-slot:footerContent>
<div v-if="!isSubmit">
<Button @click="isShow = false">取消</Button>
<Button type="primary" @click="submitAnswer"></Button>
</div>
<div v-else>
<Button @click="closeAnswer"></Button>
</div>
</template>
</xy-dialog>
<!--
<Modal width="98%" :value.sync="isShow" fullScreen title="答题" :class-name="'vertical-center-modal'"
@on-visible-change="showChange">
</Modal> -->
</div>
</template>
<script>
import {
save
} from "@/api/task/ask.js"
import {
Message
} from 'element-ui'
export default {
data() {
return {
isShow: false,
mission_id: '',
askList: [],
isSubmit: false,
correct:0,
range:0,
form:{
normalContent:''
}
}
},
created() {
},
watch: {
isShow(newval) {
if (newval) {
} else {
this.mission_id = ''
this.askList = []
this.correct = 0
this.range = 0
this.isSubmit = false
}
}
},
methods: {
submitAnswer() {
let that = this
if(this.checkAnswers()){
save({
mission_id:that.mission_id,
data:that.askList,
correct:that.correct
}).then(res=>{
that.range = parseFloat(that.correct/that.askList.length).toFixed(2)*100 + "%"
Message({
type: 'success',
message: `提交成功`
})
this.isSubmit = true
})
}
// this.isShow = false
},
closeAnswer(){
this.isShow = false
this.$emit("refresh")
},
//
checkAnswers(){
let correctCount = 0
let isAnswerCount = 0
this.askList.map((item,index)=>{
if(!item.checkAnswer||item.checkAnswer.length==0){
isAnswerCount++
}
})
if(isAnswerCount>0){
Message({
type: 'warning',
message: `还有${isAnswerCount}题还未作答`
})
return false
}
this.askList.map((item,index)=>{
if(item.qsForm.type_name=='多选题'){
if(item.checkAnswer){
if(item.checkAnswer.length==item.qsForm.answer.length){
let p = item.qsForm.answer.every((item1, index1) => {
return item.checkAnswer.indexOf(item1) !== -1;
});
p?correctCount++:""
}
}
}
if(item.qsForm.type_name=='单选题'){
if(item.checkAnswer&&item.checkAnswer==item.qsForm.answer.join("")){
correctCount++
}
}
if(item.qsForm.type_name=='简答题'){
if(item.checkAnswer.length>0){
correctCount++
}
}
})
this.correct = correctCount
return true
}
}
}
</script>
<style scoped>
/deep/ .normalContent{
flex-basis: 100%;
}
.asks {
font-size: 18px;
margin-bottom: 10px;
}
.ask_title {
margin-bottom: 10px;
}
.ask_content {
padding-left: 35px;
}
/deep/ .ask_content label {
margin-right: 100px
}
</style>

@ -1,6 +1,6 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="'审核'" :form="form"
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="'查看'" :form="form"
@submit="submit">
<template v-slot:mission_name>
<el-divider>任务信息</el-divider>
@ -161,6 +161,12 @@
}, {
id: 3,
name: '提交文字与附件'
},{
id: 4,
name: '查看即可'
}, {
id: 5,
name: '需要答题'
}],
auditStatusList:[{
id:0,

@ -0,0 +1,260 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" :text="'任务计划'" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.keyword" clearable style="width: 200px;margin-right: 10px;" placeholder="关键字搜索" />
<Select filterable clearable style='width:200px;margin-right: 10px;' v-model="select.status" placeholder="检查状态">
<Option v-for="item in statusList" :value="item.id">{{item.value}}</Option>
</Select>
<!-- <Select filterable clearable style='width:200px;margin-right: 10px;' v-model="select.mission_id" placeholder="专项任务">
<Option v-for="item in missionList" :value="item.id">{{item.name}}</Option>
</Select> -->
<Button type="primary" @click="getList"></Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;" @click="$refs['addPlan'].isShow=true,$refs['addPlan'].type='add'"></Button>
</div>
</slot>
</lx-header>
</div>
<!-- @cell-click="cellClicks" -->
<xy-table
:list="list"
:total="total"
stripe
@pageSizeChange="e => {select.page_size = e,getList()}"
@pageIndexChange="e => {select.page = e,getList()}"
:table-item="table">
<!-- <template v-slot:btns>
<el-table-column fixed="right" align='center' label="操作" min-width="180" header-align="center">
<template slot-scope="scope">
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'show')"></Button>
<Button v-if='scope.row.status==0&&(is_guiji||is_chuzhang||login_id==scope.row.admin_id)' type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="editorPatrol(scope.row.id,'editor')"></Button>
<Button v-if="scope.row.status==1&&((scope.row.check_leader==1&&is_leader)||(scope.row.check_main==1&&is_main_leader))" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'leader')"></Button>
<Button v-if="scope.row.status==9&&((scope.row.re_check_leader==1&&is_leader)||(scope.row.re_check_main==1&&is_main_leader))" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'leaderconfirm')"></Button>
</template>
</el-table-column>
</template> -->
</xy-table>
<addPlan ref='addPlan' @refresh='getList'></addPlan>
</div>
</template>
<script>
import addPlan from '../list/components/addPlan.vue'
import {
listplan,del,leads
} from '@/api/task/plan.js'
export default{
components:{
addPlan
},
data(){
return{
select:{
keyword:'',
page:1,
page_size:10,
status:'',
myself:0,
mission_id:''
// myself_update:0
},
total:0,
statusList:[{
id:-1,
value:'已撤回'
},{
id:0,
value:'待审核'
},{
id:1,
value:'待领导确认'
},{
id:2,
value:'已分发,待接收'
},{
id:3,
value:'已接收'
},{
id:4,
value:'提交整改'
},{
id:5,
value:'已整改'
},{
id:6,
value:'不通过'
},{
id:7,
value:'整改不通过,重新整改'
},{
id:8,
value:'部门退回'
},{
id:9,
value:'待领导确认整改'
}],
table:[{
label:"任务专题",
prop:'mission.name',
align:'left',
fixed:'left',
width:240
},{
label:"检查日期",
prop:'date',
width:180,
},{
label:"状态",
prop:'status',
width:180,
formatter:(cell,data,value,index)=>{
for(var item of this.statusList){
if(item.id==value){
return item.value
}
}
}
},{
label:"问题类型",
prop:'ask.value',
width:180,
},{
label:"地点",
prop:'site.name',
width:180,
},{
label:"问题图片",
prop:'files',
width:240,
customFn: (row) => {
let arr = []
return ( <div style = {
{
whiteSpace:'normal'
}
}>{
row.files.map(item=>{
arr.push(item.url)
return (
<el-image
style={
{
width:'60px',
height:'60px',
marginLeft:'5px'
}
}
src = {
item.url
}
preview-src-list={
arr
}
></el-image>)
})
}
</div>)
}
},{
label:"计划完成日期",
prop:'plan_end_date',
width:180,
},{
label:"整改完成日期",
prop:'fix_end_date',
width:180,
},{
label:"整改图片",
prop:'fix_files',
width:240,
customFn: (row) => {
let arr = []
return ( <div style = {
{
whiteSpace:'normal'
}
}>{
row.fix_files.map(item=>{
arr.push(item.url)
return (
<el-image
style={
{
width:'60px',
height:'60px',
marginLeft:'5px'
}
}
src = {
item.url
}
preview-src-list={
arr
}
></el-image>)
})
}
</div>)
}
},{
label:"上报人",
prop:'admin.name',
width:180,
}],
list:[],
}
},
created(){
this.getList()
},
methods: {
async getList(){
const res = await listplan({...this.select})
this.list = res.data
this.total = res.total
},
pageChange(){},
editorPatrol(id,type){
this.$refs.addPlan.id= id
this.$refs.addPlan.type= type
this.$refs.addPlan.isShow = true
},
deleteList(id){
var that = this;
if (id) {
this.$Modal.confirm({
title: '确认要删除数据?',
onOk: () => {
del(id).then(response => {
this.$Message.success('操作成功');
that.getList();
}).catch(error => {
console.log(error)
reject(error)
})
},
onCancel: () => {
//this.$Message.info('Clicked cancel');
}
});
}
}
},
watch:{}
}
</script>
<style scoped>
/deep/ .el-icon-circle-close{
color:#fff
}
/* /deep/ .el-table__body tr.el-table__row--striped td {
background-color: #C0C4CC!important;
} */
</style>

@ -110,8 +110,10 @@
</Poptip>
</div>
<div v-else>
<Button type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="editorUnit(scope.row.id,'editor')"></Button>
<Button type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="checkUnits(scope.row.id,'show')"></Button>
<Button type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="$refs['addPatrol'].mission_id=scope.row.id,$refs['addPatrol'].isShow=true,$refs['addPatrol'].type='add'"></Button>
<!-- <Button type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="$refs['addPatrol'].mission_id=scope.row.id,$refs['addPatrol'].isShow=true,$refs['addPatrol'].type='add'"></Button> -->
</div>
</template>
@ -259,8 +261,10 @@
label: "完成要求",
prop: 'end_type',
width: 180,
formatter: (cell, data, value, index) => {
return value == 1 ? '提交文字' : (value == 2 ? '提交附件' : (value == 3 ? '提交文字与附件' : ''))
formatter: (cell, data, value, index) => {
return value == 1 ? '提交文字' : (value == 2 ? '提交附件' : (value == 3 ? '提交文字与附件' : (value == 4 ? '查看即可' : (value == 5 ? '需要答题' : ''))))
// return value == 1 ? '' : (value == 2 ? '' : (value == 3 ? '' : ''))
}
}, {
label: "参与用户",

@ -134,9 +134,11 @@
</Poptip>
</div>
<div v-else>
<Button type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="editorUnit(scope.row.id,'editor')"></Button>
<!-- <Button type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="editorUnit(scope.row.id,'editor')"></Button> -->
<Button type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="checkUnits(scope.row.id,'show')"></Button>
<Button type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="$refs['addPatrol'].mission_id=scope.row.id,$refs['addPatrol'].isShow=true,$refs['addPatrol'].type='add'"></Button>
<Button v-if="scope.row.type==2" type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="openAsks(scope.row)"></Button>
<Button v-else type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="$refs['addPatrol'].mission_id=scope.row.id,$refs['addPatrol'].isShow=true,$refs['addPatrol'].type='add'"></Button>
</div>
</template>
@ -150,7 +152,8 @@
<showPatrol ref='showPatrol'></showPatrol>
<addPatrol ref='addPatrol' @refresh='getList'></addPatrol>
<checkUnit ref='checkUnit' @refresh='getList'></checkUnit>
<checkUnit ref='checkUnit' @refresh='getList'></checkUnit>
<answerQuestion @refresh='getList' ref='answerQuestion'></answerQuestion>
</div>
</template>
@ -158,7 +161,8 @@
import addUnit from '../list/components/addUnit.vue'
import showPatrol from '../list/components/showPatrol.vue'
import addPatrol from '../list/components/addPatrol.vue'
import checkUnit from '../list/components/checkUnit.vue'
import checkUnit from '../list/components/checkUnit.vue'
import answerQuestion from '../list/components/answerQuestion.vue'
import {
listunit,
del
@ -169,10 +173,12 @@
addUnit,
showPatrol,
addPatrol,
checkUnit
checkUnit,
answerQuestion
},
data() {
return {
return {
askList:[],
typeName: [{
type: 1,
name: '专项任务'
@ -251,6 +257,22 @@
}, {
id: 3,
value: '网络安全'
}],
endTypeList: [{
id: 1,
name: '提交文字'
}, {
id: 2,
name: '提交附件'
}, {
id: 3,
name: '提交文字与附件'
},{
id: 4,
name: '查看即可'
}, {
id: 5,
name: '需要答题'
}],
table: [{
label: "标题",
@ -292,7 +314,7 @@
prop: 'end_type',
width: 180,
formatter: (cell, data, value, index) => {
return value == 1 ? '提交文字' : (value == 2 ? '提交附件' : (value == 3 ? '提交文字与附件' : ''))
return value == 1 ? '提交文字' : (value == 2 ? '提交附件' : (value == 3 ? '提交文字与附件' : (value == 4 ? '查看即可' : (value == 5 ? '需要答题' : ''))))
}
}, {
label: "参与人员",
@ -406,6 +428,11 @@
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
},
openAsks(scope){
this.$refs['answerQuestion'].mission_id=scope.id
this.$refs['answerQuestion'].askList = scope.ask
this.$refs['answerQuestion'].isShow=true
},
changeDate(e){
if(e){
this.select.start_date = e[0];

Loading…
Cancel
Save