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

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

@ -1,27 +1,18 @@
<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';
export default {
name: 'event-list', name: 'event-list',
props: { props: {
id: { id: {
@ -35,114 +26,103 @@ export default {
}, },
components: { components: {
cptTb, cptTb,
detail detail
}, },
data() { data() {
return { return {
detailId: '', detailId: '',
searchDate: '', searchDate: '',
org_id: '', org_id: '',
listType: '', // listType: '', //
loading: true, loading: true,
page_size: parseInt(localStorage.getItem('dataBoard_PageSize')) || 20, page_size: parseInt(localStorage.getItem('dataBoard_PageSize')) || 20,
page_num: 1, page_num: 1,
total: 0, total: 0,
srcTableData: [], srcTableData: [],
list: [], list: [],
sourceName: '0', //012 3 sourceName: '0', //012 3
colList: [ 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() { created() {
this.init() this.init()
}, },
methods: { methods: {
init() { init() {
this.getList(), this.getCount(); this.getList(), this.getCount();
}, },
showInfo(index) { showInfo(index) {
let item = this.srcTableData[index]; let item = this.srcTableData[index];
this.detailType = item.peop_child_type; this.detailType = item.peop_child_type;
this.detailId = item.service_record_id; this.detailId = item.service_record_id;
// this.detailType = ''; // this.detailType = '';
// this.detailId = '1501821704551272449'; // this.detailId = '1501821704551272449';
}, },
handlePageNoChange(page_num) { handlePageNoChange(page_num) {
this.page_num = page_num; this.page_num = page_num;
this.getList(); this.getList();
}, },
handleSizeChange(page_size) { handleSizeChange(page_size) {
localStorage.setItem('dataBoard_page_size', page_size); localStorage.setItem('dataBoard_page_size', page_size);
this.page_size = page_size; this.page_size = page_size;
this.getList(); this.getList();
}, },
async getList() { async getList() {
const { org_id, listType, page_num, page_size, searchDate } = this; const {
org_id,
listType,
page_num,
page_size,
searchDate
} = this;
const start_date = searchDate[0]; const start_date = searchDate[0];
const end_date = searchDate[1]; const end_date = searchDate[1];
let peop_type = this.type2; 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; this.loading = true;
const url = 'common_service_list'; const url = 'common_service_list';
const { data, code, msg } = await requestPostBi( const {
url, 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; this.loading = false;
if (code === 0) { if (code === 0) {
this.srcTableData = data; this.srcTableData = data;
console.log('this.srcTableData ', this.srcTableData); console.log('this.srcTableData ', this.srcTableData);
this.list = data.map((item, index) => { this.list = data.map((item, index) => {
return [ return [
index + 1, index + 1,
@ -153,35 +133,49 @@ export default {
item.score ? item.score : '--', item.score ? item.score : '--',
item.demand_status ? item.demand_status : '--', item.demand_status ? item.demand_status : '--',
// pendingcanceledassignedhave_orderfinished // pendingcanceledassignedhave_orderfinished
{ type: 'operate', list: ['查看'] } {
type: 'operate',
list: ['查看']
}
]; ];
}); });
console.log('公共', this.list); console.log('公共', this.list);
} else { } else {
this.$message.error(msg); this.$message.error(msg);
} }
}, },
async getCount() { async getCount() {
const { org_id, listType, page_num, page_size, searchDate } = this; const {
org_id,
listType,
page_num,
page_size,
searchDate
} = this;
const start_date = searchDate[0]; const start_date = searchDate[0];
const end_date = searchDate[1]; const end_date = searchDate[1];
const url = 'common_service_list_total'; const url = 'common_service_list_total';
let peop_type = this.type2; let peop_type = this.type2;
const { data, code, msg } = await requestPostBi( let service_org_type = "";
url, 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) { if (code === 0) {
this.total = parseInt(data[0].total); this.total = parseInt(data[0].total);
} else { } else {
@ -189,11 +183,9 @@ export default {
} }
} }
}, },
destroyed() { destroyed() {
console.log('我已经离开了!'); 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