12 changed files with 1452 additions and 483 deletions
@ -0,0 +1,156 @@ |
|||||
|
<template> |
||||
|
<popup :title="title" @close="handleClose"> |
||||
|
<template v-slot:cnt> |
||||
|
<div class="m-info"> |
||||
|
<div class="row"> |
||||
|
<div class="item"> |
||||
|
<div class="field">需求类型:</div> |
||||
|
<div class="value">{{ info.category }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="item"> |
||||
|
<div class="field">需求内容:</div> |
||||
|
<div class="value">{{ info.content }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="item"> |
||||
|
<div class="field">状态:</div> |
||||
|
<div class="value">{{ info.demand_status }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="item"> |
||||
|
<div class="field">需求人:</div> |
||||
|
<div class="value">{{ info.demand_user_name }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="item"> |
||||
|
<div class="field">完成情况:</div> |
||||
|
<div class="value">{{ info.finish_result }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="item"> |
||||
|
<div class="field">所属网格:</div> |
||||
|
<div class="value">{{ info.grid }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="item"> |
||||
|
<div class="field">备注:</div> |
||||
|
<div class="value">{{ info.remark }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="item"> |
||||
|
<div class="field">上报时间:</div> |
||||
|
<div class="value">{{ info.report_time }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="item"> |
||||
|
<div class="field">上报类型:</div> |
||||
|
<div class="value">{{ info.report_type }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">上报人:</div> |
||||
|
<div class="value">{{ info.report_user_name }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">联系电话:</div> |
||||
|
<div class="value">{{ info.report_user_mobile }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">评价:</div> |
||||
|
<div class="value">{{ info.score }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="item"> |
||||
|
<div class="field">服务方:</div> |
||||
|
<div class="value">{{ info.server_name }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">服务时间:</div> |
||||
|
<div class="value">{{ info.service_start_time }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
</popup> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { Scene } from '@antv/l7'; |
||||
|
import popup from '@/views/dataBoard/cpts/popup'; |
||||
|
import { GaodeMap, Map } from '@antv/l7-maps'; |
||||
|
import { requestPostBi } from '@/js/dai/request-bipass'; |
||||
|
|
||||
|
export default { |
||||
|
name: 'eventdetail', |
||||
|
props: { |
||||
|
detailId: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
detailType: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
components: { popup }, |
||||
|
created() {}, |
||||
|
data() { |
||||
|
return { |
||||
|
progress: [], |
||||
|
info: {}, |
||||
|
title: '个性服务详情', |
||||
|
currentTabIndex: 0, |
||||
|
startTabIndex: 0, |
||||
|
currentTabIndex2: 0, |
||||
|
startTabIndex2: 0, |
||||
|
BaseTabList: ['教育信息', '兴趣爱好', '宗教', '健康', '工作', '经济状况', '居住', '家庭'], |
||||
|
tabList: [], |
||||
|
tabList2: [], |
||||
|
userArray: [], |
||||
|
userList: {} |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
this.getApiData(); |
||||
|
}, |
||||
|
computed: {}, |
||||
|
methods: { |
||||
|
handleClose() { |
||||
|
this.$emit('close'); |
||||
|
}, |
||||
|
|
||||
|
async getApiData() { |
||||
|
this.getInfo(); |
||||
|
}, |
||||
|
|
||||
|
// 根据房屋id获取详情 |
||||
|
async getInfo() { |
||||
|
const url = 'user_service_intro'; |
||||
|
|
||||
|
const { data, code, msg } = await requestPostBi( |
||||
|
url, |
||||
|
{ |
||||
|
user_demand_id: this.detailId |
||||
|
}, |
||||
|
{ |
||||
|
// mockId: 69964568, |
||||
|
} |
||||
|
); |
||||
|
if (code === 0) { |
||||
|
this.info = { ...this.info, ...data[0] }; |
||||
|
console.log('this.info', this.info); |
||||
|
} else { |
||||
|
this.$message.error(msg); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.m-info .row .item .field { |
||||
|
width: 120px !important; |
||||
|
} |
||||
|
</style> |
||||
|
<style lang="scss" src="@/assets/scss/dataBoard/popup-info.scss" scoped></style> |
@ -0,0 +1,198 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<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 './gexingDetail'; |
||||
|
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: '' |
||||
|
} |
||||
|
}, |
||||
|
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: [], |
||||
|
|
||||
|
colList: [ |
||||
|
{ |
||||
|
align: 'left' |
||||
|
}, |
||||
|
{ |
||||
|
align: 'left' |
||||
|
}, |
||||
|
{ |
||||
|
align: 'left' |
||||
|
}, |
||||
|
{ |
||||
|
align: 'left' |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
align: 'left' |
||||
|
}, |
||||
|
{ |
||||
|
align: 'left' |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
align: 'left', |
||||
|
width: '10%' |
||||
|
} |
||||
|
], |
||||
|
header: ['序号', '服务时间', '需求类型', '需求内容', '满意度', '状态', '操作'] |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
this.init(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
init() { |
||||
|
console.log("个性列表",this.id,this.detailType) |
||||
|
this.getList(), this.getCount(); |
||||
|
}, |
||||
|
|
||||
|
showInfo(index) { |
||||
|
let item = this.srcTableData[index]; |
||||
|
this.detailType = item.peop_child_type; |
||||
|
this.detailId = item.user_demand_id; |
||||
|
// ceshi |
||||
|
// 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; |
||||
|
|
||||
|
let peop_type = this.type2; |
||||
|
|
||||
|
this.loading = true; |
||||
|
const url = 'self_service_list'; |
||||
|
const { data, code, msg } = await requestPostBi( |
||||
|
url, |
||||
|
{ |
||||
|
queryParam: { |
||||
|
user_demand_id: this.id, |
||||
|
service_type: this.detailType, |
||||
|
page_size:page_size, |
||||
|
page_num:page_num |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
// mockId: 69844538 |
||||
|
} |
||||
|
); |
||||
|
|
||||
|
this.loading = false; |
||||
|
|
||||
|
if (code === 0) { |
||||
|
this.srcTableData = data; |
||||
|
|
||||
|
this.list = data.map((item, index) => { |
||||
|
return [ |
||||
|
index + 1, |
||||
|
item.service_time ? item.service_time : '--', |
||||
|
// item.user_demand_id ? item.user_demand_id : '--', |
||||
|
item.demand_category ? item.demand_category : '--', |
||||
|
item.content ? item.content : '--', |
||||
|
item.score ? item.score : '--', |
||||
|
item.demand_status ? item.demand_status : '--', |
||||
|
// 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished; |
||||
|
{ type: 'operate', list: ['查看'] } |
||||
|
]; |
||||
|
}); |
||||
|
|
||||
|
console.log('this.list', 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 = 'self_service_list_total'; |
||||
|
let peop_type = this.type2; |
||||
|
const { data, code, msg } = await requestPostBi( |
||||
|
url, |
||||
|
{ |
||||
|
queryParam: { |
||||
|
user_demand_id: this.id, |
||||
|
service_type: this.detailType, |
||||
|
// page_size:page_size, |
||||
|
// page_num:page_num |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
// mockId: 63070189, |
||||
|
} |
||||
|
); |
||||
|
|
||||
|
if (code === 0) { |
||||
|
this.total = parseInt(data[0].total); |
||||
|
} else { |
||||
|
this.$message.error(msg); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
destroyed() { |
||||
|
console.log('我已经离开了!'); |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" src="@/assets/scss/dataBoard/listBox.scss" scoped></style> |
@ -0,0 +1,133 @@ |
|||||
|
<template> |
||||
|
<popup :title="title" @close="handleClose"> |
||||
|
<template v-slot:cnt> |
||||
|
<div class="m-info"> |
||||
|
<div class="row"> |
||||
|
<div class="item"> |
||||
|
|
||||
|
<div class="field">政策依据:</div> |
||||
|
<div class="value">{{ info.policy_name }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="item"> |
||||
|
<div class="field">联系方式:</div> |
||||
|
<div class="value">{{ info.principal_contact }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="item"> |
||||
|
<div class="field">经办人:</div> |
||||
|
<div class="value">{{ info.principal_name }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="item"> |
||||
|
<div class="field">备注:</div> |
||||
|
<div class="value">{{ info.remark }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="item"> |
||||
|
<div class="field">服务范围:</div> |
||||
|
<div class="value">{{ info.scope_name }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="item"> |
||||
|
<div class="field">服务名称:</div> |
||||
|
<div class="value">{{ info.service_name }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="item"> |
||||
|
<div class="field">服务组织:</div> |
||||
|
<div class="value">{{ info.service_org_name }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<!-- <div class="item"> |
||||
|
<div class="field">公共服务主键:</div> |
||||
|
<div class="value">{{ info.service_record_id }}</div> |
||||
|
</div> --> |
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
</popup> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { Scene } from '@antv/l7'; |
||||
|
import popup from '@/views/dataBoard/cpts/popup'; |
||||
|
import { GaodeMap, Map } from '@antv/l7-maps'; |
||||
|
import { requestPostBi } from '@/js/dai/request-bipass'; |
||||
|
|
||||
|
export default { |
||||
|
name: 'eventdetail', |
||||
|
props: { |
||||
|
detailId: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
detailType: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
components: { popup }, |
||||
|
created() {}, |
||||
|
data() { |
||||
|
return { |
||||
|
progress: [], |
||||
|
info: {}, |
||||
|
title: '公共服务详情', |
||||
|
currentTabIndex: 0, |
||||
|
startTabIndex: 0, |
||||
|
currentTabIndex2: 0, |
||||
|
startTabIndex2: 0, |
||||
|
BaseTabList: ['教育信息', '兴趣爱好', '宗教', '健康', '工作', '经济状况', '居住', '家庭'], |
||||
|
tabList: [], |
||||
|
tabList2: [], |
||||
|
userArray: [], |
||||
|
userList: {} |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
this.getApiData(); |
||||
|
}, |
||||
|
computed: {}, |
||||
|
methods: { |
||||
|
handleClose() { |
||||
|
this.$emit('close'); |
||||
|
}, |
||||
|
|
||||
|
async getApiData() { |
||||
|
this.getInfo(); |
||||
|
}, |
||||
|
|
||||
|
// 根据房屋id获取详情 |
||||
|
async getInfo() { |
||||
|
const url = 'common_service_intro'; |
||||
|
|
||||
|
const { data, code, msg } = await requestPostBi( |
||||
|
url, |
||||
|
{ |
||||
|
service_record_id: this.detailId |
||||
|
}, |
||||
|
{ |
||||
|
// mockId: 69980718, |
||||
|
} |
||||
|
); |
||||
|
if (code === 0) { |
||||
|
this.info = { ...this.info, ...data[0] }; |
||||
|
console.log('this.info', this.info); |
||||
|
} else { |
||||
|
this.$message.error(msg); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.m-info .row .item .field { |
||||
|
width: 120px !important; |
||||
|
} |
||||
|
</style> |
||||
|
<style lang="scss" src="@/assets/scss/dataBoard/popup-info.scss" scoped></style> |
@ -0,0 +1,199 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<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: '' |
||||
|
}, |
||||
|
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: [ |
||||
|
{ |
||||
|
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(); |
||||
|
}, |
||||
|
|
||||
|
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; |
||||
|
|
||||
|
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, |
||||
|
// source_name: '0', |
||||
|
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, |
||||
|
{ |
||||
|
queryParam: { |
||||
|
service_org_id: this.id, |
||||
|
service_org_type: this.detailType, |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
mockId: 63070189 |
||||
|
} |
||||
|
); |
||||
|
|
||||
|
if (code === 0) { |
||||
|
this.total = parseInt(data[0].total); |
||||
|
} else { |
||||
|
this.$message.error(msg); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
destroyed() { |
||||
|
console.log('我已经离开了!'); |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" src="@/assets/scss/dataBoard/listBox.scss" scoped></style> |
@ -0,0 +1,295 @@ |
|||||
|
<template> |
||||
|
<div class="g-pgi"> |
||||
|
<cpt-bread :separator="'/'" @tap="handleClickBreadItem" :breadList="breadList"></cpt-bread> |
||||
|
|
||||
|
<div class="m-title"> |
||||
|
<img class="title_img" src="@/assets/images/index/list-logo.png" alt /> |
||||
|
<div class="tip_title">{{ tableTitle }}</div> |
||||
|
<div class="title_line"></div> |
||||
|
<div class="second-select" style="position:absolute;margin-left:300px;"> |
||||
|
<el-select v-model="listType" @change="changList"> |
||||
|
<el-option value="个性需求">个性需求</el-option> |
||||
|
<el-option value="共性需求">共性需求</el-option> |
||||
|
</el-select> |
||||
|
|
||||
|
<el-select v-model="type2" @change="init" :clearable="true" class="left10"> |
||||
|
<el-option value="全部">全部</el-option> |
||||
|
<template v-if="listType == '个性需求'"> |
||||
|
<el-option value="商家支撑">商家支撑</el-option> |
||||
|
<el-option value="服务支撑">服务支撑</el-option> |
||||
|
<el-option value="政府支撑">政府支撑</el-option> |
||||
|
</template> |
||||
|
<template v-if="listType == '共性需求'"> |
||||
|
<el-option value="社区养老">社区养老</el-option> |
||||
|
<el-option value="社会保障">社会保障</el-option> |
||||
|
<el-option value="社区救助">社区救助</el-option> |
||||
|
<el-option value="健康医疗">健康医疗</el-option> |
||||
|
<el-option value="社区安全">社区安全</el-option> |
||||
|
<el-option value="社区卫生">社区卫生</el-option> |
||||
|
<el-option value="社区环境">社区环境</el-option> |
||||
|
<el-option value="社区治安">社区治安</el-option> |
||||
|
<el-option value="社区文化">社区文化</el-option> |
||||
|
</template> |
||||
|
</el-select> |
||||
|
<div class="m-search2 left10" style="display: inline-block;"> |
||||
|
<el-date-picker |
||||
|
type="daterange" |
||||
|
unlink-panels |
||||
|
value-format="yyyy-MM-dd" |
||||
|
@change="init" |
||||
|
v-model="searchDate" |
||||
|
range-separator="至" |
||||
|
start-placeholder="开始日期" |
||||
|
end-placeholder="结束日期" |
||||
|
></el-date-picker> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<cpt-tb |
||||
|
:col-list="colList" |
||||
|
:loading="loading" |
||||
|
:header="header" |
||||
|
:list="list" |
||||
|
:total="total" |
||||
|
@handleSizeChange="handleSizeChange" |
||||
|
@handlePageNoChange="handlePageNoChange" |
||||
|
@operate="showInfo" |
||||
|
></cpt-tb> |
||||
|
|
||||
|
<needdetail @close="detailId = ''" :detailId="detailId" :detailType="detailType" v-if="detailId != ''" /> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import cptTb from '@/views/dataBoard/cpts/tb'; |
||||
|
import cptBread from '@/views/dataBoard/renfang/cpts/bread'; |
||||
|
import needdetail from './need-detail'; |
||||
|
import { requestPostBi } from '@/js/dai/request-bipass'; |
||||
|
import getQueryPara from 'dai-js/modules/getQueryPara'; |
||||
|
|
||||
|
export default { |
||||
|
name: 'need-list', |
||||
|
|
||||
|
components: { |
||||
|
cptTb, |
||||
|
cptBread, |
||||
|
needdetail |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
searchDate: [], |
||||
|
detailId: '', |
||||
|
|
||||
|
detailType: '', |
||||
|
breadList: [ |
||||
|
{ |
||||
|
type: 'back', |
||||
|
meta: { |
||||
|
title: '四大清单' |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
meta: { |
||||
|
title: '需求列表' |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
type1: '', |
||||
|
type2: '全部', |
||||
|
tableTitle: '需求列表', |
||||
|
searchName: '', |
||||
|
|
||||
|
orgLevel: '', |
||||
|
org_id: '', |
||||
|
listType: '', // 流动 常驻 全部 |
||||
|
|
||||
|
loading: true, |
||||
|
page_size: parseInt(localStorage.getItem('dataBoard_PageSize')) || 20, |
||||
|
|
||||
|
page_num: 1, |
||||
|
total: 0, |
||||
|
srcTableData: [], |
||||
|
list: [], |
||||
|
|
||||
|
colList: [ |
||||
|
{ |
||||
|
align: 'left', |
||||
|
width: '5%' |
||||
|
}, |
||||
|
{ |
||||
|
align: 'left', |
||||
|
width: '10%' |
||||
|
}, |
||||
|
{ |
||||
|
align: 'left' |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
align: 'left', |
||||
|
width: '10%' |
||||
|
}, |
||||
|
{ |
||||
|
align: 'left', |
||||
|
width: '10%' |
||||
|
}, |
||||
|
{ |
||||
|
align: 'left', |
||||
|
width: '10%' |
||||
|
} |
||||
|
], |
||||
|
|
||||
|
header: ['序号', '需求类型', '需求内容', '状态', '上报时间', '操作'] |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
activated() { |
||||
|
this.org_id = getQueryPara('org_id'); |
||||
|
this.listType = getQueryPara('type'); |
||||
|
this.type2 = getQueryPara('type2'); |
||||
|
this.searchDate = [getQueryPara('start_date'), getQueryPara('end_date')]; |
||||
|
this.page_num = 1; |
||||
|
// this.getDate(); |
||||
|
this.init(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
init() { |
||||
|
if (!this.searchDate) { |
||||
|
this.searchDate = ['', '']; |
||||
|
} |
||||
|
|
||||
|
this.getList(); |
||||
|
this.getCount(); |
||||
|
}, |
||||
|
getDate() { |
||||
|
var nowDate = new Date(); |
||||
|
var year = nowDate.getFullYear(); |
||||
|
var month = nowDate.getMonth() + 1; |
||||
|
var day = nowDate.getDate(); |
||||
|
this.searchDate = [`${year}-${1}-${1}`, `${year}-${month}-${day}`]; |
||||
|
}, |
||||
|
changList() { |
||||
|
this.type2 = '全部'; |
||||
|
this.init(); |
||||
|
}, |
||||
|
handleClickBreadItem({ item }) { |
||||
|
if (item.type == 'back') { |
||||
|
this.$router.back(); |
||||
|
} |
||||
|
}, |
||||
|
showInfo(index) { |
||||
|
let item = this.srcTableData[index]; |
||||
|
console.log("index",index) |
||||
|
this.detailType = item.need_type; |
||||
|
this.detailId = item.need_id; |
||||
|
}, |
||||
|
|
||||
|
handlePageNoChange(page_num) { |
||||
|
this.page_num = page_num; |
||||
|
this.init(); |
||||
|
}, |
||||
|
handleSizeChange(page_size) { |
||||
|
localStorage.setItem('dataBoard_page_size', page_size); |
||||
|
this.page_size = page_size; |
||||
|
this.init(); |
||||
|
}, |
||||
|
|
||||
|
async getList() { |
||||
|
const { org_id, listType, page_num, page_size, searchDate } = this; |
||||
|
const start_date = searchDate[0]; |
||||
|
const end_date = searchDate[1]; |
||||
|
this.loading = true; |
||||
|
const url = 'need_list'; |
||||
|
const { data, code, msg } = await requestPostBi( |
||||
|
url, |
||||
|
{ |
||||
|
queryParam: { |
||||
|
org_id, |
||||
|
type: this.type2, |
||||
|
page_num, |
||||
|
page_size, |
||||
|
start_date, |
||||
|
end_date |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
// mockId: 60068051, |
||||
|
} |
||||
|
); |
||||
|
|
||||
|
this.loading = false; |
||||
|
|
||||
|
if (code === 0) { |
||||
|
this.srcTableData = data; |
||||
|
console.log('this.srcTableData ', this.srcTableData); |
||||
|
|
||||
|
this.list = data.map((item, index) => { |
||||
|
let a = ''; |
||||
|
|
||||
|
if (item.status == '已接单') { |
||||
|
a = 'green'; |
||||
|
} else if (item.status == '已完成') { |
||||
|
a = 'green'; |
||||
|
} else if (item.status == '待处理') { |
||||
|
a = 'orange'; |
||||
|
} |
||||
|
let obj = { |
||||
|
name: item.status, |
||||
|
class: a |
||||
|
}; |
||||
|
|
||||
|
return [ |
||||
|
index + 1, |
||||
|
item.need_type ? item.need_type : '--', |
||||
|
item.content ? item.content : '--', |
||||
|
item.status ? obj : '--', |
||||
|
// item.status=="已接单"?"<span>已接2单</span>":"<span>已接单2</span>", |
||||
|
item.date ? item.date : '--', |
||||
|
{ type: 'operate', list: ['查看'] } |
||||
|
]; |
||||
|
}); |
||||
|
// console.log('this.list', 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 = 'need_list_num'; |
||||
|
|
||||
|
const { data, code, msg } = await requestPostBi( |
||||
|
url, |
||||
|
{ |
||||
|
queryParam: { |
||||
|
org_id, |
||||
|
type: this.type2, |
||||
|
start_date, |
||||
|
end_date |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
// mockId: 63070189, |
||||
|
}, |
||||
|
console.log('ddd') |
||||
|
); |
||||
|
|
||||
|
if (code === 0) { |
||||
|
this.total = parseInt(data[0].total); |
||||
|
console.log(this.total); |
||||
|
} else { |
||||
|
this.$message.error(msg); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
destroyed() { |
||||
|
console.log('我已经离开了!'); |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" src="@/assets/scss/dataBoard/listBox.scss" scoped></style> |
@ -0,0 +1,260 @@ |
|||||
|
<template> |
||||
|
<popup title="需求详情" @close="handleClose"> |
||||
|
<template v-slot:cnt> |
||||
|
<div class="m-info" v-if="detailType == '政府支撑'"> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<div class="subtitle"> |
||||
|
<i class="i-chunk"></i> |
||||
|
事件详情 |
||||
|
<i class="i-line"></i> |
||||
|
</div> |
||||
|
<div class="row"> |
||||
|
<div class="item"> |
||||
|
<div class="field">项目标题:</div> |
||||
|
<div class="value">{{ info.title }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row"> |
||||
|
<div class="item"> |
||||
|
<div class="field">项目方案:</div> |
||||
|
<div class="value">{{ info.content }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row"> |
||||
|
<div class="item"> |
||||
|
<div class="field">内部备注:</div> |
||||
|
<div class="value">{{ info.remark }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row"> |
||||
|
<div class="item"> |
||||
|
<div class="field">当前处理部门:</div> |
||||
|
<div class="value">{{ info.department }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row"> |
||||
|
<div class="item"> |
||||
|
<div class="field">分类:</div> |
||||
|
<div class="value">{{ info.class }}{{ info.sub_class }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row"> |
||||
|
<div class="item"> |
||||
|
<div class="field">标签:</div> |
||||
|
<div class="value">{{ info.label }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row"> |
||||
|
<div class="item"> |
||||
|
<div class="field">操作:</div> |
||||
|
<!-- <div class="value">{{ info.report_user_mobile }}</div> --> |
||||
|
</div> |
||||
|
</div> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<div class="subtitle"> |
||||
|
<i class="i-chunk"></i> |
||||
|
处理进展 |
||||
|
<i class="i-line"></i> |
||||
|
</div> |
||||
|
<el-timeline class="timeline"> |
||||
|
<el-timeline-item v-for="(item, index) in progress" :key="index" :class="index == progress.length - 1 ? 'sucess' : ''"> |
||||
|
<div class="status-box"> |
||||
|
<div class="status2" v-if="index == progress.length - 1">{{ item.type }}</div> |
||||
|
<div class="status1" v-else>{{ item.type }}</div> |
||||
|
<div class="timestamp">{{ item.date }}</div> |
||||
|
</div> |
||||
|
<div class="content"> |
||||
|
<div class="field">处理部门:</div> |
||||
|
<div class="value">{{ item.department }}</div> |
||||
|
</div> |
||||
|
<div class="content"> |
||||
|
<div class="field">说明:</div> |
||||
|
<div class="value">{{ item.remark }}</div> |
||||
|
</div> |
||||
|
</el-timeline-item> |
||||
|
</el-timeline> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</div> |
||||
|
<div class="m-info" v-if="detailType == '服务支撑' || detailType == '商家支撑'"> |
||||
|
<div class="row"> |
||||
|
<div class="item"> |
||||
|
<div class="field">所属网格:</div> |
||||
|
<div class="value">{{ info.grid }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">需求类型:</div> |
||||
|
<div class="value">{{ info.parent_category }} {{ info.category }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">上报类型:</div> |
||||
|
<div class="value">{{ info.report_type }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">上报人:</div> |
||||
|
<div class="value">{{ info.report_user_name }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">上报时间:</div> |
||||
|
<div class="value">{{ info.report_time }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">上报人联系电话:</div> |
||||
|
<div class="value">{{ info.report_user_mobile }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<div class="item"> |
||||
|
<div class="field">需求人:</div> |
||||
|
<div class="value">{{ info.demand_user_name }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">服务时间:</div> |
||||
|
<div class="value">{{ info.want_service_time }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">需求内容:</div> |
||||
|
<div class="value">{{ info.content }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<div class="item"> |
||||
|
<div class="field">服务方:</div> |
||||
|
<div class="value">{{ info.server_name }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">实际服务时间:</div> |
||||
|
<div class="value">{{ info.service_start_time }}{{ info.service_end_time }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">完成情况:</div> |
||||
|
<div class="value">{{ info.finish_result }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">评价:</div> |
||||
|
<div class="value">{{ info.score }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="m-info" v-else> |
||||
|
<div class="row"> |
||||
|
<div class="item"> |
||||
|
<div class="field">需求类别:</div> |
||||
|
<div class="value">{{ info.parent_type_name }} {{ info.child_type_name }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">需求标题 :</div> |
||||
|
<div class="value">{{ info.title }}</div> |
||||
|
</div> |
||||
|
<div class="item" style="width: 100%;"> |
||||
|
<div class="field">详细说明:</div> |
||||
|
<div class="value">{{ info.content }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">查找有该需求人员 :</div> |
||||
|
<div class="value">{{ info.resi_search_tag_name }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">服务方 :</div> |
||||
|
<div class="value">{{ info.service_name }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">服务范围 :</div> |
||||
|
<div class="value">{{ info.scope_name }}</div> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<div class="field">服务时间:</div> |
||||
|
<div class="value">{{ info.start_service_time }}至{{ info.end_service_time }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
</popup> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import popup from '@/views/dataBoard/cpts/popup'; |
||||
|
import { requestPostBi } from '@/js/dai/request-bipass'; |
||||
|
|
||||
|
export default { |
||||
|
name: 'needDetails', |
||||
|
props: { |
||||
|
detailId: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
detailType: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
components: { popup }, |
||||
|
created() {}, |
||||
|
data() { |
||||
|
return { |
||||
|
progress: [], |
||||
|
info: {} |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
this.getApiData(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
handleClose() { |
||||
|
this.$emit('close'); |
||||
|
}, |
||||
|
|
||||
|
async getApiData() { |
||||
|
this.getInfo(); |
||||
|
}, |
||||
|
|
||||
|
// 根据房屋id获取详情 |
||||
|
async getInfo() { |
||||
|
let url = ''; |
||||
|
if (this.detailType == '政府支撑') { |
||||
|
url = 'gov_support'; |
||||
|
} else if (this.detailType == '服务支撑') { |
||||
|
url = 'service_support'; |
||||
|
} else if (this.detailType == '商家支撑') { |
||||
|
url = 'busi_support'; |
||||
|
} else { |
||||
|
url = 'common_support'; |
||||
|
} |
||||
|
|
||||
|
const { data, code, msg } = await requestPostBi( |
||||
|
url, |
||||
|
{ |
||||
|
queryParam: { |
||||
|
need_id: this.detailId |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
// mockId: 60235478, |
||||
|
} |
||||
|
); |
||||
|
if (code === 0) { |
||||
|
this.info = { ...this.info, ...data[0] }; |
||||
|
if (this.detailType == '政府支撑') { |
||||
|
this.progress = this.info.progress; |
||||
|
} |
||||
|
console.log('this.info', this.info); |
||||
|
} else { |
||||
|
this.$message.error(msg); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.m-info .row .item .field { |
||||
|
width: 140px !important; |
||||
|
} |
||||
|
</style> |
||||
|
<style lang="scss" src="@/assets/scss/dataBoard/popup-info.scss" scoped></style> |
@ -1,447 +0,0 @@ |
|||||
<template> |
|
||||
<div class="m-record"> |
|
||||
<h3>检查记录</h3> |
|
||||
<div> |
|
||||
<!-- <div class="u-table-btn1 mt10" v-if="formType != 'view'"> |
|
||||
<el-button size="small" class="diy-button--blue" :disabled="btnDisabled || disabled" @click="handleAdd">新增</el-button> |
|
||||
</div> --> |
|
||||
<div class="m-table-item"> |
|
||||
<el-table :data="tableData" class="resi-table" row-key="id" border style="width: 100%"> |
|
||||
<el-table-column label="序号" type="index" align="center" width="50"></el-table-column> |
|
||||
|
|
||||
<el-table-column prop="inspectTime" label="检查时间" align="center" width="200px"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-date-picker |
|
||||
v-if="scope.row.isEdit" |
|
||||
v-model="scope.row.inspectTime" |
|
||||
type="date" |
|
||||
class="input-width" |
|
||||
value-format="yyyy-MM-dd" |
|
||||
placeholder="选择日期" |
|
||||
></el-date-picker> |
|
||||
<div v-else class="div-content">{{ scope.row.inspectTime }}</div> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
|
|
||||
<el-table-column prop="inspectStaffId" label="检查人员" align="center" width="200px"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-select |
|
||||
v-if="scope.row.isEdit" |
|
||||
v-model="scope.row.inspectStaffId" |
|
||||
placeholder="请选择" |
|
||||
class="input-width" |
|
||||
@change="handleChangeStaff(scope.row)" |
|
||||
clearable |
|
||||
> |
|
||||
<el-option v-for="subItem in optionStaff" :key="subItem.value" :label="subItem.label" :value="subItem.value"></el-option> |
|
||||
</el-select> |
|
||||
<div v-else class="div-content">{{ scope.row.inspectStaffName }}</div> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
|
|
||||
<el-table-column prop="inspectStaffMobile" label="联系电话" align="center" width="200px"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-input |
|
||||
v-if="scope.row.isEdit" |
|
||||
type="number" |
|
||||
v-model="scope.row.inspectStaffMobile" |
|
||||
placeholder="请输入" |
|
||||
class="input-width" |
|
||||
clearable |
|
||||
disabled |
|
||||
></el-input> |
|
||||
<div v-else class="div-content">{{ scope.row.inspectStaffMobile }}</div> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
|
|
||||
<el-table-column prop="inspectResult" label="检查结果" align="center" width="200px"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-select v-if="scope.row.isEdit" v-model="scope.row.inspectResult" placeholder="请选择" class="input-width" size="small" clearable> |
|
||||
<el-option v-for="subItem in optionResult" :key="subItem.value" :label="subItem.label" :value="subItem.value"></el-option> |
|
||||
</el-select> |
|
||||
<div v-else class="div-content">{{ scope.row.inspectResult == 1 ? '正常' : '异常' }}</div> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
|
|
||||
<!-- <el-table-column |
|
||||
prop="detailed" |
|
||||
label="隐患明细" |
|
||||
align="center" |
|
||||
width="200px" |
|
||||
> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-input |
|
||||
v-if="scope.row.isEdit" |
|
||||
type="text" |
|
||||
v-model="scope.row.detailed" |
|
||||
placeholder="请输入" |
|
||||
class="input-width" |
|
||||
maxlength="500" |
|
||||
clearable |
|
||||
></el-input> |
|
||||
<div v-else class="div-content"> |
|
||||
{{ scope.row.detailed }} |
|
||||
</div> |
|
||||
</template> |
|
||||
</el-table-column> --> |
|
||||
|
|
||||
<el-table-column prop="imgList" label="图片列表" align="center" width="150px"> |
|
||||
<template slot-scope="scope"> |
|
||||
<div v-if="scope.row.isEdit"> |
|
||||
<el-upload |
|
||||
:headers="$getElUploadHeaders()" |
|
||||
class="avatar-uploader" |
|
||||
:action="uploadUrl" |
|
||||
:data="{ customerId: customerId }" |
|
||||
:show-file-list="true" |
|
||||
:limit="3" |
|
||||
:file-list="scope.row.imgShowList" |
|
||||
:on-success="res => handleImgSuccess(res, scope.row)" |
|
||||
:on-remove="res => handleImgRemove(res, scope.row)" |
|
||||
list-type="picture" |
|
||||
:before-upload="beforeImgUpload" |
|
||||
> |
|
||||
<i class="el-icon-plus avatar-uploader-icon"></i> |
|
||||
最多三张图片 |
|
||||
</el-upload> |
|
||||
</div> |
|
||||
|
|
||||
<div v-else class="div-content"> |
|
||||
<el-image |
|
||||
v-if="scope.row.imgList.length > 0" |
|
||||
style="width: 100px; height: 50px" |
|
||||
:src="scope.row.imgList[0]" |
|
||||
fit="cover" |
|
||||
:preview-src-list="scope.row.imgList" |
|
||||
></el-image> |
|
||||
</div> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
|
|
||||
<el-table-column prop="nextInspectTime" label="拟复查时间" align="center" width="200px"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-date-picker |
|
||||
v-if="scope.row.isEdit" |
|
||||
v-model="scope.row.nextInspectTime" |
|
||||
type="date" |
|
||||
class="input-width" |
|
||||
value-format="yyyy-MM-dd" |
|
||||
placeholder="选择日期" |
|
||||
></el-date-picker> |
|
||||
<div v-else class="div-content">{{ scope.row.nextInspectTime }}</div> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
|
|
||||
<el-table-column v-if="!disabled" fixed="right" label="操作" align="center" width="120"> |
|
||||
<template slot-scope="scope"> |
|
||||
<template v-if="scope.row.isEdit"> |
|
||||
<el-button @click="handleEdit(scope.row)" type="text" size="small" class="btn-color-edit">保存</el-button> |
|
||||
<el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button> |
|
||||
</template> |
|
||||
<template v-else> |
|
||||
<el-button v-if="formType == 'edit'" @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit"> |
|
||||
修改 |
|
||||
</el-button> |
|
||||
<el-popconfirm v-if="formType == 'edit'" title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)"> |
|
||||
<el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button> |
|
||||
</el-popconfirm> |
|
||||
</template> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import { requestPost, requestGet } from '@/js/dai/request'; |
|
||||
export default { |
|
||||
props: { |
|
||||
id: { |
|
||||
type: String, |
|
||||
default: '' |
|
||||
}, |
|
||||
info: { |
|
||||
type: Object, |
|
||||
default: () => ({}) |
|
||||
}, |
|
||||
disabled: { |
|
||||
type: Boolean, |
|
||||
default: false |
|
||||
}, |
|
||||
formType: { |
|
||||
type: String, |
|
||||
default: '' |
|
||||
}, |
|
||||
source: { |
|
||||
//展示来源:manage 管理平台 visiual 可视化平台 |
|
||||
type: String, |
|
||||
default: 'manage' |
|
||||
} |
|
||||
}, |
|
||||
data() { |
|
||||
return { |
|
||||
uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2', |
|
||||
customerId: localStorage.getItem('customerId'), |
|
||||
|
|
||||
btnDisabled: false, |
|
||||
btnType: 'cancle', |
|
||||
isEdit: false, |
|
||||
tableData: [], |
|
||||
tempRow: {}, |
|
||||
|
|
||||
optionResult: [ |
|
||||
{ |
|
||||
label: '异常', |
|
||||
value: '0' |
|
||||
}, |
|
||||
{ |
|
||||
label: '正常', |
|
||||
value: '1' |
|
||||
} |
|
||||
], |
|
||||
optionStaff: [ |
|
||||
// { |
|
||||
// label: "人名", |
|
||||
// value: "inspectStaffId", |
|
||||
// }, |
|
||||
] |
|
||||
}; |
|
||||
}, |
|
||||
|
|
||||
computed: { |
|
||||
allowOperate() { |
|
||||
const { |
|
||||
info: { agencyId } |
|
||||
} = this; |
|
||||
return agencyId && agencyId == this.$store.state.user.agencyId; |
|
||||
} |
|
||||
}, |
|
||||
watch: { |
|
||||
id: { |
|
||||
handler(val) { |
|
||||
console.log('val------points', val); |
|
||||
if (val.length > 0) { |
|
||||
this.btnDisabled = false; |
|
||||
this.getList(); |
|
||||
} else this.btnDisabled = true; |
|
||||
}, |
|
||||
immediate: true |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
created() { |
|
||||
console.log('id', this.id); |
|
||||
this.getOptionStaff(); |
|
||||
if (this.id) { |
|
||||
this.getList(); |
|
||||
} else { |
|
||||
this.handleAdd(); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
methods: { |
|
||||
beforeImgUpload(file) { |
|
||||
console.log(file); |
|
||||
const isLt1M = file.size / 1024 / 1024 < 10; |
|
||||
const srcType = file.type; |
|
||||
const format = file.name.split('.').pop(); |
|
||||
|
|
||||
if (!isLt1M) { |
|
||||
this.$message.error('上传文件大小不能超过 10MB!'); |
|
||||
return false; |
|
||||
} |
|
||||
if (srcType.indexOf('image') == -1) { |
|
||||
this.$message.error('仅限图片格式'); |
|
||||
return false; |
|
||||
} |
|
||||
return true; |
|
||||
}, |
|
||||
|
|
||||
handleImgSuccess(res, row) { |
|
||||
console.log('handleImgSuccess', res); |
|
||||
if (res.code === 0 && res.msg === 'success') { |
|
||||
row.imgList.push(res.data.url); |
|
||||
this.computeImgShowList(row); |
|
||||
} else { |
|
||||
this.$message.error(res.msg); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
computeImgShowList(row) { |
|
||||
row.imgShowList = row.imgList.map(url => { |
|
||||
return { name: '', url }; |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
handleImgRemove(file, row) { |
|
||||
console.log('handleImgRemove', file); |
|
||||
let url = file.url || file.response.data.url; |
|
||||
if (url) { |
|
||||
row.imgList = row.imgList.filter(item => item !== url); |
|
||||
this.computeImgShowList(row); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
getRowClass({ rowIndex, columnIndex }) { |
|
||||
if (rowIndex === 0) { |
|
||||
return 'background: #2195fe; color: #fff;'; |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
handleChange(row, type) { |
|
||||
console.log('type----', type); |
|
||||
if (type == 'cancle') { |
|
||||
row = { ...this.tempRow }; |
|
||||
row.isEdit = false; |
|
||||
if (this.btnType == 'add') this.tableData.pop(); |
|
||||
this.getList(); |
|
||||
console.log('row----', row); |
|
||||
} else { |
|
||||
this.tempRow = { ...row }; |
|
||||
row.isEdit = true; |
|
||||
} |
|
||||
this.btnType = type; |
|
||||
this.isEdit = !this.isEdit; |
|
||||
}, |
|
||||
|
|
||||
handleChangeStaff(row) { |
|
||||
const { inspectStaffId } = row; |
|
||||
const { optionStaff } = this; |
|
||||
let item = optionStaff.find(item => item.value == inspectStaffId); |
|
||||
if (item) { |
|
||||
row.inspectStaffName = item.name; |
|
||||
row.inspectStaffMobile = item.mobile; |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
async getOptionStaff() { |
|
||||
let url = `/data/aggregator/org/staff-select-list/${this.$store.state.user.agencyId}`; |
|
||||
const { data, code, msg } = await requestPost(url, {}); |
|
||||
|
|
||||
if (code === 0) { |
|
||||
this.optionStaff = data || []; |
|
||||
} else { |
|
||||
this.$message.error('请求工作人员数据失败!'); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
async handleEdit(row) { |
|
||||
if (row.result == '0' && row.reviewTime == '') { |
|
||||
this.$message.error('拟复查时间不能为空'); |
|
||||
} else { |
|
||||
if (this.id) { |
|
||||
console.log('有id'); |
|
||||
if (this.btnType == 'add') this.save(row); |
|
||||
else this.edit(row); |
|
||||
} else { |
|
||||
this.$message.error('请先保存上方信息'); |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
handleAdd() { |
|
||||
this.btnType = 'add'; |
|
||||
this.isEdit = true; |
|
||||
|
|
||||
const item = { |
|
||||
isEdit: true, |
|
||||
id: this.id, |
|
||||
inspectTime: '', |
|
||||
inspectStaffId: '', |
|
||||
inspectStaffName: '', |
|
||||
inspectStaffMobile: '', |
|
||||
inspectResult: '', |
|
||||
imgList: [], |
|
||||
nextInspectTime: '' |
|
||||
}; |
|
||||
this.computeImgShowList(item); |
|
||||
this.tableData.push(item); |
|
||||
}, |
|
||||
|
|
||||
async save(row) { |
|
||||
const params = { |
|
||||
equipmentId: this.id, |
|
||||
...row |
|
||||
}; |
|
||||
const url = `/actual/base/safetyEquipmentInspectRecord/save`; |
|
||||
const { data, code, msg } = await requestPost(url, params); |
|
||||
if (code === 0) { |
|
||||
this.$message.success('保存成功'); |
|
||||
row.isEdit = false; |
|
||||
this.isEdit = false; |
|
||||
this.btnType = 'cancle'; |
|
||||
this.getList(); |
|
||||
} else { |
|
||||
this.$message.error(msg); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
async edit(row) { |
|
||||
const params = { |
|
||||
...row |
|
||||
}; |
|
||||
const url = `/actual/base/safetyEquipmentInspectRecord/update`; |
|
||||
const { data, code, msg } = await requestPost(url, params); |
|
||||
if (code === 0) { |
|
||||
this.$message.success('保存成功'); |
|
||||
row.isEdit = false; |
|
||||
this.isEdit = false; |
|
||||
this.getList(); |
|
||||
} else { |
|
||||
this.$message.error(msg); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
async del(row) { |
|
||||
let arr = [row.id]; |
|
||||
// const url = `/actual/base/emergencyEquipment/inspect-delete`; |
|
||||
const url = `/actual/base/safetyEquipmentInspectRecord/delete`; |
|
||||
const { data, code, msg } = await requestPost(url, arr); |
|
||||
|
|
||||
if (code === 0) { |
|
||||
this.$message.success('删除成功'); |
|
||||
this.getList(); |
|
||||
} else { |
|
||||
this.$message.error(msg); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
async getList() { |
|
||||
const params = { |
|
||||
equipmentId: this.id, |
|
||||
pageNo: 1, |
|
||||
pageSize: 10000 |
|
||||
}; |
|
||||
const url = `/actual/base/safetyEquipmentInspectRecord/page`; |
|
||||
const { data, code, msg } = await requestPost(url, params); |
|
||||
|
|
||||
if (code === 0) { |
|
||||
this.tableData = data.list.map(item => { |
|
||||
this.computeImgShowList(item); |
|
||||
return { |
|
||||
...item, |
|
||||
isEdit: false |
|
||||
}; |
|
||||
}); |
|
||||
this.handleAdd(); |
|
||||
} else { |
|
||||
this.$message.error(msg); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
}; |
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped> |
|
||||
@import '@/assets/scss/buttonstyle.scss'; |
|
||||
@import '@/assets/scss/modules/management/list-main.scss'; |
|
||||
|
|
||||
.mt10 { |
|
||||
margin-bottom: 10px; |
|
||||
} |
|
||||
.input-width { |
|
||||
width: 170px; |
|
||||
} |
|
||||
</style> |
|
Loading…
Reference in new issue