Commit acfc4b04 authored by v_liuhuaizhi's avatar v_liuhuaizhi

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/views/service-management/registration-queue/registration-queue.vue
parents 477bb029 fbd590b0
......@@ -256,32 +256,34 @@ export default {
pme: null
},
sortedList: [
{
id: 1,
collation: 'asc',
sortedColumn: '按创建时间序',
collation: 'desc',
sortedColumn: '按创建时间序',
nameColumn: 'e.create_time'
},
{
id: 2,
collation: 'desc',
sortedColumn: '按创建时间序',
collation: 'asc',
sortedColumn: '按创建时间序',
nameColumn: 'e.create_time'
},
{
id: 3,
collation: 'asc',
sortedColumn: '按服务价格序',
collation: 'desc',
sortedColumn: '按服务价格序',
nameColumn: 'e.service_price'
},
{
id: 4,
collation: 'desc',
sortedColumn: '按服务价格序',
collation: 'asc',
sortedColumn: '按服务价格序',
nameColumn: 'e.service_price'
}
],
// 是否医院自有设备
......
......@@ -80,7 +80,7 @@
class="fourWordsBtn"
icon="el-icon-right"
size="mini"
@click="selectAll"
@click="checkAll"
>选择全部
</el-button>
<!--反向选择-->
......@@ -89,7 +89,7 @@
class="fourWordsBtn"
icon="el-icon-back"
size="mini"
@click="reverseSelect"
@click="reverseSelection"
>反向选择
</el-button>
<!--批量导出-->
......@@ -115,6 +115,7 @@
:data="recordList"
:header-cell-style="{background:'#E8E9E8'}"
border
@select="selectChange"
@selection-change="handleSelectionChange"
>
<el-table-column align="center" type="selection" width="55"/>
......@@ -181,7 +182,6 @@
</template>
<script>
import { listAllArticle } from '@/api/business/article'
import { listRecord } from '@/api/business/record'
export default {
......@@ -190,6 +190,12 @@ export default {
dicts: ['pet_insure'],
data() {
return {
// 所有挂号信息ID(选择全部-临时表)
recordIds: [],
// 所有挂号信息ID(在不点击选择全部时-临时表)
registerEmptyIds: [],
// 所有挂号信息ID(用于辅助, 里面的数据永远不变, 除了 新增/删除 数据时)
recordIdsForever: [],
doctorNameList: [],
deptIdList: [],
departIdList: [],
......@@ -269,49 +275,72 @@ export default {
name: 'MedicalDetail', params: { id: row.id }
})
},
/**
* 全部选择
* @param selection 已选择内容
* @param all 是否永远进行全选操作
*/
async selectAll(selection = [], all = true) {
// 如果已经全选并且是非一直全选操作则清空选择
if (this.recordList.length !== selection.length && !all) {
this.effectTableSelect([])
// 选择全部
checkAll() {
this.recordIds = this.recordIdsForever
// 标志位, 使得@select回调函数判断往哪个临时集合里添加
this.isCheckAll = true
// 调用手动勾选
this.manualCheck()
console.log('全部选择', this.isCheckAll)
},
// 手动勾选
manualCheck() {
// 在下一个dom触发
this.$nextTick().then(() => {
// 当前页结合数据的id只要在临时集合里,就使得复选框勾选
this.recordList.forEach(item => {
if (this.isCheckAll) {
if (this.recordIds.includes(item.id)) {
this.$refs.table.toggleRowSelection(item, true)
}
} else {
await this.changeTableSelect()
if (this.registerEmptyIds.includes(item.id)) {
this.$refs.table.toggleRowSelection(item, true)
}
},
// 反向选择
reverseSelect() {
this.changeTableSelect(this.ids)
},
/**
* 改变table选择项
* @param notIncludeIds 需要排除的id列表
*/
async changeTableSelect(notIncludeIds = []) {
// 获取反选的数据
// 需要一个可以根据条件和params.notIncludeIds排除部分数据的不分页查询的接口
const { data } = await listAllArticle({
...this.queryParams,
params: {
notIncludeIds,
sort: this.queryParams.params.sort
}
})
this.effectTableSelect(data)
})
},
// 反向选择(把永久临时集合和变化的临时集合做减法重新赋给变化的临时集合赋给)
reverseSelection() {
console.log('永久的集合', this.recordIdsForever)
console.log('临时集合', this.registerEmptyIds)
if (this.isCheckAll) {
this.registerEmptyIds = this.recordIdsForever.filter(id => !this.recordIds.includes(id))
} else {
this.registerEmptyIds = this.recordIdsForever.filter(id => !this.registerEmptyIds.includes(id))
}
this.isCheckAll = false
this.getList()
},
/**
* 控制table的选择项
* @param data
*/
effectTableSelect(data = []) {
this.$refs.table.store.states.selection = data
this.$refs.table.store.updateSelectionByRowKey()
this.$refs.table.store.updateAllSelected()
this.$refs.table.$emit('selection-change', data)
// 表格当前手动勾选的
selectChange(selection, row) {
console.log('selectChange', selection, '----', row)
if (this.isCheckAll) {
// 判断当前选中的存不存在,存在删除;不存在添加
if (this.recordIds.includes(row.id)) {
this.recordIds = this.recordIds.filter(id => id !== row.id)
console.log('filter', this.recordIds.filter(id => id !== row.id))
} else {
this.recordIds.push(row.id)
}
} else {
if (this.registerEmptyIds.includes(row.id)) {
this.registerEmptyIds = this.registerEmptyIds.filter(id => id !== row.id)
} else {
this.registerEmptyIds.push(row.id)
}
}
},
/** 功能按钮--导出按钮操作 */
handleExport() {
console.log('queryParams', this.queryParams)
......@@ -325,10 +354,10 @@ export default {
// 重置选择
.then(_ => this.effectTableSelect([]))
},
/** 列表区--多选框选中数据 */
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
},
// /** 列表区--多选框选中数据 */
// handleSelectionChange(selection) {
// this.ids = selection.map(item => item.id)
// },
/** 查询病例管理列表 */
getList() {
this.loading = true
......@@ -336,8 +365,12 @@ export default {
console.log('病历列表的数据:', response)
this.recordList = response.rows.rows
console.log('这是病历,我要开始取字段了!', this.recordList)
// 获取全部挂号的id
this.recordIds = response.rows.idList
this.recordIdsForever = response.rows.idList
this.total = response.total
this.loading = false
this.manualCheck()
// 取消按钮
})
},
......
......@@ -133,7 +133,7 @@
<div style="height: 16px;border-left: 3px solid #5bb647;" />
<div style="padding-left: 10px;">预约信息</div>
<div style="margin-left: auto;padding-right: 50px;">
<el-button class="fourWordsBtn" @click="bookNow">立即预约</el-button>
<el-button v-show="checkDetail.appointTime === null" class="fourWordsBtn" @click="bookNow">立即预约</el-button>
</div>
</div>
<!-- 预约信息 -->
......@@ -195,7 +195,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="检查时段">
<span>-</span>
<span>{{ '-' }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
......@@ -221,6 +221,8 @@
</template>
<script>
import { parseTime } from '../../../utils/ruoyi'
export default {
name: 'CheckDetail',
data() {
......@@ -236,6 +238,7 @@ export default {
console.log('传过来的详情信息', detail)
},
methods: {
parseTime,
// 点击 预约信息-立即预约
bookNow() {
this.$router.push({
......
......@@ -35,7 +35,7 @@
<el-row>
<el-col :span="8">
<el-form-item label="宠物性别">
<span>{{ subscribeMessage.petSex }}</span>
<span>{{ subscribeMessage.petSex === '0' ? '公' : (subscribeMessage.petSex === '1' ? '母' : '未知') }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
......@@ -104,44 +104,47 @@
<el-row>
<el-col :span="8">
<el-form-item label="设备">
<el-select v-model="queryParams.device" clearable multiple collapse-tags placeholder="请选择设备">
<el-select v-model="queryParams.device" clearable multiple collapse-tags placeholder="请选择设备" @change="deviceChange">
<el-option
v-for="item in dict.type.exam_type"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in selectableDevice"
:key="item.id"
:label="item.deviceName"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="检查日期">
<el-select v-model="queryParams.data" clearable multiple collapse-tags placeholder="请选择检查日期">
<el-option
v-for="item in dict.type.exam_type"
:key="item.value"
:label="item.label"
:value="item.value"
<el-date-picker
v-model="queryParams.checkDate"
type="date"
@change="changeDate"
placeholder="请选择检查日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" v-show="subscribeMessage.checkType === '2'">
<el-form-item label="支出账户余额">
11800.00
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 设备表格 -->
<el-table>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="设备名称" align="center" prop="petNickname" />
<el-table-column label="检查日期" align="center" prop="petBreed" />
<el-table-column label="检查时段" align="center" prop="petSex" />
<el-table-column label="剩余可预约" align="center" prop="petAge" />
<el-table :data="deviceList">
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="检查日期" align="center" prop="checkDate" />
<el-table-column label="检查时段" align="center" prop="checkTime" />
<el-table-column label="剩余可预约" align="center" prop="num" />
<el-table-column v-if="subscribeMessage.checkType === '2'" label="设备服务费" align="center" prop="price" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
<template slot-scope="scope">
<el-button
class="bookNow"
size="mini"
icon="el-icon-check"
@click="handleDelete(scope.row)"
class="fourWordsBtn"
@click="handleBookNow(scope.row)"
>立即预约</el-button>
</template>
</el-table-column>
......@@ -150,14 +153,18 @@
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
:page.sync="deviceQueryParams.pageNum"
:limit.sync="deviceQueryParams.pageSize"
@pagination="getDevice"
/>
</div>
</template>
<script>
import { deviceUseInSubscribeList, listReservationDevice } from '@/api/business/device'
import { parseTime } from '@/utils/ruoyi'
import { updateCheck } from '@/api/business/mdeicalRecord'
export default {
name: 'CheckSubscribe',
dicts: ['exam_type'],
......@@ -166,17 +173,104 @@ export default {
checkDetail: {},
queryParams: {},
total: 0,
subscribeMessage: {}
subscribeMessage: {},
deviceQueryParams: {
pageNum: 1,
pageSize: 10,
reservationTime: null, // 检查日期(默认当前日期)
isPrivate: null, // 检查类型(0-外部、1医院)--不变
checkTypeList: [], // 检查项目ID(String[])--不变
deviceIdList: [] // 设备(Long[])
},
// 设备表格数据
deviceList: [],
// 下拉可选择的设备
selectableDevice: [],
// 检查表ID
currentCheckId: null
}
},
created() {
const subscribe = this.$route.query.subscribe
this.subscribeMessage = subscribe
console.log('立即预约页面', this.subscribeMessage)
this.deviceQueryParams.reservationTime = parseTime(new Date(), '{y}-{m}-{d}')
if (this.subscribeMessage.checkType === '0') {
this.deviceQueryParams.isPrivate = '1'
} else if (this.subscribeMessage.checkType === '2') {
this.deviceQueryParams.isPrivate = '0'
}
this.deviceQueryParams.checkTypeList.push(this.subscribeMessage.checkItemsId)
this.currentCheckId = this.subscribeMessage.id
this.getDevice()
this.getAllDevice()
},
methods: {
handleDelete() {
// 点击立即预约
handleBookNow(row) {
this.$confirm('立即预约此设备,是否确定?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
customClass: 'box-logout',
cancelButtonClass: 'resetBtn',
confirmButtonClass: 'queryBtn',
type: 'warning'
}).then(() => {
console.log('预约成功...', row)
const checkMessage = {}
const checkTimeList = row.checkTime.split('-')
checkMessage.id = this.currentCheckId
checkMessage.deviceId = row.deviceId
checkMessage.deviceName = row.deviceName
checkMessage.appointTime = parseTime(new Date())
checkMessage.checkStartTime = row.checkDate + ' ' + checkTimeList[0]
checkMessage.checkEndTime = row.checkDate + ' ' + checkTimeList[1]
console.log('需要修改的对象', checkMessage)
const list = []
list.push(checkMessage)
updateCheck(list).then(res => {
if (res.code === 200) {
this.$modal.msgError('预约设备成功')
}
})
})
},
getList() {},
// 获取设备列表
getDevice() {
listReservationDevice(this.deviceQueryParams).then(res => {
this.deviceList = res.rows.table
this.total = res.total
if (this.subscribeMessage.checkType === '2' && this.deviceList.length > 0) {
this.deviceList.forEach(item => {
item['price'] = this.subscribeMessage.devicePrice
})
}
console.log('列表', this.deviceList)
})
},
// 获取所有设备
getAllDevice() {
deviceUseInSubscribeList({ isPrivate: '1' }).then(res => {
this.selectableDevice = res.data
})
},
getList() {}
// 设备下拉框选中之后的回调函数
deviceChange(val) {
console.log('ddd', val)
this.deviceQueryParams.deviceIdList = val
this.getDevice()
},
// 时间选择器回调函数
changeDate(val) {
console.log('选择时间后', val)
if (val === null) {
this.deviceQueryParams.reservationTime = parseTime(new Date(), '{y}-{m}-{d}')
} else {
this.deviceQueryParams.reservationTime = val
}
this.getDevice()
}
}
}
</script>
......
......@@ -489,7 +489,7 @@ export default {
list.push(checkMessage)
updateCheck(list).then(res => {
if (res.code === 200) {
this.$modal.msgError('预设备成功')
this.$modal.msgError('预设备成功')
}
})
})
......
......@@ -123,7 +123,7 @@
@select="selectChange"
@selection-change="handleSelectionChange"
>
<el-table-column align="center" reserve-selection type="selection" width="55" />
<el-table-column align="center" type="selection" width="55"/>
<el-table-column align="center" label="序号" min-width="55" prop="index" show-overflow-tooltip type="index" />
<el-table-column align="center" label="挂号方式" min-width="70" prop="type" show-overflow-tooltip>
<template slot-scope="scope">
......
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