lion 3 years ago
parent 43f9fc95b9
commit bc4e1e2e99

@ -19,6 +19,7 @@
"avue-plugin-map": "^1.0.1",
"axios": "^0.26.1",
"core-js": "3.6.5",
"echarts": "^5.4.3",
"element-ui": "^2.15.14",
"js-cookie": "2.2.0",
"less": "^3.13.1",

@ -8,7 +8,7 @@ export default {
},
width:{
type:Number,
default:65
default:98
},
// isFullScreen:{
// type:Boolean,
@ -125,7 +125,7 @@ export default {
width={width}
title={title}
value={isShow}
fullscreen
fullScreen
on={{['on-visible-change']:showChange,['on-ok']:okClick}}
scopedSlots={{
@ -245,8 +245,8 @@ export default {
}
}
.ivu-modal-body{
max-height: 65vh !important;
min-height: 300px;
max-height: 87vh !important;
min-height: 87vh !important;
overflow: scroll;
}
@ -268,7 +268,7 @@ font-size: 15px;
}
.ivu-modal-body{
max-height: 100vh !important;
min-height: 300px;
min-height: 87vh !important;
overflow: scroll;
}
@ -281,8 +281,8 @@ font-size: 15px;
height:100vh
}
.ivu-modal-body{
max-height: 80vh !important;
min-height: 300px;
max-height: 87vh !important;
min-height: 87vh !important;
overflow: scroll;
}
@ -304,7 +304,7 @@ font-size: 15px;
.el-form-item{
flex-shrink: 0;
flex-basis: 50%;
margin-bottom:0
margin-bottom:5px
}
.el-form-item__error{
display: none;

@ -0,0 +1,195 @@
<template>
<div class="chartWrap"
:style="{ width: width, height: height,'textAlign':'center',lineHeight: height,color:'#909399'}">
<div v-if="showChart" ref="mybar"></div>
<div v-else></div>
</div>
</template>
<script>
import * as echarts from 'echarts'
require('echarts/theme/macarons')
import resize from './mixins/resize'
const animationDuration = 6000
export default {
mixins: [resize],
props: {
//
data: {
type: Object,
default: () => {},
},
//
width: {
type: String,
default: "100%",
},
//
height: {
type: String,
default: "350px",
},
//
axisPointerType:{
type: String,
default: "shadow",
},
//
colors: {
type: Array,
default: () => {
return [
"#5470c6",
"#91cc75",
"#fac858",
"#ee6666",
"#73c0de",
"#3ba272",
"#fc8452",
"#9a60b4",
"#ea7ccc",
];
},
},
},
data() {
return {
myChart: "",
showChart: true
};
},
watch: {
data: {
//
handler() {
this.initChart(this.$refs.mybar, this.data);
},
deep: true,
},
},
computed: {},
created() {},
mounted() {
//
this.initChart(this.$refs.mybar, this.data);
},
methods: {
initChart(dom, currentData) {
if (Object.keys(currentData).length == 0) {
console.log("123")
this.showChart = false
return
}
//
if (
this.myChart != null &&
this.myChart != "" &&
this.myChart != undefined
) {
this.myChart.dispose(); //
}
// this.myChart = this.$echarts.init(dom);
this.myChart = echarts.init(this.$el, 'macarons')
let option = this.option(currentData);
this.myChart.setOption(option);
},
option(currentData) {
let seriesList = currentData.list.map((item) => {
return {
name: item.name || "",
type: item.type || "line", //线
data: item.data,
};
});
// echarts
return {
grid: {
left: '20',
right: '20',
top: '40',
bottom: '20',
containLabel: true
},
color: this.colors, //
legend: {},
tooltip: { //
trigger: "axis",
formatter: '{b}<br/>{a0}:{c0}<br/>{a1}:{c1}<br/>{a2}:{c2}', //
axisPointer: {
type: this.axisPointerType,
},
textStyle: { //
align: 'left'
}
},
itemStyle: {
borderRadius: [5, 5, 0, 0],
},
xAxis: {
type: "category",
data: currentData.x, //
splitArea: false,
splitLine: false,
axisLine: {
show: true,
lineStyle: {
color: "#338de3", //x线
width: 1,
type: "solid",
},
},
axisTick: {
show: false,
},
toolbox: {},
axisLabel: {
interval: 0,
// rotate:50,
show: true,
splitNumber: 15,
textStyle: {
color: "rgba(122,122,122,1)",
fontSize: "14",
},
},
},
yAxis: {
type: "value",
splitArea: false,
splitLine: false,
// name: currentData.list[0].unit, //
axisLabel: {
formatter: "{value}", //
show: true,
textStyle: {
color: "rgba(122,122,122,1)",
fontSize: "12",
},
},
axisLine: {
show: true,
lineStyle: {
color: "#338de3", //y线
width: 1,
type: "solid",
},
},
// interval: 0
},
series: seriesList, //
};
},
},
};
</script>
<style>
.chartWrap {
background-color: #fff;
}
</style>

@ -0,0 +1,55 @@
import { debounce } from '@/utils'
export default {
data() {
return {
$_sidebarElm: null,
$_resizeHandler: null
}
},
mounted() {
this.$_resizeHandler = debounce(() => {
if (this.chart) {
this.chart.resize()
}
}, 100)
this.$_initResizeEvent()
this.$_initSidebarResizeEvent()
},
beforeDestroy() {
this.$_destroyResizeEvent()
this.$_destroySidebarResizeEvent()
},
// to fixed bug when cached by keep-alive
// https://github.com/PanJiaChen/vue-element-admin/issues/2116
activated() {
this.$_initResizeEvent()
this.$_initSidebarResizeEvent()
},
deactivated() {
this.$_destroyResizeEvent()
this.$_destroySidebarResizeEvent()
},
methods: {
// use $_ for mixins properties
// https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
$_initResizeEvent() {
window.addEventListener('resize', this.$_resizeHandler)
},
$_destroyResizeEvent() {
window.removeEventListener('resize', this.$_resizeHandler)
},
$_sidebarResizeHandler(e) {
if (e.propertyName === 'width') {
this.$_resizeHandler()
}
},
$_initSidebarResizeEvent() {
this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
},
$_destroySidebarResizeEvent() {
this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
}
}
}

@ -115,3 +115,15 @@ export function param2Obj(url) {
})
return obj
}
//防抖
export function debounce(fn,delay=500){
let timer = null
return function _debounce() {
if (timer) clearTimeout(timer)
timer = setTimeout(() => {
fn()
}, delay)
}
}

@ -1,53 +1,290 @@
<template>
<div class="container">
<!-- 查询配置 -->
<div style="padding: 0px 20px">
<div style="padding: 0px 20px 20px 20px;background: #EFF2F9;">
<el-row :gutter="20" class='elrows'>
<el-col :span="12">
<div ref="lxTable" class="table-tree">
<div style="padding: 15px;background-color: #fff;display: flex;align-items: center;" class="form-sub-title">
<el-link type="primary" style="font-size:18px;margin-right:5px" href="/admin/#/lawsfile/index/article_1">最新动态</el-link>
<p class="no-redirect">浏览最近上传的文件</p>
</div>
<el-table :data="tableData" stripe class="v-table" height="300px" style="width: 100%">
<el-table-column :prop="column.field" :fixed="column.fixed" :align="column.align"
v-for="(column,index) in lawcolumns" :label="column.title" :width="column.width">
<template slot-scope="scope">
<div v-if="column.type=='opt'">
<Button ghost size="small" @click="show(scope.row)" type="primary"
style="margin-left: 10px;">查看</Button>
</div>
<div v-else-if="column.type=='menu'">
{{scope.row.menu?scope.row.menu.name:"无"}}
</div>
<div v-else-if="column.type=='date'">
{{scope.row[column.field]?scope.row[column.field].substring(0,16):""}}
</div>
<div v-else>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table>
</div>
</el-col>
</el-col>
<el-col :span="12">
<div ref="lxTable" class="table-tree">
<div style="padding: 15px;background-color: #fff;" class="form-sub-title">
<el-link type="primary" style="font-size:18px" href="/admin/#/lawsfile/index/article_2">安全之窗</el-link>
<p class="no-redirect"></p>
</div>
<el-table :data="lawData" stripe class="v-table" height="300px" style="width: 100%">
<el-table-column :prop="column.field" :fixed="column.fixed" :align="column.align"
v-for="(column,index) in lawcolumns" :label="column.title" :width="column.width">
<template slot-scope="scope">
<div v-if="column.type=='opt'">
<Button ghost size="small" @click="show(scope.row)" type="primary"
style="margin-left: 10px;">查看</Button>
</div>
<div v-else-if="column.type=='menu'">
{{scope.row.menu?scope.row.menu.name:"无"}}
</div>
<div v-else-if="column.type=='date'">
{{scope.row[column.field]?scope.row[column.field].substring(0,16):""}}
</div>
<div v-else>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table>
</div>
</el-col>
<el-col :span="24">
<div ref="lxTable" stripe class="table-tree">
<div style="padding: 15px;background-color: #fff;padding-bottom:5px;" class="form-sub-title">
<el-link type="primary" href="#/lawsfile/articleview" style="font-size:18px">待办事项</el-link>
</div>
<div style="height:370px;background-color: #fff;padding: 15px;padding-top:0">
<el-tabs v-model="daliyName">
<el-tab-pane name="first">
<span slot="label">
我的审批
<el-badge :value="auditTotal" class="item"></el-badge>
</span>
<div style="height:310px">
<el-table :data="auditList" style="width: 100%" class='v-table' border height='300px'>
<el-table-column v-for="item in missionTable" :label="item.label" :fixed='item.fixed' :align='item.align'
:width='item.width' :prop="item.prop">
<template slot-scope="scope">
<span v-if="item.formatter">
{{item.formatter(scope.row,scope.row,scope.row[item.prop])}}
</span>
<div v-else-if='item.customFn'>
<div style="white-space: normal;text-align: left;">
<div v-if="scope.row.accept_department_detail.length>0">
<span v-for="department in scope.row.accept_department_detail">
<el-tag v-if="department.detail"
style="margin-right: 5px;margin-bottom: 2px;">{{department.department.name}}</el-tag>
<el-tag v-else type='info'
style="margin-right: 5px;margin-bottom: 2px;">{{department.department.name}}</el-tag>
</span>
</div>
<div v-if="scope.row.accept_admin_detail.length>0">
<span v-for="admin in scope.row.accept_admin_detail">
<el-tag v-if="admin.detail"
style="margin-right: 5px;margin-bottom: 2px;">{{admin.admin.name}}</el-tag>
<el-tag v-else type='info'
style="margin-right: 5px;margin-bottom: 2px;">{{admin.admin.name}}</el-tag>
</span>
</div>
<div v-if="scope.row.groups.length>0">
<div v-for="group in scope.row.groups">
{{group.name}}:
<span v-if="group.type==1">
<span v-for="detail in scope.row.grounp_admin_detail">
<el-tag v-if="detail.istrue"
style="margin-right: 5px;margin-bottom: 2px;">{{detail.admin.name}}</el-tag>
<el-tag v-else type='info'
style="margin-right: 5px;margin-bottom: 2px;">{{detail.admin.name}}</el-tag>
</span>
</span>
<span v-if="group.type==2">
<span v-for="detail in scope.row.grounp_department_detail">
<el-tag v-if="detail.istrue"
style="margin-right: 5px;margin-bottom: 2px;">{{detail.department.name}}</el-tag>
<el-tag v-else type='info'
style="margin-right: 5px;margin-bottom: 2px;">{{detail.department.name}}</el-tag>
</span>
</span>
</div>
</div>
</div>
</div>
<span v-else>
<!-- {{(item.prop.indexOf(".")>-1?scope.row[item.prop.split(".")[0]][item.prop.split(".")[1]]:scope.row[item.prop]}} -->
{{item.prop.indexOf(".")>-1?(scope.row[item.prop.split(".")[0]]?scope.row[item.prop.split(".")[0]][item.prop.split(".")[1]]:''):scope.row[item.prop]}}
</span>
</template>
</el-table-column>
<el-table-column fixed="right" align='center' label="操作" width="180" header-align="center">
<template slot-scope="scope">
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small" @click="checkUnits(scope.row.id,'check')"></Button>
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
<el-tab-pane name="second">
<span slot="label">
我的任务
<el-badge :value="myselfTotal" class="item"></el-badge>
</span>
<div style="height:310px">
<el-table :data="myselfList" style="width: 100%" class='v-table' border height='300px'>
<el-table-column v-for="item in missionTable" :label="item.label" :fixed='item.fixed' :align='item.align'
:width='item.width' :prop="item.prop">
<template slot-scope="scope">
<span v-if="item.formatter">
{{item.formatter(scope.row,scope.row,scope.row[item.prop])}}
</span>
<div v-else-if='item.customFn'>
<div style="white-space: normal;text-align: left;">
<div v-if="scope.row.accept_department_detail.length>0">
<span v-for="department in scope.row.accept_department_detail">
<el-tag v-if="department.detail"
style="margin-right: 5px;margin-bottom: 2px;">{{department.department.name}}</el-tag>
<el-tag v-else type='info'
style="margin-right: 5px;margin-bottom: 2px;">{{department.department.name}}</el-tag>
</span>
</div>
<div v-if="scope.row.accept_admin_detail.length>0">
<span v-for="admin in scope.row.accept_admin_detail">
<el-tag v-if="admin.detail"
style="margin-right: 5px;margin-bottom: 2px;">{{admin.admin.name}}</el-tag>
<el-tag v-else type='info'
style="margin-right: 5px;margin-bottom: 2px;">{{admin.admin.name}}</el-tag>
</span>
</div>
<div v-if="scope.row.groups.length>0">
<div v-for="group in scope.row.groups">
{{group.name}}:
<span v-if="group.type==1">
<span v-for="detail in scope.row.grounp_admin_detail">
<el-tag v-if="detail.istrue"
style="margin-right: 5px;margin-bottom: 2px;">{{detail.admin.name}}</el-tag>
<el-tag v-else type='info'
style="margin-right: 5px;margin-bottom: 2px;">{{detail.admin.name}}</el-tag>
</span>
</span>
<span v-if="group.type==2">
<span v-for="detail in scope.row.grounp_department_detail">
<el-tag v-if="detail.istrue"
style="margin-right: 5px;margin-bottom: 2px;">{{detail.department.name}}</el-tag>
<el-tag v-else type='info'
style="margin-right: 5px;margin-bottom: 2px;">{{detail.department.name}}</el-tag>
</span>
</span>
</div>
</div>
</div>
</div>
<span v-else>
<!-- {{(item.prop.indexOf(".")>-1?scope.row[item.prop.split(".")[0]][item.prop.split(".")[1]]:scope.row[item.prop]}} -->
{{item.prop.indexOf(".")>-1?(scope.row[item.prop.split(".")[0]]?scope.row[item.prop.split(".")[0]][item.prop.split(".")[1]]:''):scope.row[item.prop]}}
</span>
</template>
</el-table-column>
<el-table-column fixed="right" align='center' label="操作" width="180" header-align="center">
<template slot-scope="scope">
<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>
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
<!-- <el-tab-pane name="third">
<span slot="label">
检查整改
<el-badge :value="patrolTotal" class="item"></el-badge>
</span>
<div>
<xy-table
:list="patrolList"
:table-item="patrolTable"
:isPage="false"
:height='300'>
<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>
</template>
</el-table-column>
</template>
</xy-table>
</div>
</el-tab-pane> -->
</el-tabs>
</div>
<div ref="lxTable" class="table-tree">
<div style="padding: 15px;background-color: #fff;" class="form-sub-title">
<el-link type="primary" style="font-size:18px" href="#/lawsfile/article">最近上传</el-link>
<p class="no-redirect">浏览最近上传的文件</p>
</div>
<el-table :data="tableData" class="v-table" height="300px" style="width: 100%">
<el-table-column :prop="column.field" :fixed="column.fixed" :align="column.align"
v-for="(column,index) in lawcolumns" :label="column.title" :width="column.width">
<template slot-scope="scope">
<div v-if="column.type=='opt'">
<Button ghost size="small" @click="show(scope.row)" type="primary"
style="margin-left: 10px;">查看</Button>
</div>
<div v-else-if="column.type=='menu'">
{{scope.row.menu?scope.row.menu.name:"无"}}
</div>
<div v-else>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table>
</div>
<!-- <el-table :data="dailytableData" stripe class="v-table" height="300px" style="width: 100%">
<el-table-column :prop="column.field" :fixed="column.fixed" :align="column.align"
v-for="(column,index) in dailycolumns" :label="column.title" :width="column.width">
<template slot-scope="scope">
<div v-if="column.type=='opt'">
<Button ghost size="small" @click="showdaily(scope.row)" type="primary"
style="margin-left: 10px;">查看</Button>
</div>
<div v-else-if="column.type=='date'">
{{scope.row[column.field]?scope.row[column.field].substring(0,16):""}}
</div>
<div v-else-if="column.type=='status'">
{{scope.row.is_read===1?"已查看":"待阅读"}}
</div>
<div v-else>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table> -->
</div>
</el-col>
<el-col :span="12">
<div ref="lxTable" class="table-tree">
<div style="padding: 15px;background-color: #fff;" class="form-sub-title">
<el-link type="primary" style="font-size:18px" href="#/lawsfile/article">任务进展</el-link>
<p class="no-redirect"></p>
</div>
<myecharts :data="mission_data" :axisPointerType="'line'"></myecharts>
</div>
</el-col>
<el-col :span="12">
<div ref="lxTable" class="table-tree">
<div style="padding: 15px;background-color: #fff;" class="form-sub-title">
<el-link type="primary" style="font-size:18px" href="#/lawsfile/article">检查整改</el-link>
<p class="no-redirect"></p>
</div>
<myecharts :data="inspection_data"></myecharts>
</div>
</el-col>
</el-row>
<checkUnit ref='checkUnit' @refresh='getAuditList'></checkUnit>
<addPatrol ref='addPatrol' @refresh='getMyselfList'></addPatrol>
<showPatrol ref='showPatrol' @refresh='getPatrolList'></showPatrol>
<!--内容查看-->
<viewInfo ref="viewInfo"></viewInfo>
<div ref="lxTable" class="table-tree" style="margin-top:15px">
<div style="padding: 15px;background-color: #fff;" class="form-sub-title">
<el-link type="primary" href="#/lawsfile/articleview" style="font-size:18px">待办事项</el-link>
</div>
<el-table :data="dailytableData" class="v-table" height="300px" style="width: 100%">
<el-table-column :prop="column.field" :fixed="column.fixed" :align="column.align"
v-for="(column,index) in dailycolumns" :label="column.title" :width="column.width">
<template slot-scope="scope">
<div v-if="column.type=='opt'">
<Button ghost size="small" @click="showdaily(scope.row)" type="primary"
style="margin-left: 10px;">查看</Button>
</div>
<div v-else-if="column.type=='status'">
{{scope.row.is_read===1?"已查看":"待阅读"}}
</div>
<div v-else>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog title="待办事项内容查看" :visible.sync="dialogDailyViewVisible" fullscreen>
<div class="dialogConcent" :style="{height:clientHeight+'px'}">
@ -96,6 +333,7 @@
} from '@/utils/auth';
import LxHeader from "@/components/LxHeader/index.vue";
import Tinymce from '@/components/Tinymce';
import myecharts from '@/components/myecharts';
import viewInfo from '../lawsfile/index/components/viewInfo.vue'
import {
listarticle,
@ -104,7 +342,16 @@
import {
getdaily,
listtask
} from "../../api/daily/index.js";
} from "../../api/daily/index.js";
import {
listunit
} from '@/api/task/unit.js'
import {
listpatrol
} from '@/api/task/patrol.js'
import checkUnit from '@/views/task/list/components/checkUnit.vue'
import addPatrol from '@/views/task/list/components/addPatrol.vue'
import showPatrol from '@/views/task/list/components/showPatrol.vue'
export default {
name: 'Dashboard',
computed: {
@ -116,7 +363,11 @@
components: {
LxHeader,
Tinymce,
viewInfo
viewInfo,
myecharts,
checkUnit,
addPatrol,
showPatrol
},
data() {
return {
@ -128,8 +379,21 @@
dialogDailyViewVisible: false,
tableHeight: 0,
clientHeight: 0,
tableData: [],
tableData: [],
daliyName: 'first',
auditList:[],
myselfList:[],
patrolList:[],
auditTotal:0,
myselfTotal:0,
patrolTotal:0,
dailytableData: [],
lawData: [],
dangerData: [],
yearData: [],
mission_data: {},
inspection_data: {},
formLabelWidth: "120px",
lawform: {
title: "",
@ -145,19 +409,212 @@
end_date: "",
department_list: [],
daterange: null
},
},
missionTable: [{
label: "标题",
prop: 'name',
align: 'left',
fixed:'left',
width: 240
}, {
label: "状态",
prop: 'audit_status',
width: 180,
formatter: (cell, data, value, index) => {
return value == 1 ? '开展中' : (value == 2 ? '不通过' : (value == 0 ? '待审核' : ''))
}
},{
label: "开始日期",
prop: 'start_date',
width: 180,
}, {
label: "结束日期",
prop: 'end_date',
width: 180,
}, {
label: "任务类型",
prop: 'type',
width: 180,
formatter: (cell, data, value, index) => {
return value == 1 ? '专项任务' : (value == 2 ? '文件学习培训' : (value == 3 ? '事件隐患任务' : (value == 4 ? '科室任务' : '')))
}
}, {
label: "任务类别",
prop: 'unit_type',
width: 180,
formatter: (cell, data, value, index) => {
return value == 1 ? '专项检查' : (value == 2 ? '资料收集' : (value == 3 ? '网络安全' : ''))
}
}, {
label: "完成要求",
prop: 'end_type',
width: 180,
formatter: (cell, data, value, index) => {
return value == 1 ? '提交文字' : (value == 2 ? '提交附件' : (value == 3 ? '提交文字与附件' : ''))
}
}, {
label: "参与人员",
prop: '_names',
width: 360,
algn: 'left',
customFn: (row) => {
}
}],
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:'待领导确认整改'
}],
patrolTable:[{
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,
}],
lawcolumns: [{
field: "created_at",
title: "日期",
type: "string",
width: 200,
type: "date",
width: 170,
align: "center"
},
{
field: "menu",
title: "栏目",
type: "menu",
width: 200,
width: 140,
align: "center"
},
{
@ -168,14 +625,14 @@
{
field: "操作",
title: "操作",
width: 220,
width: 120,
type: "opt",
}
],
dailycolumns: [{
field: "start_date",
title: "开始时间",
type: "string",
type: "date",
align: "center",
width: 200,
},
@ -183,7 +640,7 @@
field: "end_date",
title: "结束时间",
align: "center",
type: "string",
type: "date",
width: 200,
},
{
@ -207,6 +664,8 @@
created() {
this.uploadOther.token = getToken();
// this.initLoad();
this.getInspectionData()
this.getMissionData()
this.load();
},
@ -219,31 +678,140 @@
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
},
checkUnits(id,type){
this.$refs.checkUnit.id = id
this.$refs.checkUnit.type = type
this.$refs.checkUnit.isShow = true
},
load() {
listarticle({
page: this.paginations.page,
page_size: this.paginations.page_size
}).then(res => {
this.tableData = res.data;
getInspectionData() {
let objs = this.randomMonth()
this.inspection_data = {
x: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
list: [{
name: "合计",
data: objs.data1,
type: 'bar',
unit: "件"
}, {
name: "已完成",
data: objs.data2,
type: 'bar',
unit: "件"
}, {
name: "未完成",
data: objs.data3,
type: 'bar',
unit: "件"
}]
}
},
getMissionData() {
let objs = this.randomMonth()
this.mission_data = {
x: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
list: [{
name: "开展中",
data: objs.data1,
type: 'line',
unit: "件"
}, {
name: "已完成",
data: objs.data2,
type: 'line',
unit: "件"
}, {
name: "未完成",
data: objs.data3,
type: 'line',
unit: "件"
}]
}
},
randomMonth() {
let months = 12
let obj = {
data1: [],
data2: [],
data3: [],
}
for (var i = 0; i < months; i++) {
obj.data1.push(Math.floor(Math.random() * 11) + 10)
obj.data2.push(Math.floor(Math.random() * 9) + 1)
obj.data3[i] = obj.data1[i] - obj.data2[i]
}
return obj
},
load() {
let that = this
listarticle(
that.paginations.page, '', '', that.paginations
.page_size, 2
).then(res => {
this.lawData = res.data;
}).catch(error => {
});
listtask({
page: this.paginations.page,
page_size: this.paginations.page_size,
show_self: 1
}).then(response => {
this.dailytableData = response.data;
});
listarticle(
that.paginations.page, '', '', that.paginations
.page_size, 1
).then(res => {
this.tableData = res.data;
}).catch(error => {
});
this.getAuditList()
this.getMyselfList()
this.getPatrolList()
// listtask({
// page: this.paginations.page,
// page_size: this.paginations.page_size,
// show_self: 1
// }).then(response => {
// this.dailytableData = response.data;
}).catch(error => {
console.log(error)
reject(error)
})
// }).catch(error => {
// console.log(error)
// reject(error)
// })
},
getAuditList(){
//
listunit({
page:1,
page_size:5,
myself_audit:1,
audit_status:0
}).then(res=>{
this.auditList = res.data
this.auditTotal = res.total
})
},
getMyselfList(){
//
listunit({
page:1,
page_size:5,
myself:1,
audit_status:1
}).then(res=>{
this.myselfList = res.data
this.myselfTotal = res.total
})
},
//
getPatrolList(){
listpatrol({
page:1,
page_size:5,
myself:1
}).then(res=>{
this.patrolList = res.data
this.patrolTotal = res.total
})
},
show(obj) {
this.$refs.viewInfo.dialogViewVisible = true;
this.$refs.viewInfo.getinfo(obj.id);
@ -294,7 +862,23 @@
}
</script>
<style lang="scss">
<style lang="scss" scoped>
::v-deep .elrows {
.el-col {
padding: 10px !important
}
}
.index_top {
display: flex;
justify-content: space-between;
&>div {
width: 49.5%
}
}
.dashboard {
&-container {
margin: 30px;

@ -0,0 +1,448 @@
<template class="choose_wrap">
<div>
<!-- <div class="choose" @click="qsShow = true"> </div> -->
<el-drawer
title="添加题目"
:visible.sync="qsShow"
:modal="true"
:show-close='false'
size="99%"
>
<template v-slot:title>
<div style='font-size: 20px;margin-bottom: 10px;display: flex;justify-content: space-between;'>
<span>添加题目</span>
<span><i @click="closeQs" class="el-icon-close"></i></span>
</div>
<div style="border-bottom: 1px #ccc solid; margin-bottom: 20px;text-align: left;">
<el-button
type="primary"
class="from_btn"
@click="addTopic('select')"
>新增选择题</el-button
>
<el-button
type="primary"
class="from_btn"
@click="addTopic('short')"
>新增简答题</el-button
>
</div>
</template>
<div class="dialog_height" :style="{'height':dialog_height+'px'}">
<div class="from_box" v-for="(item, index) in topicList" :key="index">
<el-form
:model="item.qsForm"
ref="qsForm"
label-width="100px"
class="demo-dynamic"
>
<el-form-item
prop="title"
label="题目"
:rules="[
{
required: true,
message: '请输入题目',
trigger: 'blur',
},
]"
>
<el-input
type="textarea"
v-model="item.qsForm.title"
style="width: 320px"
></el-input>
</el-form-item>
<template v-if="item.qsForm.type=='select'">
<el-form-item
v-for="(domain, index) in item.qsForm.domains"
:label="sortList[index]"
:key="domain.key"
:prop="'domains.' + index + '.value'"
:rules="{
required: true,
message: '选项不能为空',
trigger: 'blur',
}"
>
<el-input
v-model="domain.value"
style="width: 320px; margin-right: 10px"
></el-input
><el-button
@click.prevent="removeDomain1(domain, item)"
icon="el-icon-delete"
></el-button>
</el-form-item>
<el-form-item
prop="answer"
label="正确答案"
:rules="[
{
required: true,
message: '请输入正确答案',
trigger: 'change',
},
]"
>
<el-select
v-model="item.qsForm.answer"
placeholder="请选择"
clearable
multiple
style="width: 320px"
>
<el-option
v-for="i in item.qsForm.sortListfor"
:key="i"
:label="i"
:value="i"
>
</el-option>
</el-select>
</el-form-item>
</template>
<el-form-item>
<el-button
v-if="item.qsForm.type=='select'"
type="primary"
@click="addDomain1(item)"
>新增选项</el-button>
<el-button
type="danger"
@click="remove_dom(item)"
>删除题目</el-button
>
</el-form-item>
</el-form>
</div>
</div>
<div class="dialog-footer">
<el-button @click="closeQs"> </el-button>
<el-button type="primary" @click="submitForm('qsForm')"
> </el-button
>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
//dialogType
props: ["dialogType"],
data() {
return {
qsShow: false,
dialog_height:0,
//
topicList: [
{
//
key: Date.now(),
//
qsForm: {
//
domains: [
{
id: "A",
value: "",
},
{
id: "B",
value: "",
},
{
id: "C",
value: "",
},
],
//
title: "",
//
answer: [],
//
sortListfor: ["A", "B", "C"],
//
type: 'select',
type_name:''
},
},
],
//id
uid: "",
//
sortList: ["A", "B", "C", "D", "E", "F", "G", "H"],
};
},
created() {
this.initHeight()
},
methods: {
initHeight(){
let clientHeight = document.documentElement.clientHeight;
let titleHeight = 136
let footerHeight = 60
this.dialog_height =clientHeight-titleHeight - footerHeight - 30;
console.log(clientHeight,this.dialog_height)
},
closeQs(){
this.qsShow=false
this.topicList=[
{
//
key: Date.now(),
//
qsForm: {
//
domains: [
{
id: "A",
value: "",
},
{
id: "B",
value: "",
},
{
id: "C",
value: "",
},
],
//
title: "",
//
answer: [],
//
sortListfor: ["A", "B", "C"],
//
type: 'select',
type_name:''
},
},
]
},
//
addDomain1(item) {
//item
//
let index = this.topicList.indexOf(item);
//
let listLength =
this.topicList[index].qsForm.domains.length + 1;
//6
if (listLength > 6) {
this.$message({
message: "答题选项最多设置6条",
type: "warning",
});
return;
} else {
//id
this.topicList[index].qsForm.domains.filter(
(item, index) => {
//id+1id
if (item.id == this.sortList[index]) {
this.uid = this.sortList[index + 1];
}
}
);
//
this.topicList[index].qsForm.sortListfor.push(
this.sortList[listLength - 1]
);
//idvalue
this.topicList[index].qsForm.domains.push({
id: this.uid,
value: "",
});
}
},
//arrindexid
delOne(arr, index) {
arr.splice(index, 1),
arr.forEach((ele, key) => {
ele.id = this.sortList[key];
});
return arr;
},
//
removeDomain1(i, item) {
//i
//item
//
let index = this.topicList.indexOf(item);
let listLength =
this.topicList[index].qsForm.domains.length - 1;
if (listLength < 2) {
this.$message({
message: "答题选项最少需要设置2条",
type: "warning",
});
return;
} else {
//
let indexs =
this.topicList[index].qsForm.domains.indexOf(i);
//
if (indexs !== -1) {
//
let L = this.topicList[index].qsForm.domains;
let v = this.delOne(L, indexs);
console.log("新数组:", v);
//
this.topicList[index].qsForm.answer = [];
//
this.topicList[index].qsForm.sortListfor.pop();
}
}
},
//
remove_dom(item) {
//,
let index = this.topicList.indexOf(item);
//-1
if (index !== -1) {
//
this.topicList.splice(index, 1);
}
},
//
addTopic(types) {
//
if(types=='select'){
this.topicList.push({
key: Date.now(),
qsForm: {
domains: [
{
id: "A",
value: "",
},
{
id: "B",
value: "",
},
{
id: "C",
value: "",
},
],
title: "",
answer: [],
sortListfor: ["A", "B", "C"],
type:'select',
type_name:''
},
});
}else if(types=='short'){
this.topicList.push({
key: Date.now(),
qsForm: {
domains: [],
title: "",
answer: [],
sortListfor: [],
type:'short',
type_name:''
},
});
}
},
//
submitForm(formName) {
//
let n = 0;
//
this.topicList.forEach((item, index) => {
//formNamerefdom
//htmlrules
this.$refs[formName][index].validate((valid) => {
if (valid) {
//n+1,
n++;
//n
if (n == this.topicList.length) {
//
//type
this.topicList.forEach(i=>{
if(i.qsForm.type=='select'){
i.qsForm.type_name=i.qsForm.answer.length>1?"多选题":"单选题"
}else if(i.qsForm.type=='short'){
i.qsForm.type_name = '简答题'
}
})
this.$emit('submitQs',this.topicList)
this.qsShow = false
console.log(this.topicList);
}
} else {
console.log("error submit!!");
return false;
}
});
});
},
},
};
</script>
<style scoped lang='scss'>
::v-deep .el-drawer__wrapper{
padding:20px 0;
padding-right:10px;
}
::v-deep .el-drawer__header{
display: block!important;
margin-bottom:0
}
.choose {
width: 300px;
height: 200px;
margin: auto;
margin-top: 180px;
text-align: center;
line-height: 200px;
font-size: 38px;
color: #fff;
font-weight: bold;
border-radius: 30px;
cursor: pointer;
background-image: linear-gradient(#32cbc6, #2d94a7);
margin-bottom: 25px;
box-shadow: 0px 0px 15px 5px #97d9e1;
}
.choose:hover {
background-image: linear-gradient(#0093e9, #2d94a7);
box-shadow: 0px 0px 15px 5px #0093e9;
}
.from_box {
border-bottom: 1px #ccc solid;
margin-bottom: 20px;
}
.el-form-item{
margin-bottom:10px;
}
.from_btn {
margin-left: 10px;
margin-bottom: 10px;
}
.dialog_height {
/* height: 430px; */
overflow: auto;
}
.dialog-footer{
position: fixed;
bottom: 35px;
right: 20px;
}
</style>
<style >
.choose_wrap .el-dialog {
border-radius: 20px;
}
</style>

@ -104,23 +104,29 @@
<template v-slot:end_type>
<div class="xy-table-item">
<div class="xy-table-item-label" style="width:140px">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>任务完成要求
</div>
<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'>
<el-select 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-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>
<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>
</template>
<template v-slot:end_content>
<div class="xy-table-item">
<div class="xy-table-item-label" style="width:140px">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>任务完成详情
<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
<el-input v-model="form.end_content" :rows='5' type='textarea' placeholder="请输入完成详情" clearable
style="width: 400px;"></el-input>
</div>
</div>
@ -128,7 +134,7 @@
<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>用户类型选择
<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'>
@ -169,7 +175,7 @@
</div>
</template>
<template v-slot:mission_groups v-if='form.name7==3&&form.type!=4'>
<template v-slot:mission_groups 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>
@ -200,13 +206,18 @@
</div>
</div>
</template>
<!-- 答题 -->
<template v-slot:is_need_answer v-if="mission_type==2&&form.end_type==5">
</template>
</xy-dialog>
</xy-dialog>
<addQuestion ref='addQuestion' @submitQs="submitQs"></addQuestion>
</div>
</template>
@ -230,16 +241,19 @@
} from "@/api/common.js"
import {
getToken
} from '@/utils/auth'
} from '@/utils/auth'
import addQuestion from './addQuestion.vue'
export default {
components: {
addQuestion
},
data() {
return {
isShow: false,
type: 'add',
id: '',
type: 'add',
mission_type:'',
id: '',
department_id:'',
uploadOther: {
token: ""
},
@ -271,6 +285,13 @@
}, {
id: 3,
name: '提交文字与附件'
}],
studyEndTypeList:[{
id: 4,
name: '查看即可'
}, {
id: 5,
name: '需要答题'
}],
form: {
type: '',
@ -290,7 +311,8 @@
name7: 1,
accept_admin_ids: [],
accept_department_ids: [],
mission_groups: []
mission_groups: [],
is_need_answer:''
},
mission_groups_list: [{
name: '',
@ -319,15 +341,27 @@
}
},
created() {
this.uploadOther.token = getToken();
if (this.$route.path) {
let path = this.$route.path.split("_")
this.form.type = path[1]
this.uploadOther.token = getToken();
if(this.mission_type){
this.form.type = 2
}else{
if (this.$route.path) {
let path = this.$route.path.split("_")
this.form.type = path[1]
}
}
this.loadDeptOptions()
this.loadUser()
// this.loadUser()
},
methods: {
methods: {
openQs(){
this.$refs.addQuestion.qsShow=true
this.$refs.addQuestion.topicList = []
},
submitQs(e){
console.log("e",e)
},
changeName7(e) {
if (e) {
this.form.accept_department_ids = []
@ -361,7 +395,8 @@
},
loadUser() {
listCommonuser({
page_size: 999
page_size: 999,
department_id:this.department_id
}).
then((res) => {
this.userdata = res.data ? res.data.reverse() : [];
@ -427,7 +462,8 @@
.groups.length > 0 ? 3 : 1)),
accept_admin_ids: res?.accept_admin_ids,
accept_department_ids: res?.accept_department_ids,
mission_groups: res?.groups
mission_groups: res?.groups,
is_need_answer:'',
}
this.mission_groups_list = []
for (var g of res.groups) {
@ -533,7 +569,8 @@
},
watch: {
isShow(newVal) {
if (newVal) {
if (newVal) {
this.loadUser()
if (this.type === 'editor') {
this.getDetail()
}
@ -544,10 +581,12 @@
name: '',
type: 1,
link_id: []
}]
}]
this.department_id = ''
this.mission_type = ''
this.$refs['dialog'].reset()
}
}
},
}
}

@ -44,7 +44,7 @@
<template slot="label">
审批人
</template>
{{showform.audit_admin_id?showform.audit_admin_id:''}}
{{showform.audit_admin?showform.audit_admin.name:''}}
</el-descriptions-item>
<el-descriptions-item span='2'>
<template slot="label">
@ -78,7 +78,7 @@
</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'>
@ -104,19 +104,20 @@
<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>
@ -303,7 +304,8 @@
::v-deep .name7,::v-deep .content,
::v-deep .end_type,
::v-deep .file_ids,
::v-deep .mission_name{
::v-deep .mission_name,
::v-deep .audit_status{
flex-basis: 100%;
}

@ -21,6 +21,12 @@
任务专题
</template>
{{showform.mission?showform.mission.name:''}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
状态
</template>
{{showform.status_name?showform.status_name:''}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
@ -28,17 +34,18 @@
</template>
{{showform.admin?showform.admin.name:''}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
状态
</template>
{{showform.status_name?showform.status_name:''}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
检查日期
</template>
{{showform.date}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
问题类型
</template>
{{showform.ask?showform.ask.value:''}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
@ -46,12 +53,7 @@
</template>
{{showform.site?showform.site.name:(showform.address?showform.address:'')}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
问题类型
</template>
{{showform.ask?showform.ask.value:''}}
</el-descriptions-item>
<el-descriptions-item span='4'>
<template slot="label">
问题描述
@ -121,7 +123,7 @@
</el-descriptions-item>
<el-descriptions-item span='4'>
<template slot="label">
用户类型
参与用户
</template>
<div v-if="showform.accept_admin_ids_details&&showform.accept_admin_ids_details.length>0">
<el-tag style='margin-right:10px' v-for='item in showform.accept_admin_ids_details'>
@ -297,7 +299,7 @@
</el-descriptions-item>
<el-descriptions-item span="4">
<template slot="label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>用户类型选择
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>参与用户选择
</template>
<div>
<el-radio-group v-model="form.name7" @change='changeName7'>
@ -360,7 +362,7 @@
</el-descriptions-item>
<el-descriptions-item span="4">
<template slot="label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>用户类型选择
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>参与用户选择
</template>
<div>
<el-radio-group v-model="form.name7" @change='changeName7'>

@ -30,30 +30,10 @@
<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 type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="editorPatrol(scope.row.id,'editor')"></Button>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'check')"></Button>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'leader')"></Button>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'accept')"></Button>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'reform')"></Button>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'confirm')"></Button>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'leaderconfirm')"></Button -->
<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==0||scope.row.status==8" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'check')"></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==2" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'accept')"></Button> -->
<!-- <Button v-if="scope.row.status==3||scope.row.status==7" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'reform')"></Button> -->
<!-- <Button v-if="scope.row.status==4" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'confirm')"></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>
<!-- <Poptip
transfer
confirm
title="确认要删除吗?"
@on-ok="deleteList(scope.row.id)">
<Button type="primary" style="margin-right:5px;margin-bottom:5px;" size="small" ghost>删除</Button>
</Poptip> -->
</template>
</el-table-column>
</template>

@ -0,0 +1,521 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" :text="type_name" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Select v-if="path_type==1||path_type==5" filterable clearable style='width:150px;margin-right: 10px;' v-model="select.type" placeholder="任务类别">
<Option v-for="(item,index) in typeName" v-if="index<typeName.length-1" :value="item.type">{{item.name}}</Option>
</Select>
<Select filterable clearable style='width:150px;margin-right: 10px;' v-model="select.unit_type" placeholder="任务类型">
<Option v-for="(item,index) in unitTypeList" :value="item.id">{{item.value}}</Option>
</Select>
<Select filterable clearable style='width:150px;margin-right: 10px;' v-model="select.audit_status" placeholder="任务状态">
<Option v-for="item in auditStatusList" :value="item.id">{{item.value}}</Option>
</Select>
<el-date-picker @change="changeDate" v-model="select.dateRange" type="daterange"
:picker-options="pickerOptions" value-format="yyyy-MM-dd" range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" align="right">
</el-date-picker>
<Input v-model="select.keyword" style="width: 150px;margin-right: 10px;" placeholder="关键字搜索" />
<Button type="primary" @click="getList" style="margin-right: 10px;">查询</Button>
<Button v-if="path_type!=5" type="primary" style="margin-right: 10px;"
@click="$refs['addUnit'].mission_type=2,$refs['addUnit'].isShow=true,$refs['addUnit'].type='add'">添加</Button>
</div>
</slot>
</lx-header>
</div>
<el-table :data="list" style="width: 100%" class='v-table' border :height='tableHeight'>
<el-table-column type="index" align="center" fixed="left"></el-table-column>
<el-table-column type="expand">
<template slot-scope="props">
<div v-if="props.row.inspection.length>0">
<div align="left" v-for='(item,index) in props.row.inspection' class="expenditem">
<!-- <div> -->
<Button type="primary" style='margin-right:10px;' size="small"
@click="showPatrol(item.id,'show')">查看</Button>
<!-- </div> -->
{{index+1}}
<div v-for="(k,label) of inspectionTable">
<span class='label'>
{{label}}
</span>
<span v-if="k=='status'">
<template v-for='s in statusList'>
<span v-if="s.id==item[k]">
{{s.value}}
</span>
</template>
</span>
<span v-else>
<!-- {{k.indexOf(".")>-1?item[k.split(".")[0]][k.split(".")[1]]:item[k]}} -->
{{k.indexOf(".")>-1?(item[k.split(".")[0]]?item[k.split(".")[0]][k.split(".")[1]]:''):item[k]}}
</span>
</div>
</div>
</div>
<div v-else class="expenditem">
暂无检查问题
</div>
</template>
</el-table-column>
<el-table-column v-for="item in table" :label="item.label" :fixed='item.fixed' :align='item.align'
:width='item.width' :prop="item.prop">
<template slot-scope="scope">
<span v-if="item.formatter">
{{item.formatter(scope.row,scope.row,scope.row[item.prop])}}
</span>
<div v-else-if='item.customFn'>
<div style="white-space: normal;text-align: left;">
<div v-if="scope.row.accept_department_detail.length>0">
<span v-for="department in scope.row.accept_department_detail">
<el-tag v-if="department.detail"
style="margin-right: 5px;margin-bottom: 2px;">{{department.department.name}}</el-tag>
<el-tag v-else type='info'
style="margin-right: 5px;margin-bottom: 2px;">{{department.department.name}}</el-tag>
</span>
</div>
<div v-if="scope.row.accept_admin_detail.length>0">
<span v-for="admin in scope.row.accept_admin_detail">
<el-tag v-if="admin.detail"
style="margin-right: 5px;margin-bottom: 2px;">{{admin.admin.name}}</el-tag>
<el-tag v-else type='info'
style="margin-right: 5px;margin-bottom: 2px;">{{admin.admin.name}}</el-tag>
</span>
</div>
</div>
</div>
<span v-else>
<!-- {{(item.prop.indexOf(".")>-1?scope.row[item.prop.split(".")[0]][item.prop.split(".")[1]]:scope.row[item.prop]}} -->
{{item.prop.indexOf(".")>-1?(scope.row[item.prop.split(".")[0]]?scope.row[item.prop.split(".")[0]][item.prop.split(".")[1]]:''):scope.row[item.prop]}}
</span>
</template>
</el-table-column>
<el-table-column fixed="right" align='center' label="操作" width="180" header-align="center">
<template slot-scope="scope">
<div v-if="path_type==1">
<Button type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="editorUnit(scope.row.id,'editor')"></Button>
<Button v-if="scope.row.audit_admin_id==login_id&&scope.row.audit_status==0" style="margin-right:5px;margin-bottom:5px;" type="primary" size="small" @click="checkUnits(scope.row.id,'check')"></Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteList(scope.row.id)">
<Button type="primary" style="margin-right:5px;margin-bottom:5px;" size="small" ghost>删除</Button>
</Poptip>
</div>
<div v-else>
<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>
</div>
</template>
</el-table-column>
</el-table>
<Page :total="total" show-elevator show-sizer show-total :page-size='select.page_size' size='small'
@on-change='changePage' @on-page-size-change='changePageSize' />
<addUnit ref='addUnit' @refresh='getList'></addUnit>
<showPatrol ref='showPatrol'></showPatrol>
<addPatrol ref='addPatrol' @refresh='getList'></addPatrol>
<checkUnit ref='checkUnit' @refresh='getList'></checkUnit>
</div>
</template>
<script>
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 {
listunit,
del
} from '@/api/task/unit.js'
import {getUser} from "@/utils/auth";
export default {
components: {
addUnit,
showPatrol,
addPatrol,
checkUnit
},
data() {
return {
typeName: [{
type: 1,
name: '单位专项任务'
}, {
type: 2,
name: '文件学习培训'
}, {
type: 3,
name: '事件隐患任务'
}, {
type: 4,
name: '科室任务'
}, {
type: 5,
name: '我的任务'
}],
type_name: '',
tableHeight: 0,
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}]
},
select: {
keyword: '',
page: 1,
page_size: 10,
myself: 0,
myself_department: 0,
type: '',
unit_type: '',
audit_status:'',
dueDate:[],
start_date:'',
end_date:''
},
total: 0,
auditStatusList:[{
id:0,
value:'待审核'
},{
id:1,
value:'开展中'
},{
id:2,
value:'不通过'
}],
unitTypeList: [{
id: 1,
value: '专项检查'
}, {
id: 2,
value: '资料收集'
}, {
id: 3,
value: '网络安全'
}],
table: [{
label: "标题",
prop: 'name',
align: 'left',
// fixed:'left',
width: 240
}, {
label: "状态",
prop: 'audit_status',
width: 180,
formatter: (cell, data, value, index) => {
return value == 1 ? '通过' : (value == 2 ? '不通过' : (value == 0 ? '待审核' : ''))
}
},{
label: "开始日期",
prop: 'start_date',
width: 180,
}, {
label: "结束日期",
prop: 'end_date',
width: 180,
}, {
label: "任务类型",
prop: 'unit_type',
width: 180,
formatter: (cell, data, value, index) => {
return value == 1 ? '专项检查' : (value == 2 ? '资料收集' : (value == 3 ? '网络安全' : ''))
}
}, {
label: "完成要求",
prop: 'end_type',
width: 180,
formatter: (cell, data, value, index) => {
return value == 1 ? '提交文字' : (value == 2 ? '提交附件' : (value == 3 ? '提交文字与附件' : ''))
}
}, {
label: "参与用户",
prop: '_names',
width: 360,
algn: 'left',
customFn: (row) => {
// return ( <div style = {
// {
// whiteSpace: 'normal',
// textAlign: 'left'
// }
// }>
// {
// row._names.map(item => {
// return ( <el-tag style = {
// {
// marginRight: '5px',
// marginBottom: '2px'
// }
// }> {
// item
// } </el-tag>
// )
// })
// } </div>)
}
}],
inspectionTable: {
'巡查日期': 'date',
'状态': 'status',
'问题类型': 'ask.value',
'地点': 'site.name',
'上报人': 'admin.name',
},
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: '待领导确认整改'
}],
list: [],
path_type:1,
login_id:'',
department_id:'',
}
},
created() {
this.initHeight()
if (this.$route.path) {
let path = this.$route.path.split("_")
this.select.type = path[1]
this.path_type = path[1]
this.typeName.map(item => {
if (item.type == this.select.type) {
this.type_name = item.name
}
})
if(path[1]==6){
this.select.type = ''
this.select.myself = 1
this.select.myself_department = 1
this.type_name = '我的学习任务'
this.path_type = path[1]
}
}
this.getUserId()
this.getList()
},
watch: {},
methods: {
initHeight() {
var that = this;
var clientHeight = document.documentElement.clientHeight
var lxHeader_height = 96.5; //
var paginationHeight = 37; //
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
},
changeDate(e){
if(e){
this.select.start_date = e[0];
this.select.end_date = e[1];
}else{
this.select.start_date = "";
this.select.end_date = "";
}
},
async getUserId(){
let res = await getUser()
this.login_id = JSON.parse(res).id
this.department_id = JSON.parse(res).department_id
},
showPatrol(id, type) {
this.$refs.showPatrol.id = id
this.$refs.showPatrol.type = type
this.$refs.showPatrol.isShow = true
},
async getList() {
let res = await listunit({
...this.select
})
//
for(var r of res.data){
if(r.groups.length>0){
for(var g of r.groups){
if(g.type==1){
let is_index = 0
for(var a of r.grounp_admin_detail){
if(a.detail){
is_index++
}
}
if(is_index>0){
for(var a1 of r.grounp_admin_detail){
a1.istrue = true
}
}
}
if(g.type==2){
let is_index = 0
for(var d of r.grounp_department_detail){
if(d.detail){
is_index++
}
}
if(is_index>0){
for(var d1 of r.grounp_department_detail){
d1.istrue = true
}
}
}
}
}
}
this.list = res.data
this.total = res.total
},
changePage(e) {
this.select.page = e
this.getList()
},
changePageSize(e) {
this.select.page_size = e
this.getList()
},
editorUnit(id, type) {
this.$refs.addUnit.id = id
this.$refs.addUnit.type = type
this.$refs.addUnit.isShow = true
},
checkUnits(id,type){
this.$refs.checkUnit.id = id
this.$refs.checkUnit.type = type
this.$refs.checkUnit.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');
}
});
}
}
},
}
</script>
<style scoped>
/deep/ .el-icon-circle-close {
color: #fff
}
.expenditem {
display: flex;
font-size: 14px;
padding: 10px;
border-bottom: 1px solid #EBEEF5;
padding-left: 110px;
font-size: 16px;
}
.expenditem>div {
margin-right: 15px;
min-width: 200px;
}
.expenditem>div span.label {
color: #97a8be
}
/deep/ .el-table__expanded-cell .expenditem:last-child {
border-bottom: none;
}
/deep/ .ivu-page {
text-align: right;
padding: 15px;
}
/deep/ .el-range-editor.el-input__inner{
height: 32px;
line-height: 32px;
width: 250px;
margin-right:10px;
}
/deep/ .el-date-editor .el-range__icon,/deep/ .el-date-editor .el-range-separator,/deep/ .el-date-editor .el-range__close-icon{
line-height: 25px;
}
</style>

@ -3,14 +3,27 @@
<div ref="lxHeader">
<lx-header icon="md-apps" :text="type_name" 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" style="width: 200px;margin-right: 10px;" placeholder="关键字搜索" />
<Select filterable clearable style='width:200px;margin-right: 10px;' v-model="select.audit_status" placeholder="任务状态">
<Option v-for="item in auditStatusList" :value="item.id">{{item.value}}</Option>
</Select>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Select v-if="path_type==1||path_type==5" filterable clearable style='width:150px;margin-right: 10px;' v-model="select.type" placeholder="任务类别">
<Option v-for="(item,index) in typeName" v-if="index<typeName.length-1" :value="item.type">{{item.name}}</Option>
</Select>
<Select filterable clearable style='width:150px;margin-right: 10px;' v-model="select.unit_type" placeholder="任务类型">
<Option v-for="(item,index) in unitTypeList" :value="item.id">{{item.value}}</Option>
</Select>
<Select filterable clearable style='width:150px;margin-right: 10px;' v-model="select.audit_status" placeholder="任务状态">
<Option v-for="item in auditStatusList" :value="item.id">{{item.value}}</Option>
</Select>
<el-date-picker @change="changeDate" v-model="select.dateRange" type="daterange"
:picker-options="pickerOptions" value-format="yyyy-MM-dd" range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" align="right">
</el-date-picker>
<Input v-model="select.keyword" style="width: 150px;margin-right: 10px;" placeholder="关键字搜索" />
<Button type="primary" @click="getList" style="margin-right: 10px;">查询</Button>
<Button v-if="path_type!=5" icon="ios-add" type="primary" style="margin-right: 10px;"
@click="$refs['addUnit'].isShow=true,$refs['addUnit'].type='add'">添加</Button>
<Button v-if="path_type!=5" type="primary" style="margin-right: 10px;"
@click="editorUnit('','add')">添加</Button>
<Button v-if="path_type!=5" type="primary" style="margin-right: 10px;"
@click="editorUnit('','add',2)">文件学习</Button>
</div>
</slot>
</lx-header>
@ -87,6 +100,8 @@
<span v-for="detail in scope.row.grounp_admin_detail">
<el-tag v-if="detail.istrue"
style="margin-right: 5px;margin-bottom: 2px;">{{detail.admin.name}}</el-tag>
<el-tag v-else type='info'
style="margin-right: 5px;margin-bottom: 2px;">{{detail.admin.name}}</el-tag>
</span>
</span>
<span v-if="group.type==2">
@ -119,8 +134,9 @@
</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>
@ -159,7 +175,7 @@
return {
typeName: [{
type: 1,
name: '单位专项任务'
name: '专项任务'
}, {
type: 2,
name: '文件学习培训'
@ -174,7 +190,34 @@
name: '我的任务'
}],
type_name: '',
tableHeight: 0,
tableHeight: 0,
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}]
},
select: {
keyword: '',
page: 1,
@ -183,7 +226,10 @@
myself_department: 0,
type: '',
unit_type: '',
audit_status:''
audit_status:'',
dueDate:[],
start_date:'',
end_date:''
},
total: 0,
auditStatusList:[{
@ -191,7 +237,7 @@
value:'待审核'
},{
id:1,
value:'通过'
value:'开展中'
},{
id:2,
value:'不通过'
@ -217,7 +263,7 @@
prop: 'audit_status',
width: 180,
formatter: (cell, data, value, index) => {
return value == 1 ? '通过' : (value == 2 ? '不通过' : (value == 0 ? '待审核' : ''))
return value == 1 ? '开展中' : (value == 2 ? '不通过' : (value == 0 ? '待审核' : ''))
}
},{
label: "开始日期",
@ -229,6 +275,13 @@
width: 180,
}, {
label: "任务类型",
prop: 'type',
width: 180,
formatter: (cell, data, value, index) => {
return value == 1 ? '专项任务' : (value == 2 ? '文件学习培训' : (value == 3 ? '事件隐患任务' : (value == 4 ? '科室任务' : '')))
}
}, {
label: "任务类别",
prop: 'unit_type',
width: 180,
formatter: (cell, data, value, index) => {
@ -242,7 +295,7 @@
return value == 1 ? '提交文字' : (value == 2 ? '提交附件' : (value == 3 ? '提交文字与附件' : ''))
}
}, {
label: "用户类型",
label: "参与人员",
prop: '_names',
width: 360,
algn: 'left',
@ -353,6 +406,15 @@
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
},
changeDate(e){
if(e){
this.select.start_date = e[0];
this.select.end_date = e[1];
}else{
this.select.start_date = "";
this.select.end_date = "";
}
},
async getUserId(){
let res = await getUser()
this.login_id = JSON.parse(res).id
@ -415,8 +477,16 @@
this.select.page_size = e
this.getList()
},
editorUnit(id, type) {
this.$refs.addUnit.id = id
editorUnit(id, type,study) {
if(id){
this.$refs.addUnit.id = id
}
if(this.path_type==4){
this.$refs.addUnit.department_id = this.department_id
}
if(study){
this.$refs.addUnit.mission_type = study
}
this.$refs.addUnit.type = type
this.$refs.addUnit.isShow = true
},
@ -479,5 +549,14 @@
/deep/ .ivu-page {
text-align: right;
padding: 15px;
}
/deep/ .el-range-editor.el-input__inner{
height: 32px;
line-height: 32px;
width: 250px;
margin-right:10px;
}
/deep/ .el-date-editor .el-range__icon,/deep/ .el-date-editor .el-range-separator,/deep/ .el-date-editor .el-range__close-icon{
line-height: 25px;
}
</style>

Loading…
Cancel
Save