Compare commits

...

3 Commits
main ... push

@ -724,6 +724,7 @@ public function SaveLockedCount(Request $request)
$userid = $request->get('userid');
$roster_detail_id = request('roster_detail_id');
$locked_counts = request('locked_counts');
$locked_remark = request('locked_remark');
if (empty($roster_detail_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)) {
DB::table('s_source_roster_detail_log')->insert([
@ -1196,6 +1202,7 @@ public function BatchChangeLocked(Request $request)
}
$ids = request('ids');
$coutsInfo = request('coutsInfo');
$locked_remark = request('locked_remark');
if (empty($ids) || empty($coutsInfo)) {
return \Yz::echoError1('参数错误');
}
@ -1238,6 +1245,10 @@ public function BatchChangeLocked(Request $request)
AND appointment_type_id IN ({$atypeIdsStr})";
$u2 = DB::update($sql);
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, '批量占位成功', []);
} else {
return \Yz::echoError1('批量占位失败');

@ -217,7 +217,7 @@ public function GetList(Request $request)
->leftJoin('s_period','s_list.reservation_time','=','s_period.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')
->where(['s_list.is_del'=>0,'s_list.is_nullify'=>0]);
->where(['s_list.is_del'=>0]);
if($userInfo[0]->group==2){
// $list=$list->whereIn('warddesc', explode(",", $userInfo[0]->ward));
$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']);
}
}
if (isset($searchInfo['list_status'])) {
$list = $list->where('s_list.list_status', $searchInfo['list_status']);
if (isset($searchInfo['list_status']) && $searchInfo['list_status'] !== '' && $searchInfo['list_status'] !== null) {
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'])) {
$list = $list->where('s_list.patient_type', $searchInfo['patient_type']);
@ -303,7 +310,7 @@ public function GetList(Request $request)
//动态排序
$orderField = $searchInfo['orderField'] ?? '';
$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 ($orderField === 'reservation_time') {
$list = $list->orderByRaw("CONCAT(IFNULL(s_list.reservation_date,''), ' ', IFNULL(s_period.period_begin_time,'')) $orderDirection");

@ -287,6 +287,16 @@
</div>
</div>
</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>
</div>
<template #footer>
@ -352,6 +362,16 @@
<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-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>
</div>
<template #footer>
@ -1001,6 +1021,7 @@
let batchOccupyRunning = ref(false)
let batchOccupyForm = ref([])
let batchOccupyLimits = ref({}) // { [appointment_type_id]: { limited: bool, maxValue: number } }
let batchLockedRemark = ref('')
const initBatchOccupyForm = () => {
batchOccupyForm.value = batchChannels.map(ch => ({
appointment_type_id: ch.id,
@ -1024,6 +1045,7 @@
return
}
initBatchOccupyForm()
batchLockedRemark.value = ''
// planTableData count - used_count
const selectedIds = new Set(selectedPlanArr.value)
const channelRemaining = {} // { [appointment_type_id]: number[] }
@ -1078,7 +1100,8 @@
try {
const res = await PlanListBatchChangeLocked({
ids: ids,
coutsInfo: coutsInfo
coutsInfo: coutsInfo,
locked_remark: batchLockedRemark.value
})
batchOccupyRunning.value = false
if (res && res.status) {
@ -1164,7 +1187,8 @@
loading.value = true
SaveLockedCount({
roster_detail_id: ZhanWeiInfo.value.id,
locked_counts: locked_counts
locked_counts: locked_counts,
locked_remark: ZhanWeiInfo.value.locked_remark || ''
}).then(res => {
loading.value = false
if (res.status) {

@ -287,6 +287,16 @@
</div>
</div>
</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>
</div>
<template #footer>
@ -352,6 +362,16 @@
<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-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>
</div>
<template #footer>
@ -1016,6 +1036,7 @@
let batchOccupyRunning = ref(false)
let batchOccupyForm = ref([])
let batchOccupyLimits = ref({}) // { [appointment_type_id]: { limited: bool, maxValue: number } }
let batchLockedRemark = ref('')
const initBatchOccupyForm = () => {
batchOccupyForm.value = batchChannels.map(ch => ({
appointment_type_id: ch.id,
@ -1039,6 +1060,7 @@
return
}
initBatchOccupyForm()
batchLockedRemark.value = ''
// planTableData count - used_count
const selectedIds = new Set(selectedPlanArr.value)
const channelRemaining = {} // { [appointment_type_id]: number[] }
@ -1094,7 +1116,8 @@
const res = await PlanListBatchChangeLocked({
ids: ids,
coutsInfo: coutsInfo,
department_id: searchInfo.value.department_id
department_id: searchInfo.value.department_id,
locked_remark: batchLockedRemark.value
})
batchOccupyRunning.value = false
if (res && res.status) {
@ -1180,7 +1203,8 @@
loading.value = true
SaveLockedCount({
roster_detail_id: ZhanWeiInfo.value.id,
locked_counts: locked_counts
locked_counts: locked_counts,
locked_remark: ZhanWeiInfo.value.locked_remark || ''
}).then(res => {
loading.value = false
if (res.status) {

@ -30,6 +30,7 @@
<el-option label="已预约" value="1" />
<el-option label="已报道" value="2" />
<el-option label="已结束" value="3" />
<el-option label="医嘱作废" value="nullify" />
</el-select>
</el-form-item>
@ -102,25 +103,28 @@
</div>
<el-table :data="tableData" id="tablelist" style="width: 100%;" row-key="id" v-loading="loading" ref="tableref"
@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>
</el-table-column>
<el-table-column prop="list_status" label="状态" width="80" sortable="custom">
<template #default="scope">
<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===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.is_nullify===1" class="ml-2" type="danger"></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===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===3" class="ml-2" type="warning"></el-tag>
</template>
</template>
</el-table-column>
<el-table-column prop="reg_num" label="门诊号" width="120" sortable="custom">
<template #default="scope">
<span v-if="scope.row.patient_type != 0">{{ scope.row.reg_num }}</span>
{{ Number(scope.row.patient_type) !== 0 ? scope.row.reg_num : '' }}
</template>
</el-table-column>
<el-table-column prop="episodeid" label="住院号" width="120" sortable="custom">
<template #default="scope">
<span v-if="scope.row.patient_type == 0">{{ scope.row.episodeid?.slice(-10) }}</span>
{{ Number(scope.row.patient_type) === 0 ? scope.row.episodeid?.slice(-10) : '' }}
</template>
</el-table-column>
<el-table-column prop="user_name" label="姓名" width="100" sortable="custom" />
@ -146,12 +150,12 @@
<span v-if="scope.row.is_pay==0"></span>
</template>
</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">
{{ scope.row.reservation_date }}
</template>
</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">
<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>
@ -167,10 +171,10 @@
<el-table-column prop="docotr" label="申请医生" width="80" />
<el-table-column prop="patient_type" label="病人类型" width="80">
<template #default="scope">
<span v-if="scope.row.patient_type==0"></span>
<span v-if="scope.row.patient_type==1"></span>
<span v-if="scope.row.patient_type==2"></span>
<span v-if="scope.row.patient_type==3"></span>
<span v-if="Number(scope.row.patient_type)===0"></span>
<span v-if="Number(scope.row.patient_type)===1"></span>
<span v-if="Number(scope.row.patient_type)===2"></span>
<span v-if="Number(scope.row.patient_type)===3"></span>
</template>
</el-table-column>
<el-table-column prop="user_phone" label="电话" width="120" sortable="custom" />
@ -265,12 +269,12 @@
</el-table-column>
<el-table-column label="门诊号" width="120">
<template #default="scope">
<span v-if="scope.row.patient_type != 0">{{ scope.row.reg_num }}</span>
{{ Number(scope.row.patient_type) !== 0 ? scope.row.reg_num : '' }}
</template>
</el-table-column>
<el-table-column label="住院号" width="120">
<template #default="scope">
<span v-if="scope.row.patient_type == 0">{{ scope.row.episodeid?.slice(-10) }}</span>
{{ Number(scope.row.patient_type) === 0 ? scope.row.episodeid?.slice(-10) : '' }}
</template>
</el-table-column>
<el-table-column prop="user_name" label="姓名" />
@ -308,10 +312,10 @@
<el-table-column prop="docotr" label="申请医生" width="80" />
<el-table-column prop="patient_type" label="病人类型" width="80">
<template #default="scope">
<span v-if="scope.row.patient_type==0"></span>
<span v-if="scope.row.patient_type==1"></span>
<span v-if="scope.row.patient_type==2"></span>
<span v-if="scope.row.patient_type==3"></span>
<span v-if="Number(scope.row.patient_type)===0"></span>
<span v-if="Number(scope.row.patient_type)===1"></span>
<span v-if="Number(scope.row.patient_type)===2"></span>
<span v-if="Number(scope.row.patient_type)===3"></span>
</template>
</el-table-column>
<el-table-column prop="user_phone" label="电话" width="120" />
@ -459,6 +463,9 @@
GetList()
}
let tableSelected = ref([])
const checkSelectable = (row) => {
return row.is_nullify !== 1
}
const handleSelect = (e) => {
if (e.length > 1) {
const firstStatus = e[0].list_status;

Loading…
Cancel
Save