flat: 暂存

This commit is contained in:
Apcallover
2024-04-01 21:09:42 +08:00
parent 625507a53c
commit 873d5a7afe
4 changed files with 524 additions and 70 deletions

View File

@@ -16,9 +16,17 @@
</template> </template>
<script> <script>
import {innovationServeCount , getListAllServe} from '@/api/report/report' import {innovationServeCount , listAllServe} from '@/api/report/report'
import CustomLoading from "@/components/Custom-Loading/index.vue"; import CustomLoading from "@/components/Custom-Loading/index.vue";
import { dateFormat } from "@/util/date"; import { dateFormat } from "@/util/date";
import { deepClone } from "@/util/util";
const columnEnum = {
"personCount": "服务总人数",
"policyCount": "政策推送总数",
"jobCount": "岗位推送总数",
"serveCount": "跟踪服务次数",
"successfulCount": "服务成功次数"
}
const pages = { total: 0, size: 10, currentPage: 1 } const pages = { total: 0, size: 10, currentPage: 1 }
const baseOptions = { const baseOptions = {
dateBtn: false, dateBtn: false,
@@ -34,6 +42,7 @@ const baseOptions = {
tip: false, tip: false,
searchMenuSpan: 6, searchMenuSpan: 6,
selection: false, selection: false,
headerAlign: 'center',
} }
export default { export default {
components: {CustomLoading}, components: {CustomLoading},
@@ -43,35 +52,60 @@ export default {
infoData: [], infoData: [],
visible: false, visible: false,
search: {}, search: {},
serveData: [],
headTitle: '',
searchServeId: '',
} }
}, },
created() { created() {
this.getList() this.getServeList().then((res) => {
if(res.length) {
this.headTitle = res[0].name
this.search.serveId = res[0].id
this.searchServeId = res[0].id
this.getList().then((records) => {
if(records.length) {
this.headTitle = records[0].name
}
})
}
})
}, },
computed: { computed: {
options() { options() {
const serveHead = [{
label: this.headTitle,
display: false,
children: Object.keys(columnEnum).map((key) => ({
label: columnEnum[key],
prop: key,
display: false,
}))
}]
return { return {
...baseOptions, ...baseOptions,
column: [{ column: [{
label: '服务名称',
prop: 'serveId',
hide: true,
display: false,
type:'select',
searchSpan: 6,
search:true,
searchClearable: false,
dicData: this.serveData,
props: {
label: 'name',
value: 'id'
}
},{
label: '机构名称', label: '机构名称',
prop: 'name', prop: 'companyName',
search: true, search: true,
searchSpan: 6, searchSpan: 6,
},{ },
label: '政策名称', ...serveHead,
prop: 'policyName', {
search: true,
searchSpan: 6,
},{
label: '推送数',
prop: 'serveCount',
},{
label: '跟踪服务次数 ',
prop: 'traceCount'
},{
label: '服务成功次数 ',
prop: 'successCount'
},{
label: '日期', label: '日期',
prop: 'date', prop: 'date',
hide: true, hide: true,
@@ -94,15 +128,26 @@ export default {
this.getList() this.getList()
}, },
searchChange(values, done) { searchChange(values, done) {
this.getList().then(() => {done()}) const ele = this.serveData.filter((item) => values.serveId === item.id)[0]
this.headTitle = ele.name
this.searchServeId = values.serveId
this.getList().then(() => done())
}, },
resetChange() { resetChange() {
this.search = {} this.search = { serveId: this.searchServeId }
let params = { size: 10, current: 1 } let params = { size: 10, current: 1 }
this.getList() this.getList()
}, },
async getSearchList() { getServeList() {
// let resData = await getListAllServe({}) return new Promise(async (resolve, reject) => {
let resData = await listAllServe({id: '1767902578403028993'})
if(resData.data.code === 200) {
this.serveData = resData.data.data
resolve(resData.data.data)
} else {
reject()
}
})
}, },
getList(values) { getList(values) {
return new Promise(async(resolve, reject) => { return new Promise(async(resolve, reject) => {
@@ -111,22 +156,24 @@ export default {
size: this.infoPages.size, size: this.infoPages.size,
current: this.infoPages.currentPage, current: this.infoPages.currentPage,
...this.search, ...this.search,
// serveName: '创业服务'
} }
if( Array.isArray(this.search.date) && this.search.date.length ) { if( Array.isArray(this.search.date) && this.search.date.length ) {
const [stime, etime] = this.search.date const [stime, etime] = this.search.date
params.stime = dateFormat(stime, "yyyy-MM-dd") params.stime = dateFormat(stime, "yyyy-MM-dd")
params.etime = dateFormat(etime, "yyyy-MM-dd") params.etime = dateFormat(etime, "yyyy-MM-dd")
delete params.date delete params.date
} }
console.log(123123, params) const copySearch = deepClone(this.search)
let resData = await innovationServeCount(params) let resData = await innovationServeCount(params)
if(resData.data.code === 200) { if(resData.data.code === 200) {
const { records, current, total, size } = resData.data.data const { records, current, total, size } = resData.data.data
this.infoData = records this.infoData = records
this.infoPages = { ...this.infoPages, currentPage: current, total, size} this.infoPages = { ...this.infoPages, currentPage: current, total, size}
this.visible = false; this.visible = false;
resolve(true) resolve(records)
setTimeout(() => {
this.search = copySearch
}, 0)
} else { } else {
reject() reject()
} }

View File

@@ -16,13 +16,17 @@
</template> </template>
<script> <script>
import {unemploymentInsuranceServiceCount} from '@/api/report/report' import {unemploymentInsuranceServiceCount , listAllServe} from '@/api/report/report'
import CustomLoading from "@/components/Custom-Loading/index.vue"; import CustomLoading from "@/components/Custom-Loading/index.vue";
import { dateFormat } from "@/util/date"; import { dateFormat } from "@/util/date";
import search from "@/page/index/search.vue";
import {deepClone} from "@/util/util";
const columnEnum = { const columnEnum = {
'totalCount': '总数', "personCount": "服务总人数",
'otherCount': '机构登记数', "policyCount": "政策推送总数",
'registerCount': '总库(其他)', "jobCount": "岗位推送总数",
"serveCount": "跟踪服务次数",
"successfulCount": "服务成功次数"
} }
const pages = { total: 0, size: 10, currentPage: 1 } const pages = { total: 0, size: 10, currentPage: 1 }
const baseOptions = { const baseOptions = {
@@ -49,44 +53,66 @@ export default {
infoData: [], infoData: [],
visible: false, visible: false,
search: {}, search: {},
headColum: [], serveData: [],
headTitle: '',
searchServeId: '',
} }
}, },
created() { created() {
this.getList() this.getServeList().then((res) => {
if(res.length) {
this.headTitle = res[0].name
this.search.serveId = res[0].id
this.searchServeId = res[0].id
this.getList().then((records) => {
if(records.length) {
this.headTitle = records[0].name
}
})
}
})
}, },
computed: { computed: {
options() { options() {
const tableHead = this.headColum.map((item, index) => ({ const serveHead = [{
label: item.columnName, label: this.headTitle,
display:false, display: false,
children: Object.keys(columnEnum).map((key) => ({ children: Object.keys(columnEnum).map((key) => ({
label: columnEnum[key], label: columnEnum[key],
prop: `${index}_${key}`, prop: key,
display:false, display: false,
width: 120,
})) }))
})) }]
return { return {
...baseOptions, ...baseOptions,
height: 200,
width:200,
column: [{ column: [{
label: '机构名称', label: '服务名称',
prop: 'name', prop: 'serveId',
hide: true,
display: false,
type: 'select',
searchSpan: 6,
search: true, search: true,
fixed: true, searchClearable: false,
width: 200, dicData: this.serveData,
props: {
label: 'name',
value: 'id'
}
},{
label: '机构名称',
prop: 'companyName',
search: true,
searchSpan: 6,
}, },
...tableHead, ...serveHead,
{ {
label: '日期', label: '日期',
prop: 'date', prop: 'date',
hide: true, hide: true,
display: false, display: false,
type:'date', type:'date',
searchSpan: 8, searchSpan: 6,
searchRange:true, searchRange:true,
search:true, search:true,
}] }]
@@ -103,13 +129,27 @@ export default {
this.getList() this.getList()
}, },
searchChange(values, done) { searchChange(values, done) {
this.getList().then(() => {done()}) const ele = this.serveData.filter((item) => values.serveId === item.id)[0]
this.headTitle = ele.name
this.searchServeId = values.serveId
this.getList().then(() => done())
}, },
resetChange() { resetChange() {
this.search = {} this.search = { serveId: this.searchServeId }
let params = { size: 10, current: 1 } let params = { size: 10, current: 1 }
this.getList() this.getList()
}, },
getServeList() {
return new Promise(async (resolve, reject) => {
let resData = await listAllServe({id: '1762444035302395906'})
if(resData.data.code === 200) {
this.serveData = resData.data.data
resolve(resData.data.data)
} else {
reject()
}
})
},
getList(values) { getList(values) {
return new Promise(async(resolve, reject) => { return new Promise(async(resolve, reject) => {
this.visible = true this.visible = true
@@ -118,39 +158,27 @@ export default {
current: this.infoPages.currentPage, current: this.infoPages.currentPage,
...this.search, ...this.search,
} }
if( Array.isArray(this.search.date) && this.search.date.length ) { if( Array.isArray(this.search.date) && this.search.date.length ) {
const [stime, etime] = this.search.date const [stime, etime] = this.search.date
params.stime = dateFormat(stime, "yyyy-MM-dd") params.stime = dateFormat(stime, "yyyy-MM-dd")
params.etime = dateFormat(etime, "yyyy-MM-dd") params.etime = dateFormat(etime, "yyyy-MM-dd")
delete params.date delete params.date
} }
const copySearch = deepClone(params)
let resData = await unemploymentInsuranceServiceCount(params) let resData = await unemploymentInsuranceServiceCount(params)
if(resData.data.code === 200) { if(resData.data.code === 200) {
const { list, columnInfo } = resData.data.data const { records, current, total, size } = resData.data.data
const { current, size ,total, records } = list this.infoData = records
this.infoData = records.map((item) => ({
...item,
...this.decompose(item.list)
}))
console.log('infoData',this.infoData)
this.headColum = columnInfo
this.infoPages = { ...this.infoPages, currentPage: current, total, size} this.infoPages = { ...this.infoPages, currentPage: current, total, size}
this.visible = false; this.visible = false;
resolve(true) resolve(records)
setTimeout(() => {
this.search = copySearch
}, 0)
} else { } else {
reject() reject()
} }
}) })
},
decompose(list) {
let obj = {}
for (let i = 0; i < list.length; i++) {
const item = list[i]
Object.keys(item).forEach((vitem) => {
obj[`${i}_${vitem}`] = item[vitem]
})
}
return obj
} }
} }
} }

View File

@@ -0,0 +1,189 @@
<template>
<basic-container style="position: relative">
<avue-crud
:data="infoData"
:option="options"
:search.sync="search"
:table-loading="visible"
:page.sync="infoPages"
@search-change="searchChange"
@search-reset="resetChange"
@size-change="sizeChange"
@current-change="currentChange"
>
</avue-crud>
</basic-container>
</template>
<script>
import { listAllServe, vocationalServiceCount} from '@/api/report/report'
import CustomLoading from "@/components/Custom-Loading/index.vue";
import { dateFormat } from "@/util/date";
import search from "@/page/index/search.vue";
import {deepClone} from "@/util/util";
const columnEnum = {
"personCount": "服务总人数",
"policyCount": "政策推送总数",
"jobCount": "岗位推送总数",
"serveCount": "跟踪服务次数",
"successfulCount": "服务成功次数"
}
const pages = { total: 0, size: 10, currentPage: 1 }
const baseOptions = {
dateBtn: false,
addBtn: false,
editBtn: false,
delBtn: false,
height: "auto",
reserveSelection: false,
border: true,
columnBtn: false,
refreshBtn: false,
menu: false,
tip: false,
searchMenuSpan: 6,
selection: false,
headerAlign: 'center',
}
export default {
components: {CustomLoading},
data() {
return {
infoPages: Object.assign({}, pages),
infoData: [],
visible: false,
search: {},
serveData: [],
headTitle: '',
searchServeId: '',
}
},
created() {
this.getServeList().then((res) => {
if(res.length) {
this.headTitle = res[0].name
this.search.serveId = res[0].id
this.searchServeId = res[0].id
this.getList().then((records) => {
if(records.length) {
this.headTitle = records[0].name
}
})
}
})
},
computed: {
options() {
const serveHead = [{
label: this.headTitle,
display: false,
children: Object.keys(columnEnum).map((key) => ({
label: columnEnum[key],
prop: key,
display: false,
}))
}]
return {
...baseOptions,
column: [{
label: '服务名称',
prop: 'serveId',
hide: true,
display: false,
type: 'select',
searchSpan: 6,
search: true,
searchClearable: false,
dicData: this.serveData,
props: {
label: 'name',
value: 'id'
}
},{
label: '机构名称',
prop: 'companyName',
search: true,
searchSpan: 6,
},
...serveHead,
{
label: '日期',
prop: 'date',
hide: true,
display: false,
type:'date',
searchSpan: 6,
searchRange:true,
search:true,
}]
}
}
},
methods: {
sizeChange(size) {
this.infoPages.size = size
this.getList()
},
currentChange(page) {
this.infoPages.page = page
this.getList()
},
searchChange(values, done) {
const ele = this.serveData.filter((item) => values.serveId === item.id)[0]
this.headTitle = ele.name
this.searchServeId = values.serveId
this.getList().then(() => done())
},
resetChange() {
this.search = { serveId: this.searchServeId }
let params = { size: 10, current: 1 }
this.getList()
},
getServeList() {
return new Promise(async (resolve, reject) => {
let resData = await listAllServe({id: '1762444534038695938'})
if(resData.data.code === 200) {
this.serveData = resData.data.data
resolve(resData.data.data)
} else {
reject()
}
})
},
getList(values) {
return new Promise(async(resolve, reject) => {
this.visible = true
let params = {
size: this.infoPages.size,
current: this.infoPages.currentPage,
...this.search,
}
if( Array.isArray(this.search.date) && this.search.date.length ) {
const [stime, etime] = this.search.date
params.stime = dateFormat(stime, "yyyy-MM-dd")
params.etime = dateFormat(etime, "yyyy-MM-dd")
delete params.date
}
const copySearch = deepClone(params)
let resData = await vocationalServiceCount(params)
if(resData.data.code === 200) {
const { records, current, total, size } = resData.data.data
this.infoData = records
this.infoPages = { ...this.infoPages, currentPage: current, total, size}
this.visible = false;
resolve(records)
setTimeout(() => {
this.search = copySearch
}, 0)
} else {
reject()
}
})
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@@ -0,0 +1,190 @@
<template>
<basic-container style="position: relative">
<avue-crud
:data="infoData"
:option="options"
:search.sync="search"
:table-loading="visible"
:page.sync="infoPages"
@search-change="searchChange"
@search-reset="resetChange"
@size-change="sizeChange"
@current-change="currentChange"
>
</avue-crud>
</basic-container>
</template>
<script>
import {vocationalTrainingServiceCount , listAllServe} from '@/api/report/report'
import CustomLoading from "@/components/Custom-Loading/index.vue";
import { dateFormat } from "@/util/date";
import search from "@/page/index/search.vue";
import {deepClone} from "@/util/util";
const columnEnum = {
"personCount": "服务总人数",
"policyCount": "政策推送总数",
"jobCount": "岗位推送总数",
"serveCount": "跟踪服务次数",
"successfulCount": "服务成功次数"
}
const pages = { total: 0, size: 10, currentPage: 1 }
const baseOptions = {
dateBtn: false,
addBtn: false,
editBtn: false,
delBtn: false,
height: "auto",
reserveSelection: false,
border: true,
columnBtn: false,
refreshBtn: false,
menu: false,
tip: false,
searchMenuSpan: 6,
selection: false,
headerAlign: 'center',
}
// 职业培训
export default {
components: {CustomLoading},
data() {
return {
infoPages: Object.assign({}, pages),
infoData: [],
visible: false,
search: {},
serveData: [],
headTitle: '',
searchServeId: '',
}
},
created() {
this.getServeList().then((res) => {
if(res.length) {
this.headTitle = res[0].name
this.search.serveId = res[0].id
this.searchServeId = res[0].id
this.getList().then((records) => {
if(records.length) {
this.headTitle = records[0].name
}
})
}
})
},
computed: {
options() {
const serveHead = [{
label: this.headTitle,
display: false,
children: Object.keys(columnEnum).map((key) => ({
label: columnEnum[key],
prop: key,
display: false,
}))
}]
return {
...baseOptions,
column: [{
label: '服务名称',
prop: 'serveId',
hide: true,
display: false,
type:'select',
searchSpan: 6,
search: true,
searchClearable: false,
dicData: this.serveData,
props: {
label: 'name',
value: 'id'
},
},{
label: '机构名称',
prop: 'companyName',
search: true,
searchSpan: 6,
},
...serveHead,
{
label: '日期',
prop: 'date',
hide: true,
display: false,
type:'date',
searchSpan: 6,
searchRange:true,
search:true,
}]
}
}
},
methods: {
sizeChange(size) {
this.infoPages.size = size
this.getList()
},
currentChange(page) {
this.infoPages.page = page
this.getList()
},
searchChange(values, done) {
const ele = this.serveData.filter((item) => values.serveId === item.id)[0]
this.headTitle = ele.name
this.searchServeId = values.serveId
this.getList().then(() => done())
},
resetChange() {
this.search = { serveId: this.searchServeId }
let params = { size: 10, current: 1 }
this.getList()
},
getServeList() {
return new Promise(async (resolve, reject) => {
let resData = await listAllServe({id: '1762444363573792769'})
if(resData.data.code === 200) {
this.serveData = resData.data.data
resolve(resData.data.data)
} else {
reject()
}
})
},
getList(values) {
return new Promise(async(resolve, reject) => {
this.visible = true
let params = {
size: this.infoPages.size,
current: this.infoPages.currentPage,
...this.search,
}
if( Array.isArray(this.search.date) && this.search.date.length ) {
const [stime, etime] = this.search.date
params.stime = dateFormat(stime, "yyyy-MM-dd")
params.etime = dateFormat(etime, "yyyy-MM-dd")
delete params.date
}
const copySearch = deepClone(params)
let resData = await vocationalTrainingServiceCount(params)
if(resData.data.code === 200) {
const { records, current, total, size } = resData.data.data
this.infoData = records
this.infoPages = { ...this.infoPages, currentPage: current, total, size}
this.visible = false;
resolve(records)
setTimeout(() => {
this.search = copySearch
}, 0)
} else {
reject()
}
})
}
}
}
</script>
<style scoped lang="scss">
</style>