Commit 9b2698e7 authored by 盖献康's avatar 盖献康

Merge remote-tracking branch 'origin/master'

parents f0416997 1fd953ab
......@@ -3,15 +3,27 @@ import request from '@/utils/request'
// 查看使用管理详情
export function useManagementDetail(id) {
return request({
url: '/manage/use/' + id,
url: '/business/check/use/' + id,
method: 'get'
})
}
// 查询使用列表分页
export function listUseManagement(query) {
return request({
url: '/manage/useList',
url: '/business/check/useList',
method: 'get',
params: query
})
}
// 查询使用列表分页
export function listUseManagementAll(query) {
return request({
url: '/business/check/useListAll',
method: 'get',
params: query
})
}
// 导出
......@@ -42,7 +42,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="手机号" prop="phone">
<el-input v-model="form.phone" :disabled="true" />
<el-input v-model="form.headPhone" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="8">
......@@ -297,11 +297,24 @@
</template>
<script>
import { useManagementDetail } from '@/api/business/use'
import { CodeToText } from 'element-china-area-data'
export default {
name: 'UseDetails',
dicts: ['exam_type', 'device_status', 'device_type', 'pet_sex', 'sterilization_status', 'vaccine_situation', 'pet_insure'],
props: {
id: {
type: Number,
required: true
}
},
data() {
return {
// 支持服务地区
serviceAreaS: [],
serviceArea: [],
// 可用时间段
useTime: {
ams: '',
ame: '',
......@@ -312,11 +325,45 @@ export default {
form: {}
}
},
created() {
this.getUseDetail()
},
methods: {
cancel() {
this.$router.push({
name: 'UseManagement'
})
},
// 三级联动
regionalChanges(value) {
// 地区数组
const textArray = []
// 编码数组
const codeArray = []
for (let i = 0; i < value.length; i++) {
codeArray.push(value[i].toString())
textArray.push(CodeToText[value[i][0]] + CodeToText[value[i][1]] + CodeToText[value[i][2]])
}
this.form.serviceArea = textArray.join(',')
},
// 查询详情
getUseDetail() {
useManagementDetail(this.id).then(res => {
this.form = res.data
console.log('xiangq', res)
if (res.data.useTime !== '' && res.data.useTime !== null) {
this.useTime = JSON.parse(res.data.useTime)
}
if (res.data.serviceArea !== '' && res.data.serviceArea !== null) {
this.serviceAreaS = this.form.serviceArea.split(';')
this.serviceArea = []
for (let i = 0; i < this.serviceAreaS.length; i++) {
this.serviceAreaS[i] = this.serviceAreaS[i].split(',')
this.serviceArea.push(this.serviceAreaS[i])
}
this.regionalChanges(this.serviceArea)
}
})
}
}
}
......
......@@ -4,13 +4,13 @@
<el-form-item prop="deviceCode">
<el-input
v-model.trim="queryParams.deviceCode"
v-model.trim="queryParams.searchText"
placeholder="请输入设备名称/ID"
clearable
/>
</el-form-item>
<el-form-item prop="status">
<el-select v-model="queryParams.checkTypeList" placeholder="检查项目" multiple collapse-tags clearable>
<el-select v-model="queryParams.checkItemsIdList" placeholder="检查项目" multiple collapse-tags clearable>
<el-option
v-for="dict in dict.type.exam_type"
:key="dict.value"
......@@ -20,9 +20,9 @@
</el-select>
</el-form-item>
<el-form-item prop="status">
<el-select v-model="queryParams.checkTypeList" placeholder="宠物保险" multiple collapse-tags clearable>
<el-select v-model="queryParams.insureList" placeholder="宠物保险" multiple collapse-tags clearable>
<el-option
v-for="dict in dict.type.exam_type"
v-for="dict in dict.type.pet_insure"
:key="dict.value"
:label="dict.label"
:value="dict.value"
......@@ -30,7 +30,7 @@
</el-select>
</el-form-item>
<el-form-item prop="status">
<el-select v-model="queryParams.status" placeholder="设备当前状态" collapse-tags clearable>
<el-select v-model="queryParams.statusList" multiple placeholder="设备当前状态" collapse-tags clearable>
<el-option
v-for="dict in dict.type.device_status"
:key="dict.value"
......@@ -39,6 +39,15 @@
/>
</el-select>
</el-form-item>
<el-form-item>
<el-date-picker
v-model="daterangeCreateTime"
type="date"
style="width: 240px"
placeholder="选择创建日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item>
<el-select v-model="sortedColumn" clearable value-key="id" placeholder="请选择排序方式" @change="handleSort">
<el-option
......@@ -59,14 +68,12 @@
>选择全部
</el-button>
<el-button
v-hasPermi="['system:manage:export']"
icon="el-icon-top-right"
class="fourWordsBtn"
@click="reverseSelect(userList)"
>反向选择
</el-button>
<el-button
v-hasPermi="['system:ward:export']"
class="fourWordsBtn"
icon="el-icon-bottom-left"
@click="handleExport"
......@@ -84,7 +91,7 @@
<el-table ref="table" v-loading="loading" :data="userList" border :row-key="getRowKeys" @selection-change="handleSelectionChange" @select-all="selectAll($event, false)">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" />
<el-table-column type="index" label="序号" width="50" />
<el-table-column label="设备ID" align="left" prop="deviceId" />
<el-table-column label="设备ID" align="left" prop="deviceCode" :show-overflow-tooltip="true" />
<el-table-column label="检查项目" align="left" prop="checkItemsName" :show-overflow-tooltip="true" />
<el-table-column label="宠物昵称" align="left" prop="petNickname" :show-overflow-tooltip="true" />
<el-table-column label="宠物保险" align="left" prop="insure" :show-overflow-tooltip="true">
......@@ -99,7 +106,11 @@
<span>{{ parseTime(scope.row.checkStartTime, '{y}/{m}/{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="检查时间" align="left" prop="deviceName" />
<el-table-column label="检查时间" align="left" prop="checkStartTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.checkStartTime, '{h}:{m}') }}</span>
</template>
</el-table-column>
<el-table-column label="缴费金额" align="left" prop="payAmount" />
<el-table-column label="设备当前状态" align="left" prop="status">
<template slot-scope="scope">
......@@ -136,17 +147,21 @@
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
@pagination="getUseList"
/>
</div>
</template>
<script>
import { listUseManagement, listUseManagementAll } from '@/api/business/use'
export default {
name: 'UseManagement',
dicts: ['exam_type', 'device_status'],
dicts: ['exam_type', 'device_status', 'pet_insure'],
data() {
return {
// 可以使用的时间段时间范围
daterangeCreateTime: '',
// 多选框选中id
ids: [],
loading: false,
......@@ -158,32 +173,38 @@ export default {
id: '1',
collation: 'asc',
sortedColumn: '按检查时间升序',
nameColumn: 'create_time'
nameColumn: 'checkItemsName'
},
{
id: '2',
collation: 'desc',
sortedColumn: '按检查时间降序',
nameColumn: 'create_time'
nameColumn: 'checkItemsName'
},
{
id: '3',
collation: 'asc',
sortedColumn: '按预约时间升序',
nameColumn: 'create_time'
nameColumn: 'appointTime'
},
{
id: '4',
collation: 'desc',
sortedColumn: '按预约时间降序',
nameColumn: 'create_time'
nameColumn: 'appointTime'
}
],
total: 0,
// 模糊查询
queryParams: {
pageNum: 1,
pageSize: 10
pageSize: 10,
isAsc: '',
orderByColumn: '',
searchText: '',
insureList: '',
checkItemsIdList: '',
statusList: ''
},
// 宠物保险下拉框
petInsure: [
......@@ -200,12 +221,66 @@ export default {
label: '未购保险'
}
],
userList: [
{ id: 1, deviceCode: '1' }
]
userList: []
}
},
created() {
this.getUseList()
},
methods: {
// 搜索
handleQuery() {
this.queryParams.pageNum = 1
this.getUseList()
},
// 重置
resetQuery() {
this.daterangeCreateTime = ''
this.sortedColumn = ''
this.queryParams = {
pageNum: 1,
pageSize: 10,
isAsc: '',
orderByColumn: '',
searchText: '',
insureList: '',
checkItemsIdList: '',
statusList: '',
checkStartTime: null
}
this.getUseList()
},
/** 导出按钮操作 */
handleExport() {
if (this.ids.length !== 0) {
const exportTable = {}
exportTable.useIds = this.ids
this.download('business/check/exportUse', exportTable, `use_${new Date().getTime()}.xlsx`).then(res => {
this.$refs.table.clearSelection()
})
} else {
this.$modal.msgError('请选择至少一条数据导出')
return
}
},
// 选择排序规则
handleSort(val) {
this.queryParams.orderByColumn = val.nameColumn
this.queryParams.isAsc = val.collation
this.sortedColumn = val.sortedColumn
},
// 获取列表数据
getUseList() {
if (this.daterangeCreateTime !== '') {
this.queryParams.beginCheckTime = this.daterangeCreateTime + ' 00:00:00'
this.queryParams.endCheckTime = this.daterangeCreateTime + ' 23:59:59'
}
listUseManagement(this.queryParams).then(res => {
this.total = res.total
this.userList = res.rows
console.log('列表', res)
})
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
......@@ -240,8 +315,8 @@ export default {
*/
async changeTableSelect(notIncludeIds = []) {
// 获取反选的数据
// const { data } = await selWardNoPage({ notIncludeIds })
// this.effectTableSelect(data)
const { data } = await listUseManagementAll({ notIncludeIds })
this.effectTableSelect(data)
},
// 反向选择
reverseSelect() {
......
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