tianqian 2 years ago
parent
commit
2ee612da90
  1. 326
      src/views/dataBoard/sida/zy/gonggongList.vue

326
src/views/dataBoard/sida/zy/gonggongList.vue

@ -1,199 +1,191 @@
<template> <template>
<div> <div>
<cpt-tb <cpt-tb :col-list="colList" :loading="loading" :header="header" :list="list" :total="total"
:col-list="colList" @handleSizeChange="handleSizeChange" @handlePageNoChange="handlePageNoChange" @operate="showInfo"></cpt-tb>
: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 != ''" /> <detail @close="detailId = ''" :detailId="detailId" :detailType="detailType" v-if="detailId != ''" />
</div> </div>
</template> </template>
<script> <script>
import cptTb from '@/views/dataBoard/cpts/tb'; import cptTb from '@/views/dataBoard/cpts/tb';
import detail from './gonggongDetail'; import detail from './gonggongDetail';
import { requestPostBi } from '@/js/dai/request-bipass'; import {
import getQueryPara from 'dai-js/modules/getQueryPara'; requestPostBi
} from '@/js/dai/request-bipass';
export default { import getQueryPara from 'dai-js/modules/getQueryPara';
name: 'event-list', export default {
props: { name: 'event-list',
id: { props: {
type: String, id: {
default: '' type: String,
default: ''
},
detailType: {
type: String,
default: ''
}
}, },
detailType: { components: {
type: String, cptTb,
default: '' detail
} },
}, data() {
components: { return {
cptTb, detailId: '',
searchDate: '',
detail org_id: '',
}, listType: '', //
loading: true,
data() { page_size: parseInt(localStorage.getItem('dataBoard_PageSize')) || 20,
return { page_num: 1,
detailId: '', total: 0,
searchDate: '', srcTableData: [],
list: [],
org_id: '', sourceName: '0', //012 3
listType: '', // colList: [{
loading: true,
page_size: parseInt(localStorage.getItem('dataBoard_PageSize')) || 20,
page_num: 1,
total: 0,
srcTableData: [],
list: [],
sourceName: '0', //012 3
colList: [
{
align: 'left' align: 'left'
}, }, {
{
align: 'left' align: 'left'
}, }, {
{
align: 'left' align: 'left'
}, }, {
{
align: 'left' align: 'left'
}, }, {
{
align: 'left' align: 'left'
}, }, {
{
align: 'left' align: 'left'
}, }, {
{
align: 'left', align: 'left',
width: '10%' width: '10%'
} }],
], header: ['序号', '服务时间', '服务名称', '服务范围', '满意度', '状态', '操作']
header: ['序号', '服务时间', '服务名称', '服务范围', '满意度', '状态', '操作'] };
};
},
created() {
this.init()
},
methods: {
init() {
this.getList(), this.getCount();
}, },
created() {
showInfo(index) { this.init()
let item = this.srcTableData[index];
this.detailType = item.peop_child_type;
this.detailId = item.service_record_id;
// this.detailType = '';
// this.detailId = '1501821704551272449';
}, },
methods: {
handlePageNoChange(page_num) { init() {
this.page_num = page_num; this.getList(), this.getCount();
this.getList(); },
}, showInfo(index) {
let item = this.srcTableData[index];
handleSizeChange(page_size) { this.detailType = item.peop_child_type;
localStorage.setItem('dataBoard_page_size', page_size); this.detailId = item.service_record_id;
this.page_size = page_size; // this.detailType = '';
this.getList(); // this.detailId = '1501821704551272449';
}, },
handlePageNoChange(page_num) {
async getList() { this.page_num = page_num;
const { org_id, listType, page_num, page_size, searchDate } = this; this.getList();
const start_date = searchDate[0]; },
const end_date = searchDate[1]; handleSizeChange(page_size) {
localStorage.setItem('dataBoard_page_size', page_size);
let peop_type = this.type2; this.page_size = page_size;
this.getList();
this.loading = true; },
const url = 'common_service_list'; async getList() {
const { data, code, msg } = await requestPostBi( const {
url, 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: { queryParam: {
service_org_id: this.id, service_org_id: this.id,
service_org_type: this.detailType, service_org_type: service_org_type,
// source_name: '0', // source_name: '0',
page_size:page_size, page_size: page_size,
page_num:page_num page_num: page_num
} }
}, }, {
{
// mockId: 69852161 // 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 : '--',
// pendingcanceledassignedhave_orderfinished
{ type: 'operate', list: ['查看'] }
];
}); });
this.loading = false;
console.log('公共', this.list); if (code === 0) {
} else { this.srcTableData = data;
this.$message.error(msg); console.log('this.srcTableData ', this.srcTableData);
} this.list = data.map((item, index) => {
}, return [
index + 1,
async getCount() { // service_record_id
const { org_id, listType, page_num, page_size, searchDate } = this; item.service_time ? item.service_time : '--',
const start_date = searchDate[0]; item.service_name ? item.service_name : '--',
const end_date = searchDate[1]; item.scope_name ? item.scope_name : '--',
const url = 'common_service_list_total'; item.score ? item.score : '--',
let peop_type = this.type2; item.demand_status ? item.demand_status : '--',
const { data, code, msg } = await requestPostBi( // pendingcanceledassignedhave_orderfinished
url, {
{ 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: { queryParam: {
service_org_id: this.id, service_org_id: this.id,
service_org_type: this.detailType, service_org_type: service_org_type,
} }
}, }, {
{
//mockId: 63070189 //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> </script>
<style lang="scss" src="@/assets/scss/dataBoard/listBox.scss" scoped></style> <style lang="scss" src="@/assets/scss/dataBoard/listBox.scss" scoped></style>
Loading…
Cancel
Save