占用备注,主工作列表显示医嘱作废

push
鹿和sa0ChunLuyu 1 day ago
parent 820866b30e
commit 1741d1592a

@ -724,6 +724,7 @@ public function SaveLockedCount(Request $request)
$userid = $request->get('userid'); $userid = $request->get('userid');
$roster_detail_id = request('roster_detail_id'); $roster_detail_id = request('roster_detail_id');
$locked_counts = request('locked_counts'); $locked_counts = request('locked_counts');
$locked_remark = request('locked_remark');
if (empty($roster_detail_id)) { if (empty($roster_detail_id)) {
return \Yz::echoError1('计划明细ID不能为空'); return \Yz::echoError1('计划明细ID不能为空');
@ -791,6 +792,11 @@ public function SaveLockedCount(Request $request)
} }
} }
// 更新占位备注(时段级,无条件覆盖)
DB::table('s_source_roster_detail')
->where('id', $roster_detail_id)
->update(['locked_remark' => $locked_remark ?? null]);
// 有变更时记录日志 // 有变更时记录日志
if (!empty($changes)) { if (!empty($changes)) {
DB::table('s_source_roster_detail_log')->insert([ DB::table('s_source_roster_detail_log')->insert([
@ -1196,6 +1202,7 @@ public function BatchChangeLocked(Request $request)
} }
$ids = request('ids'); $ids = request('ids');
$coutsInfo = request('coutsInfo'); $coutsInfo = request('coutsInfo');
$locked_remark = request('locked_remark');
if (empty($ids) || empty($coutsInfo)) { if (empty($ids) || empty($coutsInfo)) {
return \Yz::echoError1('参数错误'); return \Yz::echoError1('参数错误');
} }
@ -1238,6 +1245,10 @@ public function BatchChangeLocked(Request $request)
AND appointment_type_id IN ({$atypeIdsStr})"; AND appointment_type_id IN ({$atypeIdsStr})";
$u2 = DB::update($sql); $u2 = DB::update($sql);
if ($u2 !== false) { if ($u2 !== false) {
// 更新占位备注(时段级,无条件覆盖)
DB::table('s_source_roster_detail')
->whereIn('id', array_map('intval', $ids))
->update(['locked_remark' => $locked_remark ?? null]);
return \Yz::Return(true, '批量占位成功', []); return \Yz::Return(true, '批量占位成功', []);
} else { } else {
return \Yz::echoError1('批量占位失败'); return \Yz::echoError1('批量占位失败');

@ -217,7 +217,7 @@ public function GetList(Request $request)
->leftJoin('s_period','s_list.reservation_time','=','s_period.id') ->leftJoin('s_period','s_list.reservation_time','=','s_period.id')
->leftJoin('s_department_resources','s_list.reservation_sources','=','s_department_resources.id') ->leftJoin('s_department_resources','s_list.reservation_sources','=','s_department_resources.id')
->select('s_list.*','s_period.period_begin_time','s_period.period_end_time','s_department_resources.department_resources_name') ->select('s_list.*','s_period.period_begin_time','s_period.period_end_time','s_department_resources.department_resources_name')
->where(['s_list.is_del'=>0,'s_list.is_nullify'=>0]); ->where(['s_list.is_del'=>0]);
if($userInfo[0]->group==2){ if($userInfo[0]->group==2){
// $list=$list->whereIn('warddesc', explode(",", $userInfo[0]->ward)); // $list=$list->whereIn('warddesc', explode(",", $userInfo[0]->ward));
$list=$list->where(['wardcode'=> $department->department_number]); $list=$list->where(['wardcode'=> $department->department_number]);
@ -272,8 +272,15 @@ public function GetList(Request $request)
$list = $list->whereBetween('s_list.reservation_date', $searchInfo['dateRange']); $list = $list->whereBetween('s_list.reservation_date', $searchInfo['dateRange']);
} }
} }
if (isset($searchInfo['list_status'])) { if (isset($searchInfo['list_status']) && $searchInfo['list_status'] !== '' && $searchInfo['list_status'] !== null) {
$list = $list->where('s_list.list_status', $searchInfo['list_status']); if ($searchInfo['list_status'] === 'nullify') {
$list = $list->where('s_list.is_nullify', 1);
} else {
$list = $list->where('s_list.is_nullify', 0)
->where('s_list.list_status', $searchInfo['list_status']);
}
} else {
$list = $list->where('s_list.is_nullify', 0);
} }
if (isset($searchInfo['patient_type'])) { if (isset($searchInfo['patient_type'])) {
$list = $list->where('s_list.patient_type', $searchInfo['patient_type']); $list = $list->where('s_list.patient_type', $searchInfo['patient_type']);
@ -303,7 +310,7 @@ public function GetList(Request $request)
//动态排序 //动态排序
$orderField = $searchInfo['orderField'] ?? ''; $orderField = $searchInfo['orderField'] ?? '';
$orderDirection = ($searchInfo['orderDirection'] ?? '') == 'ascending' ? 'asc' : 'desc'; $orderDirection = ($searchInfo['orderDirection'] ?? '') == 'ascending' ? 'asc' : 'desc';
$allowedFields = ['reg_num', 'episodeid', 'user_name', 'user_sex', 'user_brithday', 'entrust', 'is_pay', 'list_status', 'reservation_department', 'user_phone', 'reservation_time', 'entrust_date_time']; $allowedFields = ['reg_num', 'episodeid', 'user_name', 'user_sex', 'user_brithday', 'entrust', 'is_pay', 'list_status', 'reservation_department', 'user_phone', 'reservation_time', 'reservation_date', 'entrust_date_time'];
if (!empty($orderField) && in_array($orderField, $allowedFields)) { if (!empty($orderField) && in_array($orderField, $allowedFields)) {
if ($orderField === 'reservation_time') { if ($orderField === 'reservation_time') {
$list = $list->orderByRaw("CONCAT(IFNULL(s_list.reservation_date,''), ' ', IFNULL(s_period.period_begin_time,'')) $orderDirection"); $list = $list->orderByRaw("CONCAT(IFNULL(s_list.reservation_date,''), ' ', IFNULL(s_period.period_begin_time,'')) $orderDirection");

@ -287,6 +287,16 @@
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="占位备注:">
<el-input
type="textarea"
v-model="ZhanWeiInfo.locked_remark"
:rows="3"
placeholder="选填,填写占位原因"
maxlength="200"
show-word-limit
/>
</el-form-item>
</el-form> </el-form>
</div> </div>
<template #footer> <template #footer>
@ -352,6 +362,16 @@
<el-col :span="6" style="line-height: 32px; font-weight: 600;">合计</el-col> <el-col :span="6" style="line-height: 32px; font-weight: 600;">合计</el-col>
<el-col :span="8" style="line-height: 32px; font-weight: 600;">占用: {{ batchOccupyTotalLocked }}</el-col> <el-col :span="8" style="line-height: 32px; font-weight: 600;">占用: {{ batchOccupyTotalLocked }}</el-col>
</el-row> </el-row>
<el-form-item label="占位备注:" style="margin-top: 10px;">
<el-input
type="textarea"
v-model="batchLockedRemark"
:rows="3"
placeholder="选填,填写占位原因"
maxlength="200"
show-word-limit
/>
</el-form-item>
</el-form> </el-form>
</div> </div>
<template #footer> <template #footer>
@ -1001,6 +1021,7 @@
let batchOccupyRunning = ref(false) let batchOccupyRunning = ref(false)
let batchOccupyForm = ref([]) let batchOccupyForm = ref([])
let batchOccupyLimits = ref({}) // { [appointment_type_id]: { limited: bool, maxValue: number } } let batchOccupyLimits = ref({}) // { [appointment_type_id]: { limited: bool, maxValue: number } }
let batchLockedRemark = ref('')
const initBatchOccupyForm = () => { const initBatchOccupyForm = () => {
batchOccupyForm.value = batchChannels.map(ch => ({ batchOccupyForm.value = batchChannels.map(ch => ({
appointment_type_id: ch.id, appointment_type_id: ch.id,
@ -1024,6 +1045,7 @@
return return
} }
initBatchOccupyForm() initBatchOccupyForm()
batchLockedRemark.value = ''
// planTableData count - used_count // planTableData count - used_count
const selectedIds = new Set(selectedPlanArr.value) const selectedIds = new Set(selectedPlanArr.value)
const channelRemaining = {} // { [appointment_type_id]: number[] } const channelRemaining = {} // { [appointment_type_id]: number[] }
@ -1078,7 +1100,8 @@
try { try {
const res = await PlanListBatchChangeLocked({ const res = await PlanListBatchChangeLocked({
ids: ids, ids: ids,
coutsInfo: coutsInfo coutsInfo: coutsInfo,
locked_remark: batchLockedRemark.value
}) })
batchOccupyRunning.value = false batchOccupyRunning.value = false
if (res && res.status) { if (res && res.status) {
@ -1164,7 +1187,8 @@
loading.value = true loading.value = true
SaveLockedCount({ SaveLockedCount({
roster_detail_id: ZhanWeiInfo.value.id, roster_detail_id: ZhanWeiInfo.value.id,
locked_counts: locked_counts locked_counts: locked_counts,
locked_remark: ZhanWeiInfo.value.locked_remark || ''
}).then(res => { }).then(res => {
loading.value = false loading.value = false
if (res.status) { if (res.status) {

@ -287,6 +287,16 @@
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="占位备注:">
<el-input
type="textarea"
v-model="ZhanWeiInfo.locked_remark"
:rows="3"
placeholder="选填,填写占位原因"
maxlength="200"
show-word-limit
/>
</el-form-item>
</el-form> </el-form>
</div> </div>
<template #footer> <template #footer>
@ -352,6 +362,16 @@
<el-col :span="6" style="line-height: 32px; font-weight: 600;">合计</el-col> <el-col :span="6" style="line-height: 32px; font-weight: 600;">合计</el-col>
<el-col :span="8" style="line-height: 32px; font-weight: 600;">占用: {{ batchOccupyTotalLocked }}</el-col> <el-col :span="8" style="line-height: 32px; font-weight: 600;">占用: {{ batchOccupyTotalLocked }}</el-col>
</el-row> </el-row>
<el-form-item label="占位备注:" style="margin-top: 10px;">
<el-input
type="textarea"
v-model="batchLockedRemark"
:rows="3"
placeholder="选填,填写占位原因"
maxlength="200"
show-word-limit
/>
</el-form-item>
</el-form> </el-form>
</div> </div>
<template #footer> <template #footer>
@ -1016,6 +1036,7 @@
let batchOccupyRunning = ref(false) let batchOccupyRunning = ref(false)
let batchOccupyForm = ref([]) let batchOccupyForm = ref([])
let batchOccupyLimits = ref({}) // { [appointment_type_id]: { limited: bool, maxValue: number } } let batchOccupyLimits = ref({}) // { [appointment_type_id]: { limited: bool, maxValue: number } }
let batchLockedRemark = ref('')
const initBatchOccupyForm = () => { const initBatchOccupyForm = () => {
batchOccupyForm.value = batchChannels.map(ch => ({ batchOccupyForm.value = batchChannels.map(ch => ({
appointment_type_id: ch.id, appointment_type_id: ch.id,
@ -1039,6 +1060,7 @@
return return
} }
initBatchOccupyForm() initBatchOccupyForm()
batchLockedRemark.value = ''
// planTableData count - used_count // planTableData count - used_count
const selectedIds = new Set(selectedPlanArr.value) const selectedIds = new Set(selectedPlanArr.value)
const channelRemaining = {} // { [appointment_type_id]: number[] } const channelRemaining = {} // { [appointment_type_id]: number[] }
@ -1094,7 +1116,8 @@
const res = await PlanListBatchChangeLocked({ const res = await PlanListBatchChangeLocked({
ids: ids, ids: ids,
coutsInfo: coutsInfo, coutsInfo: coutsInfo,
department_id: searchInfo.value.department_id department_id: searchInfo.value.department_id,
locked_remark: batchLockedRemark.value
}) })
batchOccupyRunning.value = false batchOccupyRunning.value = false
if (res && res.status) { if (res && res.status) {
@ -1180,7 +1203,8 @@
loading.value = true loading.value = true
SaveLockedCount({ SaveLockedCount({
roster_detail_id: ZhanWeiInfo.value.id, roster_detail_id: ZhanWeiInfo.value.id,
locked_counts: locked_counts locked_counts: locked_counts,
locked_remark: ZhanWeiInfo.value.locked_remark || ''
}).then(res => { }).then(res => {
loading.value = false loading.value = false
if (res.status) { if (res.status) {

@ -30,6 +30,7 @@
<el-option label="已预约" value="1" /> <el-option label="已预约" value="1" />
<el-option label="已报道" value="2" /> <el-option label="已报道" value="2" />
<el-option label="已结束" value="3" /> <el-option label="已结束" value="3" />
<el-option label="医嘱作废" value="nullify" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -102,16 +103,19 @@
</div> </div>
<el-table :data="tableData" id="tablelist" style="width: 100%;" row-key="id" v-loading="loading" ref="tableref" <el-table :data="tableData" id="tablelist" style="width: 100%;" row-key="id" v-loading="loading" ref="tableref"
@select="handleSelect" @sort-change="onSortChange"> @select="handleSelect" @sort-change="onSortChange">
<el-table-column type="selection" width="50" fixed="left"> <el-table-column type="selection" width="50" fixed="left" :selectable="checkSelectable">
<template #header><span></span></template> <template #header><span></span></template>
</el-table-column> </el-table-column>
<el-table-column prop="list_status" label="状态" width="80" sortable="custom"> <el-table-column prop="list_status" label="状态" width="80" sortable="custom">
<template #default="scope"> <template #default="scope">
<el-tag v-if="scope.row.is_nullify===1" class="ml-2" type="info"></el-tag>
<template v-else>
<el-tag v-if="scope.row.list_status===0" class="ml-2" type="info"></el-tag> <el-tag v-if="scope.row.list_status===0" class="ml-2" type="info"></el-tag>
<el-tag v-if="scope.row.list_status===1" class="ml-2" type="success"></el-tag> <el-tag v-if="scope.row.list_status===1" class="ml-2" type="success"></el-tag>
<el-tag v-if="scope.row.list_status===2" class="ml-2"></el-tag> <el-tag v-if="scope.row.list_status===2" class="ml-2"></el-tag>
<el-tag v-if="scope.row.list_status===3" class="ml-2" type="warning"></el-tag> <el-tag v-if="scope.row.list_status===3" class="ml-2" type="warning"></el-tag>
</template> </template>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="reg_num" label="门诊号" width="120" sortable="custom"> <el-table-column prop="reg_num" label="门诊号" width="120" sortable="custom">
<template #default="scope"> <template #default="scope">
@ -146,12 +150,12 @@
<span v-if="scope.row.is_pay==0"></span> <span v-if="scope.row.is_pay==0"></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="reservation_time" label="预约日期" width="120" sortable="custom"> <el-table-column prop="reservation_date" label="预约日期" width="120" sortable="custom">
<template #default="scope"> <template #default="scope">
{{ scope.row.reservation_date }} {{ scope.row.reservation_date }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="check_begin_time" label="预约时间" width="120"> <el-table-column prop="reservation_time" label="预约时间" width="120" sortable="custom">
<template #default="scope"> <template #default="scope">
<span <span
v-if="scope.row.period_begin_time && scope.row.period_end_time ">{{scope.row.period_begin_time.substring(0, 5)}}~{{scope.row.period_end_time.substring(0, 5)}}</span> v-if="scope.row.period_begin_time && scope.row.period_end_time ">{{scope.row.period_begin_time.substring(0, 5)}}~{{scope.row.period_end_time.substring(0, 5)}}</span>
@ -459,6 +463,9 @@
GetList() GetList()
} }
let tableSelected = ref([]) let tableSelected = ref([])
const checkSelectable = (row) => {
return row.is_nullify !== 1
}
const handleSelect = (e) => { const handleSelect = (e) => {
if (e.length > 1) { if (e.length > 1) {
const firstStatus = e[0].list_status; const firstStatus = e[0].list_status;

Loading…
Cancel
Save