lion 2 years ago
parent 06e95b862a
commit 50f8b5f714

@ -51,8 +51,9 @@ export default {
edit_input: 'el-cascader', edit_input: 'el-cascader',
form_show: true, form_show: true,
_props: { _props: {
disabled:true,
options: this.options, options: this.options,
props: { checkStrictly: true, value: "id", label: "title", disabled: "_disabled" } props: { checkStrictly: true, value: "id", label: "title", disabled: "_disabled" },
}, },
_events: { _events: {
change: (e) => { change: (e) => {
@ -67,7 +68,7 @@ export default {
// edit_input: "text", // edit_input: "text",
form_show: true, form_show: true,
_props: { _props: {
// 'disabled':true 'disabled':true,
type: "year", type: "year",
"value-format": "yyyy" "value-format": "yyyy"
} }
@ -78,7 +79,7 @@ export default {
edit_input: "radio", edit_input: "radio",
form_show: true, form_show: true,
_props:{ _props:{
// 'disabled':true 'disabled':true
}, },
_params: [] _params: []
}, },
@ -354,6 +355,7 @@ export default {
formIndex({ page: 1,page_size: 999 }).then(res => { formIndex({ page: 1,page_size: 999 }).then(res => {
this.formInfo.find(i => i.field === 'form_id')._params = res.data this.formInfo.find(i => i.field === 'form_id')._params = res.data
}) })
} }
}; };
</script> </script>

@ -157,7 +157,8 @@
{ {
type: "", type: "",
label: "", label: "",
prop: "index", prop: "index",
fixed:'left',
customFn: row => { customFn: row => {
return row._type === 'type' ? row._text : row._index; return row._type === 'type' ? row._text : row._index;
} }
@ -174,7 +175,8 @@
}, },
{ {
prop: "records_count", prop: "records_count",
label: "预警规则", label: "预警规则",
fixed:"right",
customFn: row => { customFn: row => {
return(<div> return(<div>
<el-button plain type='primary' size="mini" <el-button plain type='primary' size="mini"
@ -214,8 +216,8 @@
getCategoryType(){ getCategoryType(){
categoryTypes().then(res=>{ categoryTypes().then(res=>{
this.categoryTypeList = res this.categoryTypeList = res
// this.select.categoryType = res.data.length>0?res.data[0].id:'' this.select.category_type_id = res.length>0?res[0].id:''
// this.select.categoryTypeName = res.data.length>0?res.data[0].title:'' this.select.categoryTypeName = res.length>0?res[0].title:''
}) })
}, },

@ -1,223 +1,152 @@
<template> <template>
<div> <div>
<div ref="lxHeader"> <div ref="lxHeader">
<lx-header icon="md-apps" text="填报查看" style="margin-bottom: 10px; border: 0px; margin-top: 15px"> <lx-header icon="md-apps" text="填报查看" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot> <slot>
<div style="display: flex">
</slot> <div style="margin-right:10px">
</lx-header> <DatePicker v-model="select.year" @on-change="changeYear" type="year" placeholder="选择总览年份" style="width: 150px" />
</div> </div>
<div class="wrapper"> <div style="margin-right:10px">
<div style="padding:15px"> <Select v-model="select.department_id" placeholder="请选择部门" style="width:150px">
<el-tabs v-model="activeName" @tab-click="handleClick"> <Option v-for="item in depList"
<el-tab-pane v-for="(item,index) in categoryTypeList" :label="item.title" :name="index+'查看'"> :value="item.id" :key="item.id">{{ item.name }}</Option>
<div></div> </Select>
</el-tab-pane> </div>
</el-tabs> <div style="margin-right:10px">
<el-radio-group v-model="select.year"> <Input v-model="select.keyword" placeholder="请输入关键字" style="width: 150px" />
<el-radio v-for="item in years" :label="item">{{item}}</el-radio> </div>
</el-radio-group>
</div> <Button
<xy-table ref="xyTable" type="primary"
:is-page="false" @click="$refs['xyTable'].getTableData(true)"
>查询</Button
>
</div>
</slot>
</lx-header>
</div>
<xy-table ref="xyTable"
:table-item="table" :table-item="table"
:list="list" :auths="auths_auth_mixin"
:indent="20" :action="index">
:row-key="row => row.id" <template v-slot:btns>
> <el-table-column align='center' fixed="right" label="操作" width="100" header-align="center">
<template #btns>
<el-table-column align='center' label="操作" width="100" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="scope.row._type === 'doc'"> <div style="display: flex;">
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="getDetail"></Button> <Button size="small" type="primary" @click="">查看</Button>
</template> </div>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
</xy-table> </xy-table>
</div>
</div>
</template>
</div> <script>
</template> import { index,destroy } from "@/api/person"
import { authMixin } from "@/mixin/authMixin";
<script> import headerContent from "@/components/LxHeader/XyContent.vue";
import { import LxHeader from "@/components/LxHeader/index.vue";
index as getCategory export default {
} from "@/api/category" mixins: [authMixin],
import { components: {
index headerContent,
} from "@/api/categoryType" LxHeader,
import headerContent from "@/components/LxHeader/XyContent.vue"; },
import LxHeader from "@/components/LxHeader/index.vue"; data() {
export default { return {
components: { select:{
headerContent, year:'',
LxHeader department_id:'',
}, keyword:''
data() { },
return { depList:[],
activeName: "0查看", table: [
categoryTypeList: [], {
years: [], type: "index",
select: { width: 46,
page: 1, label: "序号"
page_size: 999,
year: this.$moment().format('YYYY')
},
list: [],
table: [{
type: "",
label: "",
prop: "index",
customFn:row => {
return row._type === 'type' ? row._text : row._index;
}
}, },
{ {
prop: "title", prop: "name",
label: "清单类型名称", label: "姓名",
align: "left", width:120
customFn:row => {
return row._type === 'type' ? (<span><i style="padding: 0 8px;color: rgb(239, 216, 117);" class="el-icon-folder-opened"></i><span>{row.title}</span></span>) : (
<span><i style="padding: 0 8px;" class="el-icon-document"></i><span>{row.title}</span></span>)
}
}, },
{ {
label: "年份", prop: "department.name",
prop: "year", label: "部门",
width:120, width: 120
customFn:row => { },
return row._type === 'type' ? '--' : row.year; {
} prop: "person.name",
label: "清单类型",
width: 120
},
{
prop: "start_date",
label: "开始填报日期",
width: 160
}, },
{ {
label: "当前逾期", prop: "end_date",
prop: "", label: "结束填报日期",
width:120, width: 160
}, },
{ {
prop: "records_count", prop: "status",
label: "填报数量", label: "填报状态",
width:120, width: 160,
customFn:row => { customFn: (row) => {
if (!row.children?.length) { return ( <el-switch
return (<span>{row.records_count}</span>) v-model={row.status}
on = {
{
['change']: (e) => {
}
}
}></el-switch>)
} }
} },
}, // {
] // prop: "position",
} // label: ""
}, // },
created() { // {
this.getCategoryTypeList() // prop: "is_active",
this.getSelectYear() // label: "",
this.getCategoryList() // width: 80,
}, // formatter:(v1,v2,val) => {
methods: { // return val ? "" : ""
async getCategoryTypeList() { // }
const res = await index({ // },
page: 1, {
page_size: 999 prop: "username",
}) label: "用户名"
this.categoryTypeList = res.data },
},
async getCategoryList(){
let res = await getCategory()
this.formatList(res);
this.list = res;
},
getDetail(row,scope){
}, {
getSelectYear() { width: 80,
const currentYear = this.$moment().format('YYYY'); prop: "myindex",
const years = []; label: "排序"
for (let i = currentYear; i >= 2017; i--) {
years.push(i);
}
this.years = years
},
toChineseNum(number) {
const chineseNum = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
const chineseUnit = ["", "十", "百", "千", "万", "亿"];
let numStr = number.toString();
let len = numStr.length;
let str = "";
for (let i = 0; i < len; i++) {
str += chineseNum[parseInt(numStr[i])] + chineseUnit[len - 1 - i];
}
str = str.replace(/零[十百千]/g, "零");
str = str.replace(/零+/g, "零");
str = str.replace(/^零+/, "");
str = str.replace(/零+$/, "");
if (str[str.length - 1] === "零") {
str = str.slice(0, -1);
} }
return str ]
}, }
},
methods: {
index,destroy,
getList(){},
changeYear(){
},
},
computed: {},
}
</script>
formatList (data=[],pid) {
data.forEach((item,index) => {
if (item.hasOwnProperty('categories_tree')) {
item._id = item.id
delete item.id;
item._disabled = true
item._type = 'type'
item.children = item.categories_tree
item._text = this.toChineseNum(index+1)
} else {
item._type = 'doc'
item._index = pid ? `${pid}-${index+1}` : (index+1)
}
if (item.children instanceof Array && item.children.length > 0) {
this.formatList(item.children,item._index ? item._index : false)
}
})
},
handleClick() {},
},
computed: {},
}
</script>
<style scoped lang="scss"> <style scoped lang="scss">
.wrapper{
background-color: #fff;
}
::v-deep .el-radio__input.is-checked+.el-radio__label {
color: #c4312b;
}
::v-deep .el-radio__input.is-checked .el-radio__inner {
background-color: #c4312b;
border-color: #c4312b;
}
::v-deep .el-radio__inner{
width:18px;
height:18px;
}
::v-deep .el-radio__input.is-checked .el-radio__inner:after {
content: '';
width: 12px;
height: 6px;
margin-top:-1px;
border: 2px solid white;
border-top: transparent;
border-right: transparent;
text-align: center;
display: block;
position: absolute;
top: 50%;
left: 50%;
vertical-align: middle;
transform: translate(-50%, -50%) rotate(-45deg);
border-radius: 0px;
background: none;
}
::v-deep .el-tabs__nav-wrap::after{
background-color: #EBEEF5;
}
</style> </style>

@ -0,0 +1,75 @@
<template>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="填报总览" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<el-date-picker
v-model="select.year"
@change="changeYear"
type="year"
placeholder="选择总览年份">
</el-date-picker>
</slot>
</lx-header>
</div>
<div class="content">
<div>
<div>5</div>
<div>清单类型</div>
</div>
<div>
<div>5</div>
<div>填报清单项</div>
</div>
<div>
<div>5</div>
<div>一把手和领导班子</div>
</div>
<div>
<div>5</div>
<div>条填报记录</div>
</div>
<div>
<div>5</div>
<div>超期未报</div>
</div>
</div>
</div>
</template>
<script>
export default{
data(){
return{
select:{
year:''
},
viewlist:{}
}
},
created(){
},
methods:{
changeYear(e){}
},
}
</script>
<style scoped>
.content{
display: flex;
justify-content: space-between;
text-align: center;
}
.content>div{
border:1px solid #333;
width:18%;
padding:60px 0;
background-color: #fff;
font-size: 18px;
}
.content>div>div:first-child{
font-size: 30px;
}
</style>

@ -1,107 +0,0 @@
<template>
<div>
<xy-dialog ref="dialog" :width="30" :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" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>人员类型
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" placeholder="请输入人员类型" clearable></el-input>
</div>
</div>
</template>
<template v-slot:categoryTypeList>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>清单类型
</div>
<div class="xy-table-item-content">
<el-checkbox-group v-model="form.categoryTypeList">
<el-checkbox v-for="item in categoryTypeList" :label="item.id">{{item.title}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</template>
<template v-slot:sort>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>排序
</div>
<div class="xy-table-item-content">
<el-input v-model="form.sort" placeholder="请输入排序" clearable></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
Message
} from 'element-ui'
import { index as listCategoryType} from "@/api/categoryType"
export default {
components: {
},
data() {
return {
isShow: false,
type: 'add',
id:'',
categoryTypeList:[],
form: {
name:'',
categoryTypeList:[],
sort:0
},
rules: {
name: [{
required: true,
message: '请输入人员类型'
}]
}
}
},
created() {
this.getCategoryType()
},
methods: {
async getCategoryType(){
const res = await listCategoryType()
this.categoryTypeList = res.data
},
getDetail(){
},
submit(){},
},
watch: {
isShow(newVal) {
if(newVal){
if(this.type==='editor'){
this.getDetail()
}
}else{
this.type="add"
this.id=''
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .name,
::v-deep .categoryTypeList,
::v-deep .sort{
flex-basis: 100%;
}
</style>

@ -1,73 +0,0 @@
<template>
<div>
<xy-dialog ref="dialog" :width="30" :is-show.sync="isShow" :type="'form'" title="设置清单类型" :form="form"
:rules='rules' @submit="submit">
<template v-slot:categoryTypeList>
<div class="xy-table-item">
<!-- <div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>清单类型
</div> -->
<div class="xy-table-item-content">
<el-checkbox-group v-model="form.categoryTypeList">
<el-checkbox v-for="item in categoryTypeList" :label="item.id">{{item.title}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
Message
} from 'element-ui'
import { index as listCategoryType} from "@/api/categoryType"
export default {
components: {
},
data() {
return {
isShow: false,
type: 'add',
id:'',
categoryTypeList:[],
form: {
categoryTypeList:[]
},
rules: {
categoryTypeList: [{
required: true,
message: '请选择填报清单'
}]
}
}
},
created() {
this.getCategoryType()
},
methods: {
async getCategoryType(){
const res = await listCategoryType()
this.categoryTypeList = res.data
},
submit(){},
},
watch: {
isShow(newVal) {
},
}
}
</script>
<style scoped lang="scss">
::v-deep .categoryTypeList{
flex-basis: 100%;
}
</style>

@ -103,7 +103,7 @@ export default {
}, },
{ {
prop: "person.name", prop: "person.name",
label: "人员类别", label: "清单类型",
width: 120 width: 120
}, },
{ {

@ -1,135 +0,0 @@
<template>
<div>
<div>
<div ref="lxHeader">
<LxHeader
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
>
<div slot="content"></div>
<slot>
<header-content :auths="auths_auth_mixin">
<!-- <template #search>
<div style="display: flex">
<Button
type="primary"
@click="$refs['xyTable'].getTableData(true)"
>查询</Button
>
</div>
</template> -->
<template #create>
<Button
type="primary"
@click="$refs['createType'].type='add',$refs['createType'].isShow=true"
>新增</Button
>
</template>
</header-content>
</slot>
</LxHeader>
</div>
</div>
<xy-table ref="xyTable"
:table-item="table"
:auths="auths_auth_mixin"
:action="index"
:destroy-action="destroy"
@editor="row => {
$refs['createType'].setId(row.id);
$refs['createType'].setType('editor');
$refs['createType'].show();
}">
<template v-slot:btns>
<el-table-column align='center' label="操作" width="300" header-align="center">
<template slot-scope="scope" style="display: flex;">
<el-popover width="180"
:ref="`${scope.row.id}-${scope.$index}`"
trigger="hover">
<template>
<div>
<p style="padding-bottom: 10px;">确定要删除吗</p>
<div style="text-align: right;margin: 0;">
<el-button size="mini"
type="text"
@click="$refs[`${scope.row.id}-${scope.$index}`].doClose()"
>取消</el-button>
<el-button type="primary"
size="mini"
@click="$refs['xyTable'].deleteClick(scope.row, 'delete')">确定</el-button>
</div>
</div>
</template>
<template #reference>
<Button
style="margin-right:6px;"
type="error"
size="small">
删除
</Button>
</template>
</el-popover>
<Button size="small" type="primary" @click="$refs['createType'].id=scope.row.id,
$refs['createType'].type='editor',$refs['createType'].isShow=true;">编辑</Button>
<Button size="small" type="primary" @click="$refs['createTypeSetting'].id=scope.row.id,
$refs['createTypeSetting'].isShow=true;">设置清单类型</Button>
</template>
</el-table-column>
</template>
</xy-table>
<createType ref="createType" @refresh="$refs['xyTable'].getTableData()"></createType>
<createTypeSetting ref="createTypeSetting" @refresh="$refs['xyTable'].getTableData()"></createTypeSetting>
</div>
</template>
<script>
import { index,destroy } from "@/api/person"
import { authMixin } from "@/mixin/authMixin";
import headerContent from "@/components/LxHeader/XyContent.vue";
import LxHeader from "@/components/LxHeader/index.vue";
import createType from "./component/createType.vue"
import createTypeSetting from "./component/createTypeSetting.vue"
export default {
mixins: [authMixin],
components: {
headerContent,
LxHeader,
createType,
createTypeSetting
},
data() {
return {
table: [
{
type: "index",
width: 46,
label: "序号"
},
{
prop: "name",
label: "人员类型"
},
{
prop: "position",
label: "需填报清单类型"
},
{
width: 80,
prop: "myindex",
label: "排序"
}
]
}
},
methods: {
index,destroy,
createCategory(row){},
},
computed: {},
}
</script>
<style scoped lang="scss">
</style>
Loading…
Cancel
Save