Compare commits

...

11 Commits

@ -8,7 +8,7 @@ import getPageTitle from '@/utils/get-page-title'
NProgress.configure({ showSpinner: false }) // NProgress Configuration
const whiteList = ['/login','/h5/login'] // no redirect whitelist
const whiteList = ['/login','/h5/login','/full'] // no redirect whitelist
router.beforeEach(async(to, from, next) => {
// start progress bar

@ -75,10 +75,38 @@ export const constantRoutes = [{
}, ]
},
{
path: '/fill/formindex',
component: () => import('@/views/fill/formindex.vue'),
path: '/full',
component: () => import('@/views/full/indexfull.vue'),
hidden: true
},
{
path: '/fill',
component: Layout,
hidden:true,
children:[{
path: 'formindex',
name: '填报查看',
component: () => import('@/views/fill/formindex.vue'),
meta: {
title: '填报查看',
icon: 'dashboard'
}
}],
},
// {
// path: '/full',
// component: Layout,
// hidden:true,
// children:[{
// path: 'index',
// name: '填报清单',
// component: () => import('@/views/full/indexfull.vue'),
// meta: {
// title: '填报清单',
// icon: 'dashboard'
// }
// }],
// },
{
path: "/h5",
name: "h5",

@ -8,19 +8,19 @@
<header-content :auths="auths_auth_mixin">
<template #search>
<div>
<div style="margin-bottom:15px">
<span style="margin-right:15px;display: inline-block;">年度 </span>
<el-radio-group v-model="select.year" @change="changeYear">
<el-radio style="margin-right:5px" v-for="item in yearList" border
:label="item">{{item}}</el-radio>
</el-radio-group>
</div>
<div>
<span style="margin-right:15px;display: inline-block;">类型 </span>
<el-radio-group @change="changeCategoryType" v-model="select.category_type_id">
<el-radio style="margin-right:5px" v-for="item in categoryTypeList" border
:label="item.id">{{item.title}}</el-radio>
</el-radio-group>
<div style="margin-bottom:15px;margin-top:15px;">
<span style="margin-right:15px;display: inline-block;width:45px;vertical-align: top;">年度 </span>
<el-radio-group style="width:90%" v-model="select.year" @change="changeYear">
<el-radio style="margin-right:5px;margin-bottom:5px;margin-left:0" v-for="item in yearList" border
:label="item">{{item}}</el-radio>
</el-radio-group>
</div>
<div>
<span style="margin-right:15px;display: inline-block;width:45px;vertical-align: top;">类型 </span>
<el-radio-group style="width:90%" @change="changeCategoryType" v-model="select.category_type_id">
<el-radio style="margin-right:5px;margin-bottom:5px;margin-left:0" v-for="item in categoryTypeList" border
:label="item.id">{{item.title}}</el-radio>
</el-radio-group>
</div>
<!-- <el-date-picker size="small" style="width: 110px;" placeholder="请选择日期" value-format="yyyy" v-model="select.year" type="year"></el-date-picker> -->
<!-- <Button
@ -158,7 +158,8 @@
type: "",
label: "",
prop: "index",
fixed:'left',
fixed:'left',
width:100,
customFn: row => {
return row._type === 'type' ? row._text : row._index;
}
@ -166,17 +167,25 @@
{
prop: "title",
label: '清单',
align: "left",
align: "left",
// fixed:'left',
width:600,
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>)
class = "el-icon-folder-opened"> </i><span style="text-wrap:wrap">{row.title}</span> </span>) : ( <span> < i style = "padding: 0 8px;"
class = "el-icon-document" > </i><span style="text-wrap:wrap">{row.title}</span > </span>)
}
},
},
// {
// prop: "myindex",
// label: "",
// width:80
// },
{
prop: "records_count",
label: "预警规则",
fixed:"right",
// fixed:"right",
// width:300,
customFn: row => {
return(<div>
<el-button plain type='primary' size="mini"
@ -196,11 +205,7 @@
</div>)
}
},
{
prop: "myindex",
label: "排序",
}]
]
}
},
created() {
@ -344,5 +349,9 @@
a:hover {
color: $primaryColor;
text-decoration: underline;
}
::v-deep .el-table .cell.el-tooltip{
white-space: wrap!important;
text-wrap:wrap
}
</style>

@ -268,7 +268,8 @@ export default {
.card {
height: 100%;
background-color: #fff;
margin: 40px;
// margin: 40px;
margin-top:20px;
}
.info {
border-top: 1px solid #EBEEF5;

@ -1,6 +1,6 @@
<template>
<div>
<el-dialog title="填报" width="860px" :visible.sync="visible">
<el-dialog title="填报详情" width="860px" :visible.sync="visible">
<xy-table style="width: 820px"
stripe
@ -12,6 +12,64 @@
:table-item="table">
</xy-table>
</el-dialog>
<el-drawer
title="内容详情"
:visible.sync="isShowDrawer"
position="rtl"
size="750px"
:wrapper-closable="false"
>
<div style="padding: 20px 40px">
<el-form
class="form"
ref="elForm"
:model="showInfoDetail"
label-width="80px"
size="small"
>
<el-form-item label="标题" prop="title">
{{showInfoDetail.title}}
</el-form-item>
<el-form-item label="内容" required prop="content">
{{showInfoDetail.content}}
</el-form-item>
<el-form-item label="附件" prop="files">
<div v-if="showInfoDetail.files&&showInfoDetail.files.length>0">
<div v-for="item in showInfoDetail.files">
<a style="color:blue" :href="item.url" target="_blank">{{item.original_name}}</a>
</div>
</div>
<!-- <el-upload
class="upload-demo"
:action="action"
multiple
:limit="10"
:headers="{
'Authorization': 'Bearer ' + getToken(true)
}"
:before-upload="beforeUpload"
:on-success="uploadSuccess"
:file-list="fileList"
>
<el-button size="small" type="primary">点击上传</el-button>
</el-upload> -->
</el-form-item>
<!-- <el-form-item label="所属周期" prop="_week">
<el-input
placeholder="请选择所属周期"
readonly
v-model="form._week"
></el-input>
</el-form-item> -->
<el-form-item>
<el-button @click="isShowDrawer = false,showInfoDetail={}">关闭</el-button>
</el-form-item>
</el-form>
</div>
</el-drawer>
</div>
</template>
@ -22,6 +80,8 @@ export default {
return {
auth: [],
visible: false,
isShowDrawer:false,
showInfoDetail:{},
list:[],
select:{
category_id: "",
@ -49,8 +109,8 @@ export default {
{
prop: "operate",
label: "操作",
align: "left",
width: 140,
align: "center",
width: 80,
customFn: row => {
const _this = this
return (
@ -95,7 +155,12 @@ export default {
this.$refs['xyTable'].getTableData()
},
showInfo(id){
recordShow({
id:id
}).then(res=>{
this.showInfoDetail = res
this.isShowDrawer = true
})
},
},

@ -5,7 +5,7 @@
<slot>
<div style="display: flex">
<div style="margin-right:10px">
<DatePicker v-model="select.year" @on-change="changeYear" type="year" placeholder="选择总览年份" style="width: 150px" />
<DatePicker v-model="select.year" @on-change="changeYear" type="year" placeholder="选择年份" style="width: 150px" />
</div>
<div style="margin-right:10px">
<Select v-model="select.department_id" placeholder="请选择部门" style="width:150px">
@ -51,6 +51,7 @@ 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 { listCommondepartment } from "@/api/common";
export default {
mixins: [authMixin],
components: {
@ -82,7 +83,7 @@ export default {
width: 120
},
{
prop: "person.name",
prop: "category_type.title",
label: "清单类型",
width: 120
},
@ -102,7 +103,7 @@ export default {
width: 160,
customFn: (row) => {
return ( <el-switch
v-model={row.status}
v-model={row.is_active}
on = {
{
['change']: (e) => {
@ -137,12 +138,23 @@ export default {
]
}
},
created(){
this.getDep()
},
methods: {
index,destroy,
getList(){},
changeYear(){
},
getDep(){
listCommondepartment().then(res => {
// res.data.map(item=>{
// item.name=item.name+"("+item.abbr+")"
// })
this.depList = res.data
})
}
},
computed: {},
}

@ -13,23 +13,23 @@
</lx-header>
</div>
<div class="content">
<div>
<div class="box1">
<div>{{viewlist.count_category_type?viewlist.count_category_type:0}}</div>
<div>清单类型</div>
</div>
<div>
<div class="box2">
<div>{{viewlist.count_category?viewlist.count_category:0}}</div>
<div>填报清单项</div>
</div>
<div>
<div class="box3">
<div>{{viewlist.count_person?viewlist.count_person:0}}</div>
<div>一把手和领导班子</div>
</div>
<div>
<div class="box4">
<div>{{viewlist.count_record?viewlist.count_record:0}}</div>
<div>条填报记录</div>
</div>
<div>
<div class="box5">
<div>{{viewlist.count_record_missed?viewlist.count_record_missed:0}}</div>
<div>超期未报</div>
</div>
@ -43,7 +43,7 @@
data(){
return{
select:{
year:''
year:this.$moment().format('YYYY')
},
viewlist:{}
}
@ -69,15 +69,48 @@
display: flex;
justify-content: space-between;
text-align: center;
position: absolute;
width: 95%;
top: 50%;
}
.content>div{
border:1px solid #333;
/* border:1px solid #333; */
width:18%;
padding:60px 0;
background-color: #fff;
font-size: 18px;
/* background-color: #fff; */
font-size: 16px;
color:#fff;
/* flex: 1; */
position: relative;
margin-bottom: 2.375rem;
box-shadow: 0px 8px 15px 0px rgba(212, 84, 32, 0.3100);
border-radius: 8px;
box-sizing: border-box;
opacity: 0.8;
padding: 1.25rem 0;
}
.content>div>div:first-child{
font-size: 30px;
font-size: 45px;
}
.content .box1{
background: linear-gradient(134deg, #D1AC7B, #DFC69C);
}
.content .box2{
background: linear-gradient(134deg, #9193BC, #B7B9D4);
}
.content .box3{
background: linear-gradient(-55deg, #F6A868, #F4C59E);
}
.content .box4{
background: linear-gradient(-55deg, #64A48E, #9ECABB);
}
.content .box5{
background: linear-gradient(134deg, #40c9c6, #34bfa3);
}
</style>

@ -0,0 +1,100 @@
<template>
<div>
<el-drawer
size="600px"
title="设置清单类型"
:visible.sync="drawer"
direction="rtl">
<div style="padding: 10px 20px;">
<el-descriptions direction="vertical" :column="2" :labelStyle="{ 'font-weight': 600 }">
<el-descriptions-item label="已选清单" :span="2">
<div v-for="(item, index) in selections">
<Tag closable color="primary" @on-close="selections.splice(index, 1)">
{{ item.title }}
</Tag>
</div>
</el-descriptions-item>
<el-descriptions-item label="人员选择" :span="2">
<Transfer
:data="persons"
:target-keys="selectedPersons"
filterable
:filter-method="filterMethod"
@on-change="arr => selectedPersons = arr"></Transfer>
</el-descriptions-item>
<el-descriptions-item label="开始填报月份">
<DatePicker type="month" v-model="startMonth" placeholder="请选择开始填报月份"></DatePicker>
</el-descriptions-item>
<el-descriptions-item label="结束填报月份">
<DatePicker type="month" v-model="endMonth" placeholder="请选择结束填报月份"></DatePicker>
</el-descriptions-item>
</el-descriptions>
<Button type="primary" shape="circle" style="width: 40%;margin-top: 20px;" @click="submit"></Button>
</div>
</el-drawer>
</div>
</template>
<script>
import { index, assignCategoryType } from "@/api/person";
export default {
data() {
return {
drawer: false,
selections: [],
persons: [],
selectedPersons: [],
startMonth: '',
endMonth: ''
}
},
methods: {
async getPersons () {
this.persons = (await index({ page: 1, page_size: 9999 },false)).data.map(i => ({
key: i.id,
label: i.name
}))
},
filterMethod (data, query) {
return data.label.indexOf(query) > -1;
},
setSelections (arr) {
if (arr instanceof Array) {
this.selections = arr
}
},
show () {
this.drawer = true;
},
hide () {
this.drawer = false;
},
submit () {
assignCategoryType({
person_id: this.selectedPersons.toString(),
category_id: this.selections.map(i => i.id).toString(),
start_year_month: this.$moment(this.startMonth).format("YYYY-MM"),
end_year_month: this.$moment(this.endMonth).format("YYYY-MM"),
}).then(res => {
this.hide()
})
}
},
computed: {},
created() {
this.getPersons()
}
}
</script>
<style scoped lang="scss">
::v-deep .ivu-tag {
height: auto;
line-height: 1.5;
padding: 4px 8px;
}
::v-deep .ivu-tag .ivu-icon-ios-close {
top: 0;
}
</style>

@ -0,0 +1,393 @@
<script>
import { index as typeIndex } from "@/api/categoryType";
import { index as formIndex } from "@/api/system/customForm";
import { save, show, store, index, destroy } from "@/api/category";
import { CreateDialog } from "@/utils/createDialog"
import { deepCopy } from "@/utils";
export default {
props: {
options: [Array,Object]
},
render(h) {
let dialog = new CreateDialog(this,[
],{
width: "45%"
})
return dialog.render()
},
data() {
return {
columns: 1,
row: {},
formInfo: [
{
name: '清单名称',
field: 'title',
edit_input: 'text',
form_show: true,
// _props: {
// type: "textarea",
// autoSize: {
// minRows: 2
// }
// }
},
// {
// name: '',
// field: 'require',
// edit_input: 'text',
// form_show: true,
// _props: {
// type: "textarea",
// autoSize: {
// minRows: 4
// }
// }
// },
{
name: '父栏目',
field: 'pid',
_default: 0,
edit_input: 'el-cascader',
form_show: true,
_props: {
disabled:true,
options: this.options,
props: { checkStrictly: true, value: "id", label: "title", disabled: "_disabled" },
},
_events: {
change: (e) => {
this.form.pid = e.at(-1);
}
}
},
{
name: "年份",
field: "year",
edit_input: "el-date-picker",
// edit_input: "text",
form_show: true,
_props: {
'disabled':true,
type: "year",
"value-format": "yyyy"
}
},
{
name: "清单类型",
field: "type_id",
edit_input: "radio",
form_show: true,
_props:{
'disabled':true
},
_params: []
},
// {
// name: "",
// field: "measure_duration",
// edit_input: "radio",
// form_show: true,
// _params: [
// {
// value: "monthly",
// label: ""
// },
// {
// value: "quarterly",
// label: ""
// },
// {
// value: "yearly",
// label: ""
// },
// ]
// },
// {
// name: "",
// field: "measure_type",
// edit_input: "radio",
// form_show: true,
// _params: [
// {
// value: "check",
// label: ""
// },
// {
// value: "reply",
// label: ""
// }
// ]
// },
// {
// name: "",
// field: "measure_reply_quantity",
// edit_input: "el-input-number",
// form_show: true,
// _props: {
// precision: 0,
// controls: false
// }
// },
{
name: '排序值',
field: 'myindex',
edit_input: 'el-input-number',
form_show: true,
_props: {
controls: false
}
}
],
id: "",
type: "add",
dialogVisible: false,
form: {},
originalForm: {},
rules: {
title: [
{ required: true,message: "请填写清单名称" }
],
// type_id: [
// { required: true,message: "" }
// ],
// measure_reply_quantity: [
// {
// validator:(rule,value,cb) => {
// if (this.form['measure_type'] === 'reply') {
// value > 0 ? cb() : cb(new Error('0'))
// } else {
// cb()
// }
// }
// }
// ]
},
file: {},
};
},
methods: {
setRow (row) {
this.row = row
},
init() {
for (let key in this.form) {
if (this.formInfo.find(i => i.field === key)?._default) {
this.form[key] = this.formInfo.find(i => i.field === key)._default
}
else if (this.form[key] instanceof Array) {
this.form[key] = [];
} else {
this.form[key] = "";
}
}
this.$refs["elForm"].clearValidate();
},
setForm(key = [], value = []) {
if (key instanceof Array) {
key.forEach((key, index) => {
this.form[key] = value[index] ?? "";
});
}
if (typeof key === "string") {
this.form[key] = value;
}
if (!key) {
this.init();
}
},
show() {
this.dialogVisible = true;
},
hidden() {
this.dialogVisible = false;
},
setType(type = "add") {
let types = ["add", "editor", "show"];
if (types.includes(type)) {
this.type = type;
} else {
console.warn("Unknown type: " + type);
}
},
setId(id) {
if (typeof id == "number") {
this.id = id;
} else {
console.error("error typeof id: " + typeof id);
}
},
async getDetail() {
const res = await show({ id: this.id });
this.$integrateData(this.form, res);
this.formInfo.forEach((i) => {
if (i && (i.edit_input === "file" || i.edit_input === "files")) {
res[i._relations.link_with_name]
? (this.file[i.field] =
res[i._relations.link_with_name] instanceof Array
? res[i._relations.link_with_name].map((i) => {
return {
name: i?.name,
url: i?.url,
response: i,
};
})
: [
{
name: res[i._relations.link_with_name]?.name,
url: res[i._relations.link_with_name]?.url,
response: res[i._relations.link_with_name],
},
])
: (this.file[i.field] = []);
}
this.form = Object.assign({}, this.form);
this.originalForm = deepCopy(res);
});
},
submit() {
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
}
store(this.form).then(res => {
this.$Message.success({
content: `${this.type === "add" ? "新增" : "编辑"}成功`,
});
this.$emit("refresh");
this.hidden();
})
}
if (this.type === "editor") {
Object.defineProperty(this.form, "id", {
value: this.id,
enumerable: true,
configurable: true,
writable: true,
});
save(this.form).then(res => {
this.$Message.success({
content: `${this.type === "add" ? "新增" : "编辑"}成功`,
});
this.$emit("refresh");
this.hidden();
})
}
},
},
computed: {
title () {
if (this.type === 'add') return '新增'
if (this.type === 'editor') return '编辑'
if (this.type === 'show') return '查看'
}
},
watch: {
"form.year":{
handler:function (newVal) {
this.form.year = newVal.toString()
}
},
options(val){
this.$set(this.formInfo.find(i => i.field === 'pid')._props,'options',val)
},
formInfo: {
handler: function (newVal) {
this.form = {};
this.file = {};
newVal.forEach((i) => {
if (i.field) {
this.form[i.field] = (i._default || i._default === 0)? i._default : '';
if (
i.validation instanceof Array &&
i.validation.length > 0 &&
!!i.validation.find((i) => i === "required")
) {
}
if (i.edit_input === "files") {
this.form[i.field] = [];
}
if (i.edit_input === "files" || i.edit_input === "file") {
this.file[i.field] = [];
}
if (i.edit_input === "checkbox") {
this.form[i.field] = [];
}
if (i._relations) {
this.form[i._relations?.link_with_name] = [];
}
}
});
this.columns = newVal.length > 11 ? '2' : '1'
},
immediate: true,
},
dialogVisible(val) {
if (val) {
document.documentElement.style.setProperty(
"--column-num",
this.columns
);
if (this.type === "editor" || this.type === "show") {
// this.$nextTick(() => this.getDetail());
}
} else {
this.id = "";
this.type = "";
this.init();
this.$refs["elForm"].clearValidate();
delete this.form.id;
for (let key in this.file) {
this.file[key] = [];
}
}
},
},
created() {
this.formInfo.find(i => i.field === 'type_id')._params = []
this.formInfo.find(i => i.field === 'form_id')._params = []
// typeIndex({ page: 1,page_size: 999 }).then(res => {
// this.formInfo.find(i => i.field === 'type_id')._params = res.data
// })
// formIndex({ page: 1,page_size: 999 }).then(res => {
// this.formInfo.find(i => i.field === 'form_id')._params = res.data
// })
}
};
</script>
<style>
:root {
--column-num: 2;
}
</style>
<style scoped lang="scss">
.uploaded-a {
color: red;
text-decoration: none;
transition: all 0.2s;
}
.uploaded-a:hover {
color: red;
text-decoration: underline;
}
.form-body {
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(var(--column-num), 1fr);
}
::v-deep .el-input-number.is-without-controls .el-input__inner {
text-align: left;
}
</style>

@ -0,0 +1,221 @@
<template>
<div>
<xy-dialog ref="dialog" :width="60" :is-show.sync="isShow" :type="'form'" :title="title" :form="form">
<template v-slot:table>
<xy-table
ref="xyTable"
:table-item="table"
:list="categoryRuleList"
:isPage='false'
>
<template v-slot:btns>
<el-table-column align='center' label="操作" width="120" header-align="center">
<template slot="header" slot-scope="scope">
<el-button
size="mini" @click="addRules">新增</el-button>
</template>
<template slot-scope="scope" style="display: flex;">
<Button v-if="!scope.row.isEdit" style="margin-right:5px" size="small" type="primary" @click="submitRules(scope.row)"></Button>
<Button v-else style="margin-right:5px" size="small" type="primary" @click="scope.row.isEdit=false"></Button>
<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="delRules(scope.row,scope.$index)">确定</el-button>
</div>
</div>
</template>
<template #reference>
<Button
style="margin-right:6px;"
type="error"
size="small">
删除
</Button>
</template>
</el-popover>
</template>
</el-table-column>
</template>
</xy-table>
</template>
<template v-slot:footerContent>
<Button @click="isShow=false,$emit('refresh')"></Button>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
Message
} from 'element-ui'
import { index,store,save,destroy} from "@/api/category/rule.js"
export default {
components: {
},
data() {
return {
isShow: false,
visible:false,
type: 'add',
title:'规则设置',
category_id:'',
id:'',
categoryRuleList:[],
form: {
table:''
},
table:[{
label: "开始日期",
prop: "start_at",
customFn: row => {
return(<el-date-picker v-model={row.start_at}
type="date"
disabled={row.isEdit}
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>)
}
},{
label: "结束日期",
prop: "end_at",
customFn: row => {
return(<el-date-picker v-model={row.end_at}
type="date"
format="yyyy-MM-dd"
disabled={row.isEdit}
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>)
}
},{
label: "填报数量",
prop: "quantity",
width:80,
customFn: row => {
return(<el-input type='text' disabled={row.isEdit} v-model={row.quantity}></el-input>)
}
},{
label: "备注",
prop: "remark",
customFn: row => {
return(<el-input type='textarea' disabled={row.isEdit} v-model={row.remark}></el-input>)
}
},{
label: "排序",
prop: "myindex",
width:80,
customFn: row => {
return(<el-input type='text' disabled={row.isEdit} v-model={row.myindex}></el-input>)
}
}
],
rules: {
categoryRuleList: [{
required: true,
message: '请选择填报清单'
}]
}
}
},
created() {
},
methods: {
async getCategoryRule(){
const res = await index({
category_id:this.category_id
})
res.map(item=>{
item.isEdit = true
})
this.categoryRuleList = res
console.log("this.categoryRuleList",this.categoryRuleList)
},
addRules(){
this.categoryRuleList.push({
category_id:this.category_id,
isEdit:false,
start_at:'',
end_at:'',
quantity:1,
remark:'',
myindex:0
})
},
delRules(row,index){
if(row.id){
destroy({
id:row.id
}).then(res=>{
this.$Message.success({
content: `删除成功`,
});
this.categoryRuleList.splice(index,1)
})
}else{
this.categoryRuleList.splice(index,1)
}
},
submitRules(row){
console.log("row",row)
if(this.isNull(row.start_at)||this.isNull(row.end_at)){
Message({
type:'warning',
message:'请填写全部信息'
})
return
}
if(row.id){
save(row).then(res => {
this.$Message.success({
content: `保存成功`,
});
this.getCategoryRule()
})
}else{
store(row).then(res => {
this.$Message.success({
content: `保存成功`,
});
this.getCategoryRule()
})
}
},
isNull(p){
return p == '' || p == undefined || p == null || p == 'undefined' || p == 'null';
},
},
watch: {
isShow(newVal) {
if(newVal){
// this.getCategoryRule()
}else{
this.title='规则设置'
this.category_id=''
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .table{
flex-basis: 100%;
}
</style>

@ -0,0 +1,339 @@
<template>
<div style="padding:20px">
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="填报清单" style="margin-bottom: 10px; border: 0px; margin-top: 0px">
<slot>
<div>
<div style="margin-bottom:15px;margin-top:15px;">
<span style="margin-right:15px;display: inline-block;width:45px;vertical-align: top;">年度 </span>
<el-radio-group style="width:90%" v-model="select.year" @change="changeYear">
<el-radio style="margin-right:5px;margin-bottom:5px;margin-left:0" v-for="item in yearList" border
:label="item">{{item}}</el-radio>
</el-radio-group>
</div>
<div>
<span style="margin-right:15px;display: inline-block;width:45px;vertical-align: top;">类型 </span>
<el-radio-group style="width:90%" @change="changeCategoryType" v-model="select.category_type_id">
<el-radio style="margin-right:5px;margin-bottom:5px;margin-left:0" v-for="item in categoryTypeList" border
:label="item.id">{{item.title}}</el-radio>
</el-radio-group>
</div>
</div>
</slot>
</lx-header>
</div>
</div>
<div>
<!-- <div style="margin-bottom:15px;">
<el-button v-if="select.category_type_id" @click="$refs['create'].setType('add'),
$refs['create'].setForm('type_id', select.category_type_id),
$refs['create'].setForm('year', select.year.toString()),
$refs['create'].show()" plain>新建{{select.year}}{{select.categoryTypeName}}清单</el-button>
</div> -->
<xy-table ref="xyTable" :is-page="false" :list="list" res-prop="" :indent="20" :row-key="row => row._index"
:table-item="table" :auths="auths_auth_mixin" :req-opt="select" :destroy-action="destroy" @editor="row => {
$refs['create'].setId(row.id);
$refs['create'].setType('editor');
$refs['create'].show();
}" @destroyed="getList">
<template v-slot:btns>
<el-table-column align='center' fixed="right" label="操作" width="220" header-align="center">
<template slot="header" slot-scope="scope">
<el-button
size="mini" @click="">整体克隆</el-button>
</template>
<template slot-scope="scope">
<div style="display: flex;">
<Button v-if="scope.row._type !== 'type'" size="small" type="primary" @click="$refs['create'].setId(scope.row.id),
$refs['create'].setType('editor'),
$refs['create'].show();">编辑</Button>
<el-popover width="180" v-if="scope.row._type !== 'type'" :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>
<div style="margin-right: 6px;height: 100%;width: 100%;">
<Button type="error" size="small" @click="$refs[`${scope.row.id}-${scope.$index}`].doShow()">
删除
</Button>
</div>
</template>
</el-popover>
<Button size="small" type="primary" @click="createChild(scope.row)"></Button>
</div>
</template>
</el-table-column>
</template>
</xy-table>
</div>
<create ref="create" :options="list" @refresh="getList"></create>
<!-- <categorySetting ref="categorySetting"></categorySetting> -->
<createRules ref="createRules" @refresh="getList"></createRules>
</div>
</template>
<script>
import {
index,
destroy,
categoryYears,
categoryTypes
} from "@/api/category"
import {
authMixin
} from "@/mixin/authMixin";
import headerContent from "@/components/LxHeader/XyContent.vue";
import LxHeader from "@/components/LxHeader/index.vue";
import create from "./component/create.vue";
// import categorySetting from "./component/categorySetting.vue";
import createRules from "./component/createRules.vue";
export default {
mixins: [authMixin],
components: {
// categorySetting,
headerContent,
LxHeader,
create,
createRules
},
data() {
return {
provideOptions: [],
yearList: [],
categoryTypeList:[],
select: {
year: '',
category_type_id:'',
categoryTypeName:''
},
isStartSelect: false,
list: [],
table: [
// {
// type: "selection",
// width: 48,
// selectable: row => {
// return row._type === 'type' ? false : this.isStartSelect;
// }
// },
{
type: "",
label: "",
prop: "index",
fixed:'left',
width:100,
customFn: row => {
return row._type === 'type' ? row._text : row._index;
}
},
{
prop: "title",
label: '清单',
align: "left",
width:600,
customFn: row => {
return row._type === 'type' ? ( <span> <i style = "padding: 0 8px;color: rgb(239, 216, 117);"
class = "el-icon-folder-opened"> </i><span style="text-wrap:wrap">{row.title}</span> </span>) : ( <span> < i style = "padding: 0 8px;"
class = "el-icon-document" > </i><span style="text-wrap:wrap">{row.title}</span > </span>)
}
},
// {
// prop: "myindex",
// label: "",
// width:80
// },
{
prop: "records_count",
label: "预警规则",
// fixed:"right",
customFn: row => {
return(<div>
<el-button plain type='primary' size="mini"
on = {
{
['click']: (e) => {
this.createRules(row)
}
}
}
>规则设置</el-button>
<div>{
row.rules.map(item=>{
return(<div>{item.start_at}~{item.end_at}不少于{item.quantity}</div>)
})
}</div>
</div>)
}
}]
}
},
created() {
this.getPastYears()
this.getList()
// this.yearList = this.getPastYears(5)
this.getCategoryType()
// this.select.year = this.$moment().format('YYYY')
},
methods: {
index,
destroy,
getCategoryType(){
categoryTypes().then(res=>{
this.categoryTypeList = res
this.select.category_type_id = res.length>0?res[0].id:''
this.select.categoryTypeName = res.length>0?res[0].title:''
})
},
changeYear(e){
if(e){
this.getList()
}
},
changeCategoryType(e){
if(e){
this.categoryTypeList.map(item=>{
if(item.id===e){
this.select.categoryTypeName = item.title
}
})
this.getList()
}
},
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
},
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)
// item._index = pid ? (index+1) : (index + 1)
}
if (item.children instanceof Array && item.children.length > 0) {
this.formatList(item.children, item._index ? item._index : false)
}
})
},
getPastYears(years) {
categoryYears().then(res=>{
this.yearList = res.years
this.select.year = res.selected_year
})
},
async getList() {
let res = await index({
year:this.select.year,
category_type_id:this.select.category_type_id
});
this.formatList(res);
this.list = res;
},
createChild(row) {
let category_type_id = this.select.category_type_id
if(row.type_id){
category_type_id = row.type_id
}
if (row._type === 'type') {
this.$refs['create'].setForm('type_id', category_type_id);
this.$refs['create'].setForm('pid', 0);
this.$refs['create'].setForm('year', this.select.year.toString());
this.$refs['create'].setType('add');
this.$refs['create'].show();
} else {
this.$refs['create'].setForm('type_id', category_type_id);
this.$refs['create'].setForm('pid', row.id);
this.$refs['create'].setForm('year', this.select.year.toString());
this.$refs['create'].setType('add');
this.$refs['create'].show();
}
},
createRules(row){
console.log(row)
if(row._type==='type'){
this.$refs['createRules'].category_id = row._id
}else{
this.$refs['createRules'].category_id = row.id
}
this.$refs['createRules'].title = row.title;
this.$refs['createRules'].isShow = true;
}
},
computed: {},
watch: {
// isStartSelect(newVal) {
// const selections = this.$refs['xyTable'].getSelection()
// if (!newVal && selections.length > 0) {
// this.$refs['categorySetting'].setSelections(selections)
// this.$refs['categorySetting'].show()
// }
// }
}
}
</script>
<style scoped lang="scss">
a {
color: $primaryColor;
text-decoration: none;
transition: all 0.2s;
}
a:hover {
color: $primaryColor;
text-decoration: underline;
}
::v-deep .el-table .cell.el-tooltip{
white-space: wrap!important;
text-wrap:wrap;
}
</style>

@ -25,6 +25,11 @@
:row-key="(row) => row._index"
:table-item="table"
:auths="[]"
:row-style="({ row }) => {
return {
'height': '44px'
}
}"
>
</xy-table>
@ -50,7 +55,7 @@
<el-form-item label="内容" required prop="content">
<el-input
type="textarea"
:autosize="{ minRows: 30 }"
:autosize="{ minRows: 15 }"
v-model="form.content"
></el-input>
</el-form-item>
@ -86,7 +91,12 @@
</div>
</el-drawer>
<detail ref="show" @edit="editShow"></detail>
<detail ref="show"
@edit="editShow"
@destroyed="() => {
getCategories()
getStatics()
}"></detail>
</div>
</template>
@ -98,7 +108,7 @@ export default {
components: {
detail
},
inject: ['myInfo', 'statics'],
inject: ['myInfo', 'statics', 'getStatics'],
data() {
return {
isShowDrawer: false,
@ -108,7 +118,7 @@ export default {
tableName: "asd",
},
fileList: [],
action: process.env.VUE_APP_UPLOAD_API,
action: `${process.env.VUE_APP_BASE_API}/api/person/upload-file`,
select: {
year: this.$moment().format("YYYY"),
},
@ -156,11 +166,11 @@ export default {
label: "填报要求",
width: 240,
customFn: row => {
return(<div>
return row._is_end ? (<div>
{
row.rules.map(item => (<div>{item.start_at} ~ {item.end_at}不少于{item.quantity}</div>))
}
</div>)
</div>) : ''
}
},
{
@ -265,7 +275,7 @@ export default {
}
},
uploadSuccess (response, file, fileList) {
this.form.files = fileList.map(i => i.response?.id).toString()
this.fileList = fileList
},
async getDetail (id) {
@ -274,13 +284,18 @@ export default {
})
this.$integrateData(this.form, res)
this.form.id = id
this.fileList = res?.files?.map(i => ({
name: i.original_name,
url: i.url,
response: i
})) || []
},
async editShow (id) {
this.type = 'edit'
await this.getDetail(id)
let rule = this.pickRule.find(i => i.id === this.form.category_rule_id)
this.form._week = `${rule.start_at} ~ ${rule.end_at}`
this.form._week = `${rule?.start_at || ''} ~ ${rule?.end_at || ''}`
this.isShowDrawer = true
},
@ -362,6 +377,7 @@ export default {
});
this.isShowDrawer = false;
this.getCategories()
this.getStatics()
});
} else {
save(this.form).then((res) => {

@ -77,6 +77,7 @@ export default {
message: '删除成功!'
});
_this.$refs['xyTable'].getTableData()
this.$emit('destroyed')
})
})
}

@ -7,10 +7,12 @@
{{ descriptionLabel(key) }}
</el-descriptions-item>
<el-descriptions-item label="本年统计">
正常填报{{ static.count_normal }}迟报{{ static.count_delayed }}超期未报{{ static.count_missed }}
<div class="card__status">
正常填报<div class="cir1"></div>{{ static.count_normal }}迟报<div class="cir2"></div>{{ static.count_delayed }}超期未报<div class="cir3"></div>{{ static.count_missed }}
</div>
</el-descriptions-item>
</el-descriptions>
<Button type="primary" long @click="$router.push('/h5/form')"></Button>
<Button style="margin-top: 24px;height: 34px;" type="primary" long @click="$router.push('/h5/form')"></Button>
</Card>
</div>
</template>
@ -21,9 +23,9 @@ export default {
data() {
return {
descriptions: {
"department.name": "市委",
"name": "姓名",
"position": "职位",
"department.name": "部\u3000\u3000门",
"name": "姓\u3000\u3000名",
"position": "职\u3000\u3000位",
"start_at": "开始填报",
"end_at": "结束填报"
}
@ -71,8 +73,29 @@ export default {
top: calc(50% - #{$height} / 2);
.title {
font-size: 24px;
text-align: center;
padding: 20px 0;
}
&__status {
$color: #377e22,#f2a93c,#ea3423;
display: flex;
align-items: center;
font-size: 12px;
@mixin cir {
padding: 8px;
border-radius: 100%;
margin: 0 6px;
}
@for $i from 1 through length($color) {
.cir#{$i} {
@include cir;
background: nth($color, $i);
}
}
}
}
</style>

@ -41,6 +41,7 @@ export default {
return {
myInfo: () => this.myInfo,
statics: () => this.statics,
getStatics: this.getStatics,
}
},
data() {
@ -51,17 +52,35 @@ export default {
count_normal: 0,
count_delayed: 0,
count_missed: 0
}
},
loadingInstance: null,
}
},
methods: {
async getStatics () {
this.statics = await getYearStatistics(this.select);
},
async getInfo () {
this.myInfo = await getBaseInfo()
},
async logout() {
await this.$store.dispatch('user/logout')
this.$router.push(`/h5/login?redirect=${this.$route.fullPath}`)
},
loading () {
this.loadingInstance = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.8)'
})
},
loaded () {
if (this.loadingInstance && this.loadingInstance.close) {
this.loadingInstance.close()
}
}
},
computed: {
@ -69,9 +88,14 @@ export default {
return this.$route.path
}
},
created() {
this.getStatics();
getBaseInfo().then(res => (this.myInfo = res))
async created() {
try {
this.loading()
await Promise.all([this.getStatics(),this.getInfo()])
this.loaded()
} catch (e) {
this.loaded()
}
}
}
</script>

@ -76,13 +76,13 @@ export default {
},
{
name: '开始填报日期',
field: 'start_date',
field: 'start_at',
edit_input: 'date',
form_show: true
},
{
name: '结束填报日期',
field: 'end_date',
field: 'end_at',
edit_input: 'date',
form_show: true
},

@ -122,7 +122,7 @@ export default {
width: 160,
customFn: (row) => {
return ( <el-switch
v-model={row.status}
v-model={row.is_active}
// disabled
// readonly
on = {

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin',
outputDir: './dist',
outputDir: '/Users/mac/Documents/朗业/2023/y-一把手/jiwei/public/admin',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save