|
|
|
|
@ -12,13 +12,13 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:unit_type>
|
|
|
|
|
<template v-slot: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-select v-model="form.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>
|
|
|
|
|
@ -86,7 +86,35 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template> -->
|
|
|
|
|
<template v-slot:file_ids>
|
|
|
|
|
<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-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='8' type='textarea' placeholder="请输入说明" clearable
|
|
|
|
|
style="width:400px"></el-input>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<!-- <template v-slot:file_ids>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>附件:
|
|
|
|
|
@ -113,6 +141,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</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>
|
|
|
|
|
</xy-dialog>
|
|
|
|
|
|
|
|
|
|
@ -130,6 +238,9 @@
|
|
|
|
|
save,
|
|
|
|
|
get
|
|
|
|
|
} from "@/api/task/plan.js";
|
|
|
|
|
import {
|
|
|
|
|
listdept
|
|
|
|
|
} from "@/api/system/department.js"
|
|
|
|
|
import {
|
|
|
|
|
listCommonuser
|
|
|
|
|
} from "@/api/common.js"
|
|
|
|
|
@ -143,8 +254,7 @@
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
isShow: false,
|
|
|
|
|
type: 'add',
|
|
|
|
|
mission_type:'',
|
|
|
|
|
type: 'add',
|
|
|
|
|
id: '',
|
|
|
|
|
department_id:'',
|
|
|
|
|
uploadOther: {
|
|
|
|
|
@ -187,27 +297,17 @@
|
|
|
|
|
name: '需要答题'
|
|
|
|
|
}],
|
|
|
|
|
form: {
|
|
|
|
|
name: '',
|
|
|
|
|
type: '',
|
|
|
|
|
name: '',
|
|
|
|
|
unit_type: '',
|
|
|
|
|
start_date: '',
|
|
|
|
|
end_date: '',
|
|
|
|
|
count:'',
|
|
|
|
|
// count:'',
|
|
|
|
|
lefts:'',
|
|
|
|
|
name7: 1,
|
|
|
|
|
is_need_answer:'',
|
|
|
|
|
is_audit: 0,
|
|
|
|
|
audit_admin_id: '',
|
|
|
|
|
audit_status: 1,
|
|
|
|
|
name7: 1,
|
|
|
|
|
file_ids: '',
|
|
|
|
|
content: '',
|
|
|
|
|
|
|
|
|
|
end_type: '',
|
|
|
|
|
end_content: '',
|
|
|
|
|
type: '',
|
|
|
|
|
accept_admin_ids: [],
|
|
|
|
|
accept_department_ids: [],
|
|
|
|
|
ask:[]
|
|
|
|
|
accept_department_ids: [],
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
name: [{
|
|
|
|
|
@ -222,7 +322,7 @@
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请选择结束时间'
|
|
|
|
|
}],
|
|
|
|
|
unit_type: [{
|
|
|
|
|
type: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请选择任务类型'
|
|
|
|
|
}]
|
|
|
|
|
@ -233,61 +333,93 @@
|
|
|
|
|
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
|
|
|
|
|
methods: {
|
|
|
|
|
changeName7(e) {
|
|
|
|
|
if (e) {
|
|
|
|
|
this.form.accept_department_ids = []
|
|
|
|
|
this.form.accept_admin_ids = []
|
|
|
|
|
this.form.mission_groups = []
|
|
|
|
|
this.form.mission_groups_list = []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
loadUser() {
|
|
|
|
|
listCommonuser({
|
|
|
|
|
},
|
|
|
|
|
// 选择科室
|
|
|
|
|
loadDeptOptions() {
|
|
|
|
|
listdept().
|
|
|
|
|
then((res) => {
|
|
|
|
|
for (var m of res) {
|
|
|
|
|
m.checked = false;
|
|
|
|
|
}
|
|
|
|
|
this.deptOptions = res;
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
reject(error)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
loadUser() {
|
|
|
|
|
listCommonuser({
|
|
|
|
|
page_size: 999,
|
|
|
|
|
department_id:this.department_id
|
|
|
|
|
}).
|
|
|
|
|
then((res) => {
|
|
|
|
|
this.userdata = res.data ? res.data.reverse() : [];
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
department_id:this.department_id
|
|
|
|
|
}).
|
|
|
|
|
then((res) => {
|
|
|
|
|
this.userdata = res.data ? res.data.reverse() : [];
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleCheckAllChange(val) {
|
|
|
|
|
let options = [];
|
|
|
|
|
for (var m of this.deptOptions) {
|
|
|
|
|
options.push(m.id);
|
|
|
|
|
}
|
|
|
|
|
this.form.accept_department_ids = val ? options : [];
|
|
|
|
|
this.isIndeterminate = false;
|
|
|
|
|
},
|
|
|
|
|
handleCheckedDeptSingleChange(v) {
|
|
|
|
|
//如果出现取消的操作 就要执行删除
|
|
|
|
|
console.log(v);
|
|
|
|
|
var that = this;
|
|
|
|
|
if (this.form.accept_department_ids)
|
|
|
|
|
that.delDeptItem();
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
//删除操作
|
|
|
|
|
delDeptItem() {
|
|
|
|
|
for (var m of this.deptOptions) {
|
|
|
|
|
if (this.form.accept_department_ids.indexOf(m.id) == -1) {
|
|
|
|
|
var d = this.form.accept_department_ids.filter(function(t) {
|
|
|
|
|
return t.department_id == m.id;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if (d.length != 0) {
|
|
|
|
|
delDep(d[0].id).then(response => {}).catch(error => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleCheckedDeptChange(value) {
|
|
|
|
|
let checkedCount = value.length;
|
|
|
|
|
this.checkAll = checkedCount === this.deptOptions.length;
|
|
|
|
|
this.isIndeterminate = checkedCount > 0 && checkedCount < this.deptOptions.length;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getDetail() {
|
|
|
|
|
const res = await get(this.id)
|
|
|
|
|
this.form = {
|
|
|
|
|
name: res?.name,
|
|
|
|
|
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:[]
|
|
|
|
|
accept_department_ids: res?.accept_department_ids,
|
|
|
|
|
}
|
|
|
|
|
for (var f of res.files) {
|
|
|
|
|
this.pictureList.push({
|
|
|
|
|
@ -312,19 +444,7 @@
|
|
|
|
|
} 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') {
|
|
|
|
|
@ -369,8 +489,7 @@
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.id = ''
|
|
|
|
|
this.pictureList = []
|
|
|
|
|
this.mission_type = ''
|
|
|
|
|
this.pictureList = []
|
|
|
|
|
this.$refs['dialog'].reset()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -387,9 +506,9 @@
|
|
|
|
|
flex-basis: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .type {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
// ::v-deep .type {
|
|
|
|
|
// display: none;
|
|
|
|
|
// }
|
|
|
|
|
::v-deep .el-form>div{
|
|
|
|
|
align-items: flex-start!important;
|
|
|
|
|
}
|
|
|
|
|
|