1 changed files with 160 additions and 168 deletions
@ -1,199 +1,191 @@ |
|||
<template> |
|||
<div> |
|||
<cpt-tb |
|||
:col-list="colList" |
|||
:loading="loading" |
|||
:header="header" |
|||
:list="list" |
|||
:total="total" |
|||
@handleSizeChange="handleSizeChange" |
|||
@handlePageNoChange="handlePageNoChange" |
|||
@operate="showInfo" |
|||
></cpt-tb> |
|||
|
|||
<cpt-tb :col-list="colList" :loading="loading" :header="header" :list="list" :total="total" |
|||
@handleSizeChange="handleSizeChange" @handlePageNoChange="handlePageNoChange" @operate="showInfo"></cpt-tb> |
|||
<detail @close="detailId = ''" :detailId="detailId" :detailType="detailType" v-if="detailId != ''" /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import cptTb from '@/views/dataBoard/cpts/tb'; |
|||
import detail from './gonggongDetail'; |
|||
import { requestPostBi } from '@/js/dai/request-bipass'; |
|||
import getQueryPara from 'dai-js/modules/getQueryPara'; |
|||
|
|||
export default { |
|||
name: 'event-list', |
|||
props: { |
|||
id: { |
|||
type: String, |
|||
default: '' |
|||
import cptTb from '@/views/dataBoard/cpts/tb'; |
|||
import detail from './gonggongDetail'; |
|||
import { |
|||
requestPostBi |
|||
} from '@/js/dai/request-bipass'; |
|||
import getQueryPara from 'dai-js/modules/getQueryPara'; |
|||
export default { |
|||
name: 'event-list', |
|||
props: { |
|||
id: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
detailType: { |
|||
type: String, |
|||
default: '' |
|||
} |
|||
}, |
|||
detailType: { |
|||
type: String, |
|||
default: '' |
|||
} |
|||
}, |
|||
components: { |
|||
cptTb, |
|||
|
|||
detail |
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
detailId: '', |
|||
searchDate: '', |
|||
|
|||
org_id: '', |
|||
listType: '', // 流动 常驻 全部 |
|||
|
|||
loading: true, |
|||
page_size: parseInt(localStorage.getItem('dataBoard_PageSize')) || 20, |
|||
|
|||
page_num: 1, |
|||
total: 0, |
|||
srcTableData: [], |
|||
list: [], |
|||
sourceName: '0', //0公共服务,1共性需求,2政策找人 3服务找人 |
|||
colList: [ |
|||
{ |
|||
components: { |
|||
cptTb, |
|||
detail |
|||
}, |
|||
data() { |
|||
return { |
|||
detailId: '', |
|||
searchDate: '', |
|||
org_id: '', |
|||
listType: '', // 流动 常驻 全部 |
|||
loading: true, |
|||
page_size: parseInt(localStorage.getItem('dataBoard_PageSize')) || 20, |
|||
page_num: 1, |
|||
total: 0, |
|||
srcTableData: [], |
|||
list: [], |
|||
sourceName: '0', //0公共服务,1共性需求,2政策找人 3服务找人 |
|||
colList: [{ |
|||
align: 'left' |
|||
}, |
|||
{ |
|||
}, { |
|||
align: 'left' |
|||
}, |
|||
{ |
|||
}, { |
|||
align: 'left' |
|||
}, |
|||
{ |
|||
}, { |
|||
align: 'left' |
|||
}, |
|||
{ |
|||
}, { |
|||
align: 'left' |
|||
}, |
|||
{ |
|||
}, { |
|||
align: 'left' |
|||
}, |
|||
|
|||
{ |
|||
}, { |
|||
align: 'left', |
|||
width: '10%' |
|||
} |
|||
], |
|||
header: ['序号', '服务时间', '服务名称', '服务范围', '满意度', '状态', '操作'] |
|||
}; |
|||
}, |
|||
created() { |
|||
this.init() |
|||
}, |
|||
|
|||
methods: { |
|||
init() { |
|||
this.getList(), this.getCount(); |
|||
}], |
|||
header: ['序号', '服务时间', '服务名称', '服务范围', '满意度', '状态', '操作'] |
|||
}; |
|||
}, |
|||
|
|||
showInfo(index) { |
|||
let item = this.srcTableData[index]; |
|||
this.detailType = item.peop_child_type; |
|||
this.detailId = item.service_record_id; |
|||
|
|||
// this.detailType = '志愿者'; |
|||
// this.detailId = '1501821704551272449'; |
|||
created() { |
|||
this.init() |
|||
}, |
|||
|
|||
handlePageNoChange(page_num) { |
|||
this.page_num = page_num; |
|||
this.getList(); |
|||
}, |
|||
|
|||
handleSizeChange(page_size) { |
|||
localStorage.setItem('dataBoard_page_size', page_size); |
|||
this.page_size = page_size; |
|||
this.getList(); |
|||
}, |
|||
|
|||
async getList() { |
|||
const { org_id, listType, page_num, page_size, searchDate } = this; |
|||
const start_date = searchDate[0]; |
|||
const end_date = searchDate[1]; |
|||
|
|||
let peop_type = this.type2; |
|||
|
|||
this.loading = true; |
|||
const url = 'common_service_list'; |
|||
const { data, code, msg } = await requestPostBi( |
|||
url, |
|||
{ |
|||
methods: { |
|||
init() { |
|||
this.getList(), this.getCount(); |
|||
}, |
|||
showInfo(index) { |
|||
let item = this.srcTableData[index]; |
|||
this.detailType = item.peop_child_type; |
|||
this.detailId = item.service_record_id; |
|||
// this.detailType = '志愿者'; |
|||
// this.detailId = '1501821704551272449'; |
|||
}, |
|||
handlePageNoChange(page_num) { |
|||
this.page_num = page_num; |
|||
this.getList(); |
|||
}, |
|||
handleSizeChange(page_size) { |
|||
localStorage.setItem('dataBoard_page_size', page_size); |
|||
this.page_size = page_size; |
|||
this.getList(); |
|||
}, |
|||
async getList() { |
|||
const { |
|||
org_id, |
|||
listType, |
|||
page_num, |
|||
page_size, |
|||
searchDate |
|||
} = this; |
|||
const start_date = searchDate[0]; |
|||
const end_date = searchDate[1]; |
|||
let peop_type = this.type2; |
|||
let service_org_type = ""; |
|||
if (this.detailType == "volunteer") { |
|||
service_org_type = "ic_user_volunteer" |
|||
} else if (this.detailType == "community_org") { |
|||
service_org_type = "party_unit" |
|||
} else if (this.detailType == "party_unit") { |
|||
service_org_type = "community_org" |
|||
} |
|||
this.loading = true; |
|||
const url = 'common_service_list'; |
|||
const { |
|||
data, |
|||
code, |
|||
msg |
|||
} = await requestPostBi(url, { |
|||
queryParam: { |
|||
service_org_id: this.id, |
|||
service_org_type: this.detailType, |
|||
service_org_type: service_org_type, |
|||
// source_name: '0', |
|||
page_size:page_size, |
|||
page_num:page_num |
|||
page_size: page_size, |
|||
page_num: page_num |
|||
} |
|||
}, |
|||
{ |
|||
}, { |
|||
// mockId: 69852161 |
|||
} |
|||
); |
|||
|
|||
this.loading = false; |
|||
|
|||
if (code === 0) { |
|||
this.srcTableData = data; |
|||
console.log('this.srcTableData ', this.srcTableData); |
|||
|
|||
this.list = data.map((item, index) => { |
|||
return [ |
|||
index + 1, |
|||
// service_record_id |
|||
item.service_time ? item.service_time : '--', |
|||
item.service_name ? item.service_name : '--', |
|||
item.scope_name ? item.scope_name : '--', |
|||
item.score ? item.score : '--', |
|||
item.demand_status ? item.demand_status : '--', |
|||
// 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished; |
|||
{ type: 'operate', list: ['查看'] } |
|||
]; |
|||
}); |
|||
|
|||
console.log('公共', this.list); |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
async getCount() { |
|||
const { org_id, listType, page_num, page_size, searchDate } = this; |
|||
const start_date = searchDate[0]; |
|||
const end_date = searchDate[1]; |
|||
const url = 'common_service_list_total'; |
|||
let peop_type = this.type2; |
|||
const { data, code, msg } = await requestPostBi( |
|||
url, |
|||
{ |
|||
this.loading = false; |
|||
if (code === 0) { |
|||
this.srcTableData = data; |
|||
console.log('this.srcTableData ', this.srcTableData); |
|||
this.list = data.map((item, index) => { |
|||
return [ |
|||
index + 1, |
|||
// service_record_id |
|||
item.service_time ? item.service_time : '--', |
|||
item.service_name ? item.service_name : '--', |
|||
item.scope_name ? item.scope_name : '--', |
|||
item.score ? item.score : '--', |
|||
item.demand_status ? item.demand_status : '--', |
|||
// 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished; |
|||
{ |
|||
type: 'operate', |
|||
list: ['查看'] |
|||
} |
|||
]; |
|||
}); |
|||
console.log('公共', this.list); |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
async getCount() { |
|||
const { |
|||
org_id, |
|||
listType, |
|||
page_num, |
|||
page_size, |
|||
searchDate |
|||
} = this; |
|||
const start_date = searchDate[0]; |
|||
const end_date = searchDate[1]; |
|||
const url = 'common_service_list_total'; |
|||
let peop_type = this.type2; |
|||
let service_org_type = ""; |
|||
if (this.detailType == "volunteer") { |
|||
service_org_type = "ic_user_volunteer" |
|||
} else if (this.detailType == "community_org") { |
|||
service_org_type = "party_unit" |
|||
} else if (this.detailType == "party_unit") { |
|||
service_org_type = "community_org" |
|||
} |
|||
const { |
|||
data, |
|||
code, |
|||
msg |
|||
} = await requestPostBi(url, { |
|||
queryParam: { |
|||
service_org_id: this.id, |
|||
service_org_type: this.detailType, |
|||
service_org_type: service_org_type, |
|||
} |
|||
}, |
|||
{ |
|||
}, { |
|||
//mockId: 63070189 |
|||
}); |
|||
if (code === 0) { |
|||
this.total = parseInt(data[0].total); |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
); |
|||
|
|||
if (code === 0) { |
|||
this.total = parseInt(data[0].total); |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
destroyed() { |
|||
console.log('我已经离开了!'); |
|||
} |
|||
}, |
|||
|
|||
destroyed() { |
|||
console.log('我已经离开了!'); |
|||
} |
|||
}; |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" src="@/assets/scss/dataBoard/listBox.scss" scoped></style> |
Loading…
Reference in new issue