刘翔宇-旅管家 3 years ago
parent 2d8dfa8491
commit b32d3c9648

@ -22,8 +22,18 @@ export function save(data) {
method: 'post',
data
})
}
export function delDep(id) {
return request({
url: '/api/admin/task/task-department-destroy',
method: 'get',
params: {
id
}
})
}
export function del(safety_task_id) {
return request({
url: '/api/admin/task/destroy',

@ -38,11 +38,15 @@
</div>
<div v-if="column.field=='task_departments'">
<block v-for="(tag, tIndex) in scope.row['task_name']">
<el-tag style="margin-right: 5px;margin-bottom: 5px;" :type="tag.status==2?'success':'info'" v-if="tag.id">
<el-tag style="margin-right: 5px;margin-bottom: 5px;" :type="tag.status==2?'success':'info'"
v-if="tag.id">
{{tag.departments.name}}
</el-tag>
</block>
</div>
<div v-if="column.field=='type'">
{{scope.row[column.field]?scope.row[column.field].value:""}}
</div>
<div v-if="column.field=='admin'">
{{scope.row[column.field]?scope.row[column.field].name:""}}
</div>
@ -105,6 +109,8 @@
<div class="dialogConcent" :style="{height:clientHeight+'px'}">
<el-scrollbar style="flex: 1">
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
<el-form-item label="任务名称" prop="title">
<el-input v-model="form.title" placeholder="请填写任务名称" autocomplete="off"></el-input>
</el-form-item>
@ -115,12 +121,19 @@
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="任务类型" prop="type_id" label-position="right">
<el-select v-model="form.type_id" placeholder="请选择任务类型" style="width: 100%">
<el-option v-for="item in parameters.types" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="内容" prop="content">
<div style="width: 99.9%;">
<tinymce ref="tinymce" v-model="form.content" :height="300" />
</div>
</el-form-item>
<el-form-item label="附件" prop="file_list">
<el-upload class="upload-demo" :on-success="handlesuccess" :data="uploadOther" :action="action"
:before-remove="beforeRemove" :on-exceed="handleExceed" :file-list="fileList">
@ -133,7 +146,8 @@
</el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="form.department_list_id" @change="handleCheckedDeptChange">
<el-checkbox v-for="dept in deptOptions" :label="dept.id" :key="dept.id">{{dept.name}}</el-checkbox>
<el-checkbox @change="handleCheckedDeptSingleChange" v-for="dept in deptOptions" :label="dept.id"
:key="dept.id">{{dept.name}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
@ -153,6 +167,9 @@
</template>
<script>
import {
getparameteritem
} from "../../api/system/dictionary.js";
import {
getToken
} from '@/utils/auth'
@ -165,7 +182,8 @@
store,
del,
getdaily,
listtask
listtask,
delDep
} from "../../api/daily/index.js";
@ -181,6 +199,9 @@
},
data() {
return {
parameters: {
types: []
},
isStatus: {
"0": "未上报",
"1": "已保存",
@ -205,7 +226,7 @@
file_list: "",
start_date: "",
end_date: "",
type_id: "",
department_list_id: [],
department_list: [],
daterange: null
@ -240,6 +261,12 @@
type: "string",
type: "format",
width: 240
},{
field: "type",
title: "任务类型",
type: "string",
type: "format",
width: 120
},
{
field: "start_date",
@ -305,8 +332,7 @@
deptOptions: [],
tableDepartData: [],
departColumns: [
{
departColumns: [{
field: "操作",
title: "操作",
width: 220,
@ -318,7 +344,7 @@
title: "科室",
type: "format",
align: "center"
},{
}, {
field: "status",
title: "状态",
type: "format",
@ -351,6 +377,9 @@
loadDeptOptions() {
listdept().
then((res) => {
for (var m of res) {
m.checked = false;
}
this.deptOptions = res;
}).catch(error => {
console.log(error)
@ -365,6 +394,31 @@
this.form.department_list_id = val ? options : [];
this.isIndeterminate = false;
},
handleCheckedDeptSingleChange(v) {
//
console.log(v);
var that = this;
if (this.form.id)
that.delDeptItem();
},
//
delDeptItem() {
for (var m of this.deptOptions) {
if (this.form.department_list_id.indexOf(m.id) == -1) {
var d = this.form.department_list.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;
@ -378,6 +432,11 @@
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
//
getparameteritem("TaskType").then(res => {
this.parameters.types = res.detail;
});
},
handleCurrentChange(page) {
this.paginations.page = page;

Loading…
Cancel
Save