Commit 1a63f143 authored by 何鹏程's avatar 何鹏程

完成新需求

parent 4a699a63
......@@ -55,3 +55,19 @@ export function toExamineEmergencyCar(params) {
data: params
})
}
export function queryTotalCarByHospital(params) {
return request({
url: '/api/team/car/queryTotalCarByHospital',
method: 'POST',
data: params
})
}
export function queryTotalCarInfoByHospital(params) {
return request({
url: '/api/team/car/queryTotalCarInfoByHospital',
method: 'POST',
data: params
})
}
......@@ -35,7 +35,7 @@
label="是否120急救车"
>
<el-radio-group v-model="searchForm.isEmergencyCar">
<el-radio label="全部">全部</el-radio>
<el-radio label="">全部</el-radio>
<el-radio :label="1"></el-radio>
<el-radio :label="2"></el-radio>
</el-radio-group>
......
......@@ -194,21 +194,35 @@ export default {
name: '导管室数量',
key: 'cathLabCount',
sortable: false,
width: '150',
width: '100',
fixed: false
},
{
name: '手术室数量',
key: 'operateRoomCount',
sortable: false,
width: '300',
width: '100',
fixed: false
},
{
name: 'ICU床位',
key: 'icuBedCount',
sortable: false,
width: '80',
width: '100',
fixed: false
},
{
name: '留观床位数量',
key: 'observationBedCount',
sortable: false,
width: '100',
fixed: false
},
{
name: '负压手术室数量',
key: 'pressureOperateRoomCount',
sortable: false,
width: '100',
fixed: false
},
{
......
<template>
<el-dialog
:title="title + '急救车信息明细'"
:visible.sync="dialogVisible"
width="1200px"
:close-on-click-modal="false"
class="detailDialog"
>
<table-mixin
:pageSize="pageSize"
:pageNum="pageNum"
:total="total"
:pagination="pagination"
:handleSizeChange="handleSizeChange"
:handleCurrentChange="handleCurrentChange"
>
<el-table
v-loading="tableData.loading"
:data="tableData.body"
height="400"
@sort-change="handleSortChange"
>
<div
slot="empty"
class="noData"
></div>
<el-table-column
label="序号"
type="index"
min-width="50"
>
</el-table-column>
<el-table-column
v-for="(item,index) in tableData.head"
:prop="item.key"
:label="item.name"
align="left"
:formatter="item.formatter"
:sortable="item.sortable"
:fixed="item.fixed"
:key="index"
:min-width="item.width"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<p v-if="item.key === 'vechieUseStatusStr'">
<i class="icon-d" :style="{ backgroundColor: scope.row.vechieUseStatusColor }"></i> <span>{{scope.row.vechieUseStatusStr}}</span>
</p>
<span v-else>{{ scope.row[scope.column.property] }}</span>
</template>
</el-table-column>
</el-table>
</table-mixin>
</el-dialog>
</template>
<script>
import { queryTotalCarInfoByHospital } from '@/api/emergencyCar'
import { tableDataMixin } from '../../../common/js/mixin'
export default {
name: 'detailDialog',
mixins: [tableDataMixin],
data() {
return {
dialogVisible: false,
title: '',
tableData: {
loading: false,
head: [
{
name: '车辆使用单位',
key: 'vehicleUsingUnit',
sortable: false,
width: '180',
fixed: false
},
{
name: '车辆类型',
key: 'vechieTypeStr',
sortable: false,
width: '100',
fixed: false
},
{
name: '车辆管理负责人',
key: 'vehicleManager',
sortable: false,
width: '120',
fixed: false
},
{
name: '是否120急救车',
key: 'isEmergencyCarStr',
sortable: false,
width: '120',
fixed: false
},
{
name: '车辆来源',
key: 'vechieSourceStr',
sortable: false,
width: '80',
fixed: false,
},
{
name: '车辆品牌',
key: 'vechieBrand',
sortable: false,
width: '80',
fixed: false,
},
{
name: '首次登记日期',
key: 'firstRegisterDate',
sortable: false,
width: '100',
fixed: false,
},
{
name: '车辆使用状态',
key: 'vechieUseStatusStr',
sortable: false,
width: '110',
fixed: false,
},
{
name: '车牌号',
key: 'licensePlateNumber',
sortable: false,
width: '110',
fixed: false,
},
{
name: '车辆特殊用途',
key: 'vechieSpecialPurposeStr',
sortable: false,
width: '110',
fixed: false,
}
],
body: [],
option: [],
condition: []
}
}
},
mounted() {
// 获取字典
},
methods: {
init(title) {
this.dialogVisible = true
this.title = title
this.pageNum = 1
this.pageSize = 10
this.getTableData()
},
getTableData() {
this.tableData.loading = true
const params = {
vehicleUsingUnit: this.title,
pageNo: this.pageNum,
pageSize: this.pageSize
}
queryTotalCarInfoByHospital(params).then((res) => {
if (res.msg == 201) {
this.dealTableResponse(res)
} else {
this.$message.error(res.content)
}
})
},
}
}
</script>
<style lang="scss" scoped>
.detailDialog {
.icon-d{
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 2px;
}
}
</style>
<template>
<div class="main-page">
<div class="main-page-header">
<p class="title">急救车使用情况</p>
<el-form
:inline="true"
:model="searchForm"
ref="searchForm"
size="small"
>
<el-form-item
label="车辆使用单位:"
prop="vehicleUsingUnit"
>
<el-input
placeholder="请输入车辆使用单位"
v-model="searchForm.vehicleUsingUnit"
/>
</el-form-item>
<el-form-item
label="辖区:"
prop="area"
>
<el-select
v-model="searchForm.area"
placeholder="请选择辖区"
style="width: 100%"
:clearable="true"
>
<el-option
v-for="item in areaList"
:label="item.name"
:key="item.id"
:value="item.val"
/>
</el-select>
</el-form-item>
<div class="btns">
<el-button
type="primary"
size="small"
@click="searchFormSub"
>查询</el-button>
<el-button
size="small"
@click="resetForm('searchForm')"
>重置</el-button>
</div>
</el-form>
</div>
<div class="main-page-body">
<div class="mainContent">
<div class="bt">
<el-button
type="primary"
size="small"
v-if="checkPermission()"
@click="exportFile()"
>导出</el-button>
</div>
<table-mixin
:pageSize="pageSize"
:pageNum="pageNum"
:total="total"
:pagination="pagination"
:handleSizeChange="handleSizeChange"
:handleCurrentChange="handleCurrentChange"
>
<el-table
v-loading="tableData.loading"
:data="tableData.body"
@sort-change="handleSortChange"
>
<div
slot="empty"
class="noData"
></div>
<el-table-column
label="序号"
type="index"
min-width="50"
>
</el-table-column>
<el-table-column
v-for="(item,index) in tableData.head"
:prop="item.key"
:label="item.name"
align="left"
:formatter="item.formatter"
:sortable="item.sortable"
:fixed="item.fixed"
:key="index"
:min-width="item.width"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
label="操作"
align="left"
width="auto"
min-width="230px"
>
<template slot-scope="scope">
<el-link
type="primary"
@click="showDetailDialog(scope.row.vehicleUsingUnit)"
>查看详情</el-link>
</template>
</el-table-column>
</el-table>
</table-mixin>
<detailDialog
ref="detailDialog"
/>
</div>
</div>
</div>
</template>
<script>
import { tableDataMixin } from '../../common/js/mixin'
import detailDialog from './components/detailDialog.vue'
import { queryTotalCarByHospital } from '@/api/emergencyCar'
import { getDic } from '../../util/dict'
import { exportEmergencyResources } from '@/api/common'
export default {
name: 'usage',
mixins: [tableDataMixin],
components: {
detailDialog
},
data() {
return {
searchForm: {
vehicleUsingUnit: '',
area: ''
},
areaList: [],
tableData: {
loading: false,
head: [
{
name: '车辆使用单位',
key: 'vehicleUsingUnit',
sortable: false,
width: '250',
fixed: false
},
{
name: '辖区',
key: 'area',
sortable: false,
width: '150',
fixed: false,
formatter: this.areaFormatter
},
{
name: '单位性质',
key: 'unitTypeStr',
sortable: false,
width: '100',
fixed: false
},
{
name: '急救车总数',
key: 'carCountStr',
sortable: false,
width: '100',
fixed: false
},
{
name: '在用总数',
key: 'useCountStr',
sortable: false,
width: '100',
fixed: false,
},
{
name: '闲置总数',
key: 'freeCountStr',
sortable: false,
width: '100',
fixed: false,
},
{
name: '其他总数',
key: 'otherCountStr',
sortable: false,
width: '100',
fixed: false,
}
],
body: [],
option: [],
condition: []
}
}
},
mounted() {
// 获取字典
getDic(['area']).then(res => {
this.areaList = res.area
})
this.search()
},
methods: {
getTableData() {
this.tableData.loading = true
const params = {
...this.searchForm,
pageNo: this.pageNum,
pageSize: this.pageSize
}
queryTotalCarByHospital(params).then((res) => {
if (res.msg == 201) {
this.dealTableResponse(res)
} else {
this.$message.error(res.content)
}
})
},
areaFormatter(row, column, cellValue, index) {
const area = this.areaList.find(i => i.val === cellValue)
return area ? area.name : ''
},
showDetailDialog(vehicleUsingUnit = '') {
console.log(vehicleUsingUnit)
this.$refs.detailDialog.init(vehicleUsingUnit)
},
exportFile() {
const params = {
...this.searchForm,
exportType: 3
}
exportEmergencyResources(params).then(res => {
if (res.msg === 201) {
window.open(res.respData)
} else {
this.$message.error(res.content)
}
})
},
}
}
</script>
<style lang="scss" scoped>
.mainContent {
padding: 20px;
.bt {
text-align: right;
margin-bottom: 16px;
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment