|
|
|
|
@ -54,6 +54,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-loading="loading" style="border: 1px solid #efefef;width: 100%; overflow-x: auto;">
|
|
|
|
|
<div style="text-align: right; padding: 8px; font-size: 12px; color: #999;">数据格式:占位/已用/总数</div>
|
|
|
|
|
<table class="planTable" v-if="planTableData.length>0">
|
|
|
|
|
<tr style="background-color: #f1f1f1;position: relative;">
|
|
|
|
|
<td>
|
|
|
|
|
@ -65,7 +66,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
<td style="min-width: 90px;font-size: 14px;" v-for="(item,index) in date_list">{{item.substring(5,10)}} {{getWeekday(item)}}</td>
|
|
|
|
|
<td style="min-width: 120px;font-size: 14px;" v-for="(item,index) in date_list">{{item.substring(5,10)}} {{getWeekday(item)}}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr v-for="(item,index) in planTableData" :key="index">
|
|
|
|
|
<td v-for="(item2,index2) in item" :key="index2" @mouseover="showTools(item2.id)"
|
|
|
|
|
@ -82,10 +83,15 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="icon_k" @click="GetMingXi(item2,0)">
|
|
|
|
|
<el-icon color="#409eff" size="20">
|
|
|
|
|
<Document />
|
|
|
|
|
<Document />
|
|
|
|
|
</el-icon>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="icon_k" @click="OpenZhanWeiDialog(item2)">
|
|
|
|
|
<el-icon color="#409eff" size="20">
|
|
|
|
|
<Lock />
|
|
|
|
|
</el-icon>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div :class="{'plan_checkbox plan_checkbox_active':isSelected(item2.id),'plan_checkbox':!isSelected(item2.id)}"
|
|
|
|
|
@click="checkBoxCheckFunc(item2.id)">
|
|
|
|
|
@ -95,7 +101,7 @@
|
|
|
|
|
<div class="qudao_count_row">
|
|
|
|
|
<template v-for="(item3,index3) in item2.countsInfo" :key="index3">
|
|
|
|
|
<div v-if="item3 && !(item3.count===0 && item3.used_count===0)">
|
|
|
|
|
<span> {{item3.jiancheng}}</span><span><span class="font_color">{{item3.used_count}}</span>/{{item3.count}} </span>
|
|
|
|
|
<span> {{item3.jiancheng}}</span><span><span v-if="item3.locked_count" class="yellow bold-text">{{item3.locked_count}}</span><span v-if="item3.locked_count">/</span><span class="font_color">{{item3.used_count}}</span>/{{item3.count}} </span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
@ -223,6 +229,64 @@
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<el-dialog v-model="ZhanWeiDialogVisible" title="占位设置" width="40%">
|
|
|
|
|
<div v-loading="loading">
|
|
|
|
|
<el-form v-if="ZhanWeiInfo" label-width="120px" style="padding-right: 40px;">
|
|
|
|
|
<el-form-item label="日期:">
|
|
|
|
|
{{ ZhanWeiInfo.date }}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="星期:">
|
|
|
|
|
{{ ZhanWeiInfo.weekname }}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="科室:">
|
|
|
|
|
{{ ZhanWeiInfo.department_name }}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="资源:">
|
|
|
|
|
{{ ZhanWeiInfo.resources_name }}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="服务组:">
|
|
|
|
|
<el-tag v-for="(item,index) in ZhanWeiInfo.devices" :key="index"
|
|
|
|
|
:type="(item.status===1 && item.is_del===0)?'':'danger'" style="margin-left: 8px">
|
|
|
|
|
{{ item.device_name }}
|
|
|
|
|
</el-tag>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="时间段:">
|
|
|
|
|
开始时间:<span style="font-weight: 700;display: inline-block;margin-right: 8px">{{ ZhanWeiInfo.begin_time }}</span>
|
|
|
|
|
结束时间:<span style="font-weight: 700">{{ ZhanWeiInfo.end_time }}</span>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="渠道占位:">
|
|
|
|
|
<div style="display: flex; flex-direction: column; gap: 10px; width: 100%;">
|
|
|
|
|
<template v-if="ZhanWeiInfo.coutsInfo && ZhanWeiInfo.coutsInfo.length > 0">
|
|
|
|
|
<template v-for="(item,index) in ZhanWeiInfo.coutsInfo" :key="index">
|
|
|
|
|
<div v-if="item && !(item.count===0 && item.used_count===0)"
|
|
|
|
|
style="display: flex; align-items: center; gap: 10px;">
|
|
|
|
|
<div style="width: 80px;">{{ item.name }}</div>
|
|
|
|
|
<div style="flex: 1;">
|
|
|
|
|
<el-input type="number" v-model="ZhanWeiInfo.coutsInfo[index].locked_count" placeholder="占位数量" min="0"
|
|
|
|
|
oninput="value=value.replace(/[^0-9]/g,'')" />
|
|
|
|
|
</div>
|
|
|
|
|
<div style="color: #999; font-size: 12px;">
|
|
|
|
|
剩余可用: {{ item.count - item.used_count }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
<div v-else style="color: #999;">
|
|
|
|
|
暂无渠道数据
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<span class="dialog-footer">
|
|
|
|
|
<el-button @click="ZhanWeiDialogVisible = false">取消</el-button>
|
|
|
|
|
<el-button type="primary" @click="SaveZhanWeiAction">
|
|
|
|
|
确定
|
|
|
|
|
</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup>
|
|
|
|
|
@ -239,12 +303,19 @@
|
|
|
|
|
PlanDetailChangeInfo,
|
|
|
|
|
PlanListGetDetail,
|
|
|
|
|
PlanDetailPlanListDel,
|
|
|
|
|
GetPlanUsedList
|
|
|
|
|
GetPlanUsedList,
|
|
|
|
|
SaveLockedCount
|
|
|
|
|
} from '@/api/api.js'
|
|
|
|
|
import {
|
|
|
|
|
ElMessage,
|
|
|
|
|
ElMessageBox
|
|
|
|
|
} from 'element-plus'
|
|
|
|
|
import {
|
|
|
|
|
Edit,
|
|
|
|
|
Document,
|
|
|
|
|
Select,
|
|
|
|
|
Lock
|
|
|
|
|
} from '@element-plus/icons-vue'
|
|
|
|
|
|
|
|
|
|
let planTableData = ref([])
|
|
|
|
|
let loading = ref(false)
|
|
|
|
|
@ -578,6 +649,71 @@
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
//占位功能
|
|
|
|
|
let ZhanWeiDialogVisible = ref(false)
|
|
|
|
|
let ZhanWeiInfo = ref(null)
|
|
|
|
|
const OpenZhanWeiDialog = (row) => {
|
|
|
|
|
ZhanWeiDialogVisible.value = true
|
|
|
|
|
loading.value = true
|
|
|
|
|
PlanListGetDetail({
|
|
|
|
|
id: row.id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
loading.value = false
|
|
|
|
|
if (res.status) {
|
|
|
|
|
ZhanWeiInfo.value = res.data
|
|
|
|
|
ZhanWeiInfo.value.coutsInfo.forEach(item => {
|
|
|
|
|
if (item.locked_count === null) {
|
|
|
|
|
item.locked_count = 0
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const SaveZhanWeiAction = () => {
|
|
|
|
|
let locked_counts = []
|
|
|
|
|
let hasError = false
|
|
|
|
|
ZhanWeiInfo.value.coutsInfo.forEach((item) => {
|
|
|
|
|
if (hasError) return
|
|
|
|
|
const remaining = item.count - item.used_count
|
|
|
|
|
if (Number(item.locked_count) > remaining) {
|
|
|
|
|
ElMessage.error(`${item.name} 的占位数量不能大于剩余可用数量,最多${remaining}个`)
|
|
|
|
|
hasError = true
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (Number(item.locked_count) < 0) {
|
|
|
|
|
ElMessage.error(`${item.name} 的占位数量不能为负数`)
|
|
|
|
|
hasError = true
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
locked_counts.push({
|
|
|
|
|
appointment_type_id: item.appointment_type_id,
|
|
|
|
|
locked_count: item.locked_count || 0
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
if (hasError) return
|
|
|
|
|
loading.value = true
|
|
|
|
|
SaveLockedCount({
|
|
|
|
|
roster_detail_id: ZhanWeiInfo.value.id,
|
|
|
|
|
locked_counts: locked_counts
|
|
|
|
|
}).then(res => {
|
|
|
|
|
loading.value = false
|
|
|
|
|
if (res.status) {
|
|
|
|
|
ZhanWeiDialogVisible.value = false
|
|
|
|
|
GetList()
|
|
|
|
|
ElMessage.success('占位设置保存成功')
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const getTotalLocked = (countsInfo) => {
|
|
|
|
|
if (!countsInfo || !Array.isArray(countsInfo)) return 0
|
|
|
|
|
return countsInfo.reduce((total, item) => {
|
|
|
|
|
return total + (Number(item.locked_count) || 0)
|
|
|
|
|
}, 0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function formatDateLocal(date) {
|
|
|
|
|
const year = date.getFullYear();
|
|
|
|
|
@ -832,4 +968,7 @@
|
|
|
|
|
.red{
|
|
|
|
|
color:#c81e00;
|
|
|
|
|
}
|
|
|
|
|
.bold-text{
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
</style>
|