yanzai 1 year ago
commit c0a87bcabe

@ -113,22 +113,47 @@ class QuestionnairesLogsController extends Controller
'jichu' => self::sum_items($items, $check_items_array['jichu']), 'jichu' => self::sum_items($items, $check_items_array['jichu']),
'tuijian' => self::sum_items($items, $check_items_array['tuijian']), 'tuijian' => self::sum_items($items, $check_items_array['tuijian']),
'gaoduan' => self::sum_items($items, $check_items_array['gaoduan']), 'gaoduan' => self::sum_items($items, $check_items_array['gaoduan']),
],
'count' => [
'jichu' => self::item_count($items, $check_items_array['jichu']),
'tuijian' => self::item_count($items, $check_items_array['tuijian']),
'gaoduan' => self::item_count($items, $check_items_array['gaoduan']),
] ]
]); ]);
} }
public function item_count($items, $check_items)
{
$ic = count($items) + count($check_items['items']) + count($check_items['combo_items']);
return $ic;
}
public function sum_items($items, $check_items) public function sum_items($items, $check_items)
{ {
if (count($items)) {
$sum = DB::table('items')->whereIn('item_id', $items)->where('status', 1)->sum('price'); $sum = DB::table('items')->whereIn('item_id', $items)->where('status', 1)->sum('price');
} else {
$sum = 0;
}
if (count($check_items['items'])) {
$check_sum = DB::table('items')->whereIn('item_id', $check_items['items'])->where('status', 1)->sum('price'); $check_sum = DB::table('items')->whereIn('item_id', $check_items['items'])->where('status', 1)->sum('price');
$combo = DB::table('combos')->whereIn('combo_id', [$check_items['combo']])->where('status', 1)->sum('price'); } else {
$check_sum = 0;
}
if (count($check_items['combo_items'])) {
$combo = DB::table('items')->whereIn('item_id', $check_items['combo_items'])->where('status', 1)->sum('price');
} else {
$combo = 0;
}
$zhekou = config('app.globals.Wj_ZheKou'); $zhekou = config('app.globals.Wj_ZheKou');
return number_format($combo + (($sum + $check_sum) * $zhekou), 2, '.', ''); return number_format((($combo + $sum + $check_sum) * $zhekou), 2, '.', '');
} }
public function submit(Request $request) public function submit(Request $request)
{ {
$question_id = $request->post('question_id'); $question_id = $request->post('question_id');
$content = $request->post('content'); $content = $request->post('content');
$use_time = $request->post('use_time');
$question_info = DB::table('questionnaires')->where('id', $question_id)->first(); $question_info = DB::table('questionnaires')->where('id', $question_id)->first();
if (!$question_info) { if (!$question_info) {
return \Yz::echoError('问卷不存在'); return \Yz::echoError('问卷不存在');
@ -171,6 +196,7 @@ class QuestionnairesLogsController extends Controller
$question_questions = []; $question_questions = [];
} }
$weight = 0; $weight = 0;
$score = 0;
foreach ($question_questions as $value) { foreach ($question_questions as $value) {
$id = $value->id; $id = $value->id;
$option = json_decode($value->option, true); $option = json_decode($value->option, true);
@ -184,6 +210,17 @@ class QuestionnairesLogsController extends Controller
if (isset($question_map["q{$id}"])) { if (isset($question_map["q{$id}"])) {
$v = $question_map["q{$id}"]['active']; $v = $question_map["q{$id}"]['active'];
$item_option = $option['select']['value'][$v]; $item_option = $option['select']['value'][$v];
if ($item_option['type'] === 'score') {
if (!isset($item_option['score'])) {
$item_option['score'] = 0;
}
foreach ($content as $content_key => $content_item) {
if ($content_item['id'] == $id) {
$content[$content_key]['score'] = $item_option['score'];
}
}
$score = $score + $item_option['score'];
}
if ($item_option['type'] === 'items') { if ($item_option['type'] === 'items') {
foreach ($item_option['items'] as $item) { foreach ($item_option['items'] as $item) {
if (!in_array($item, $check_items)) { if (!in_array($item, $check_items)) {
@ -281,10 +318,21 @@ class QuestionnairesLogsController extends Controller
preg_match_all('/\d+/', $weight, $matches); preg_match_all('/\d+/', $weight, $matches);
$weight = $matches[0][0]; $weight = $matches[0][0];
$weight = $weight ? $weight : 0; $weight = $weight ? $weight : 0;
$ip = self::getTrustedProxiesIp();
$ip2region = new \Ip2Region();
$record = $ip2region->simple($ip);
$ip_info = '';
if (!!$record) {
$ip_info = $record;
}
$log_id = DB::table('questionnaires_logs')->insertGetId([ $log_id = DB::table('questionnaires_logs')->insertGetId([
'question_id' => $question_id, 'question_id' => $question_id,
'type' => $type, 'type' => $type,
'weight' => $weight, 'weight' => $weight,
'use_time' => $use_time,
'ip' => $ip,
'ip_info' => $ip_info,
'score' => $score,
'order_id' => '0', 'order_id' => '0',
'person_id' => $person_id, 'person_id' => $person_id,
'person_info' => json_encode($person_info, JSON_UNESCAPED_UNICODE), 'person_info' => json_encode($person_info, JSON_UNESCAPED_UNICODE),
@ -299,4 +347,19 @@ class QuestionnairesLogsController extends Controller
'id' => $log_id 'id' => $log_id
]); ]);
} }
public function getTrustedProxiesIp()
{ //获取用户真实ip
if (getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown')) {
$ip = getenv('HTTP_CLIENT_IP');
} elseif (getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown')) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
} elseif (getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown')) {
$ip = getenv('REMOTE_ADDR');
} elseif (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) {
$ip = $_SERVER['REMOTE_ADDR'];
}
$res = preg_match('/[\d\.]{7,15}/', $ip, $matches) ? $matches[0] : '';
return $res;
}
} }

5976
Laravel/composer.lock generated

File diff suppressed because it is too large Load Diff

@ -58,9 +58,9 @@ const searchClick = (page = 1) => {
} }
const select_option = { const select_option = {
value: [ value: [
{ content: 'A. ', type: 'items', items: [], questions: [] }, { content: 'A. ', type: 'items', items: [], questions: [], score: 0 },
{ content: 'B. ', type: 'items', items: [], questions: [] }, { content: 'B. ', type: 'items', items: [], questions: [], score: 0 },
{ content: 'C. ', type: 'items', items: [], questions: [] } { content: 'C. ', type: 'items', items: [], questions: [], score: 0 }
] ]
} }
const input_option = { const input_option = {
@ -284,7 +284,14 @@ onMounted(() => {
> >
<el-option label="项目" value="items"></el-option> <el-option label="项目" value="items"></el-option>
<el-option label="题目" value="questions"></el-option> <el-option label="题目" value="questions"></el-option>
<el-option label="分数" value="score"></el-option>
</el-select> </el-select>
<template v-if="edit_data.option.select.value[k].type === 'score'">
<el-input-number
v-model="edit_data.option.select.value[k].score"
></el-input-number>
</template>
<template v-else>
<span style="margin-right: 10px" <span style="margin-right: 10px"
>{{ >{{
edit_data.option.select.value[k].type === 'items' edit_data.option.select.value[k].type === 'items'
@ -318,6 +325,7 @@ onMounted(() => {
@click="delQuestionClick(k)" @click="delQuestionClick(k)"
>X >X
</el-button> </el-button>
</template>
</div> </div>
<div> <div>
<el-button type="primary" size="small" @click="addQuestionClick()" <el-button type="primary" size="small" @click="addQuestionClick()"
@ -383,11 +391,16 @@ onMounted(() => {
> >
<span style="margin-right: 10px; width: 400px">{{ i.content }}</span> <span style="margin-right: 10px; width: 400px">{{ i.content }}</span>
<span class="title_wrapper">带出</span> <span class="title_wrapper">带出</span>
<span>{{ scope.row.option.select.value[k].type === 'items' ? '项目' : '题目' }}</span> <span v-if="scope.row.option.select.value[k].type === 'items'"></span>
<span style="margin: 0 5px">{{ <span v-else-if="scope.row.option.select.value[k].type === 'questions'">题目</span>
<span v-else-if="scope.row.option.select.value[k].type === 'score'">分数</span>
<span v-if="scope.row.option.select.value[k].type === 'score'" style="margin: 0 5px">{{
scope.row.option.select.value[k][scope.row.option.select.value[k].type]
}}</span>
<span v-else style="margin: 0 5px">{{
scope.row.option.select.value[k][scope.row.option.select.value[k].type].length scope.row.option.select.value[k][scope.row.option.select.value[k].type].length
}}</span> }}</span>
<span></span> <span>{{ scope.row.option.select.value[k].type === 'score' ? '分' : '' }}</span>
</div> </div>
</div> </div>
</template> </template>

@ -77,16 +77,16 @@
const id = question_info.value.check_items_array[type].combo const id = question_info.value.check_items_array[type].combo
const mergedArray = [...new Set([ const mergedArray = [...new Set([
...question_info.value.items, ...question_info.value.items,
...question_info.value.check_items_array[type].items ...question_info.value.check_items_array[type].items,
...question_info.value.check_items_array[type].combo_items,
])] ])]
let query = "?comboId=" + id + '&wj=1';
if (mergedArray.length !== 0) { if (mergedArray.length !== 0) {
query += "&itemIds=" + mergedArray.join(','); let query = "?wj=1&itemIds=" + mergedArray.join(',');
}
uni.navigateTo({ uni.navigateTo({
url: "/pages/main/tj/tjxq" + query, url: "/pages/main/tj/tjxq" + query,
}); });
} }
}
onShow(() => { onShow(() => {
if (!!config_ref.value) { if (!!config_ref.value) {
@ -108,10 +108,7 @@
<view class="items_title_wrapper"> <view class="items_title_wrapper">
<view class="items_title_text_wrapper">基础推荐方案</view> <view class="items_title_text_wrapper">基础推荐方案</view>
<view class="items_title_count_wrapper"> <view class="items_title_count_wrapper">
<text>{{ question_info.items.length <text>{{ question_info.count.jichu }}</text>
+ question_info.check_items_array.jichu.combo_items.length
+ question_info.check_items_array.jichu.items.length
}}</text>
<view class="count_icon_wrapper"> <view class="count_icon_wrapper">
<uni-icons type="right" size="20"></uni-icons> <uni-icons type="right" size="20"></uni-icons>
</view> </view>
@ -131,10 +128,7 @@
<view class="items_title_wrapper"> <view class="items_title_wrapper">
<view class="items_title_text_wrapper">中等推荐方案</view> <view class="items_title_text_wrapper">中等推荐方案</view>
<view class="items_title_count_wrapper"> <view class="items_title_count_wrapper">
<text>{{ question_info.items.length <text>{{ question_info.count.tuijian }}</text>
+ question_info.check_items_array.tuijian.combo_items.length
+ question_info.check_items_array.tuijian.items.length
}}</text>
<view class="count_icon_wrapper"> <view class="count_icon_wrapper">
<uni-icons type="right" size="20"></uni-icons> <uni-icons type="right" size="20"></uni-icons>
</view> </view>
@ -154,10 +148,7 @@
<view class="items_title_wrapper"> <view class="items_title_wrapper">
<view class="items_title_text_wrapper">高端推荐方案</view> <view class="items_title_text_wrapper">高端推荐方案</view>
<view class="items_title_count_wrapper"> <view class="items_title_count_wrapper">
<text>{{ question_info.items.length <text>{{ question_info.count.gaoduan }}</text>
+ question_info.check_items_array.gaoduan.combo_items.length
+ question_info.check_items_array.gaoduan.items.length
}}</text>
<view class="count_icon_wrapper"> <view class="count_icon_wrapper">
<uni-icons type="right" size="16"></uni-icons> <uni-icons type="right" size="16"></uni-icons>
</view> </view>

@ -37,6 +37,7 @@
const question_info = ref(false) const question_info = ref(false)
const question_list = ref([]) const question_list = ref([])
const question_active = ref(0) const question_active = ref(0)
const start_time = ref(new Date() / 1000)
const getQuestionGet = async () => { const getQuestionGet = async () => {
const response = await $api('QuestionGet', { const response = await $api('QuestionGet', {
id: $props.id, id: $props.id,
@ -46,6 +47,7 @@
question_info.value = response.data.info question_info.value = response.data.info
question_list.value = response.data.list question_list.value = response.data.list
question_active.value = 0 question_active.value = 0
start_time.value = new Date() / 1000
}) })
} }
@ -232,6 +234,7 @@
question_id: $props.id, question_id: $props.id,
content: content, content: content,
person_id: $store.user.person_id, person_id: $store.user.person_id,
use_time: new Date() / 1000 - start_time.value
}) })
$response(response, () => { $response(response, () => {
uni.redirectTo({ uni.redirectTo({

@ -1,81 +1,71 @@
<script setup> <script setup>
import DraggableButton from "@/pages/components/goHome.vue"; import DraggableButton from "@/pages/components/goHome.vue";
/** /**
* name * name
* userselectDoctor * userselectDoctor
* date2024年9月24日 16:24:50 * date2024年9月24日 16:24:50
*/ */
import { import { ref } from "vue";
ref import { $api, $response, $image } from "@/api";
} from 'vue' import { onShow } from "@dcloudio/uni-app";
import { import { useStore } from "@/store";
$api, const $store = useStore();
$response, let dqDate = ref("");
$image let yytjInfo = ref({}); //
} from '@/api' const $props = defineProps({
import {
onShow
} from '@dcloudio/uni-app'
import {
useStore
} from '@/store'
const $store = useStore()
let dqDate = ref('')
let yytjInfo = ref({}); //
const $props = defineProps({
date: { date: {
type: String, type: String,
default: "", default: "",
}, },
}); });
const mountedAction = () => { const mountedAction = () => {
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
}); });
yytjInfo.value = $store.getYytjInfo(); yytjInfo.value = $store.getYytjInfo();
dqDate.value = $props.date ? $props.date : '2024-08-01'; dqDate.value = $props.date ? $props.date : "2024-08-01";
if (dqDate.value) { if (dqDate.value) {
getdoctorList(); // getdoctorList(); //
} }
} };
const doctor_list = ref(false) const doctor_list = ref(false);
const getdoctorList = async () => { const getdoctorList = async () => {
// //
console.log($store, 'store') console.log($store, "store");
let obj = { let obj = {
"date": dqDate.value date: dqDate.value,
}; };
const response = await $api("DoctorGetList", obj); const response = await $api("DoctorGetList", obj);
$response(response, () => { $response(response, () => {
console.log(response, 'response') console.log(response, "response");
doctor_list.value = response.data.list; doctor_list.value = response.data.list;
uni.hideLoading(); uni.hideLoading();
}); });
}; };
const config_ref = ref(null) const config_ref = ref(null);
const configRef = (e) => { const configRef = (e) => {
if (!config_ref.value) { if (!config_ref.value) {
config_ref.value = e config_ref.value = e;
mountedAction() mountedAction();
}
} }
const clickDoctor = (item) => { };
const clickDoctor = (item) => {
yytjInfo.value.doctor_name = item.name; yytjInfo.value.doctor_name = item.name;
yytjInfo.value.nmrIndex = -1;
$store.setYytjInfo(yytjInfo.value); $store.setYytjInfo(yytjInfo.value);
// item.name // item.name
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1,
}); });
};
} onShow(() => {
onShow(() => {
if (!!config_ref.value) { if (!!config_ref.value) {
mountedAction() mountedAction();
} }
}) });
</script> </script>
<template> <template>
<DraggableButton /> <DraggableButton />
@ -83,43 +73,50 @@ import DraggableButton from "@/pages/components/goHome.vue";
<view v-if="!!$store.config"> <view v-if="!!$store.config">
<view :ref="configRef"></view> <view :ref="configRef"></view>
</view> </view>
<view class=" pb-40rpx"> <view class="pb-40rpx">
<view class="h-38rpx bg-#239EA3 pl-20rpx pr-20rpx box-border"> <view class="h-38rpx bg-#239EA3 pl-20rpx pr-20rpx box-border">
<view style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0,0,0,0.04);" <view
class="pb-80rpx pt-30rpx rounded-15rpx bg-#fff"> style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
<view v-for="(item,index) in doctor_list" :key="index" class="p-10rpx "> class="pb-80rpx pt-30rpx rounded-15rpx bg-#fff"
<view class="flex flex-row text-#8B8B8B text-23rpx "> >
<image :src="$image(item.head_img)" class="w-170rpx h-226rpx mr-20rpx "></image> <view
v-for="(item, index) in doctor_list"
:key="index"
class="p-10rpx"
>
<view class="flex flex-row text-#8B8B8B text-23rpx">
<image
:src="$image(item.head_img)"
class="w-170rpx h-226rpx mr-20rpx"
></image>
<view class="flex-1 flex flex-col flex-justify-start pr-20rpx"> <view class="flex-1 flex flex-col flex-justify-start pr-20rpx">
<view class="text-#0E0E0E text-36rpx"> <view class="text-#0E0E0E text-36rpx">
{{item.name}} {{ item.name }}
<span class="text-26rpx text-#515151 ml-10rpx">{{item.level}}</span> <span class="text-26rpx text-#515151 ml-10rpx">{{
item.level
}}</span>
</view> </view>
<view class="mt-33rpx mb-10rpx line-clamp-1"> <view class="mt-33rpx mb-10rpx line-clamp-1">
{{item.hospital}}: {{ item.hospital }}:
<span class="ml-11rpx ">{{item.time}}</span> <span class="ml-11rpx">{{ item.time }}</span>
</view> </view>
<view class="line-clamp-2"> <view class="line-clamp-2">
{{item.desc}} {{ item.desc }}
</view>
<view
@click="clickDoctor(item)"
class="ml-a mt-25rpx w-190rpx h-55rpx bg-#239EA3 rounded-33rpx text-#fff text-21rpx flex flex-justify-center items-center"
>
预约此医生
</view> </view>
<view @click="clickDoctor(item)"
class="ml-a mt-25rpx w-190rpx h-55rpx bg-#239EA3 rounded-33rpx text-#fff text-21rpx flex flex-justify-center items-center">
预约此医生 </view>
</view> </view>
</view> </view>
<view class="w-100% h-1rpx bg-#E6E9E9 mt-15rpx" /> <view class="w-100% h-1rpx bg-#E6E9E9 mt-15rpx" />
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<style scoped> <style scoped></style>
</style>

@ -289,7 +289,7 @@ const comfrimyy = async () => {
console.log(obj); console.log(obj);
const response = await $api("OrderCreate", obj); const response = await $api("OrderCreate", obj);
// return return;
$response(response, () => { $response(response, () => {
if (response.status) { if (response.status) {
if (response.data.action == "pay") { if (response.data.action == "pay") {
@ -361,12 +361,36 @@ onShow(() => {
}); });
const toRouter = (url, status, index) => { const toRouter = (url, status, index) => {
let i = index;
if (status) { if (status) {
console.log(index); if (
yytjInfo.value.nmrIndex = index; yytjInfo.value.nmr_list.length > 1 &&
yytjInfo.value.nmr_list[0].time == ""
) {
//
i = 0;
}
// if (yytjInfo.value.nmr_list.length == 1 && yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time == "") {
// //
// if(index = -1){
// //
// }else{
// //
// }
// nmrIndex.value = 1;
// moreTime(null, 1);
// return;
// }
yytjInfo.value.nmrIndex = i;
console.log(yytjInfo.value); console.log(yytjInfo.value);
uni.setStorageSync("yytjInfoS", yytjInfo.value); uni.setStorageSync("yytjInfoS", yytjInfo.value);
$store.setYytjInfo(yytjInfo.value); $store.setYytjInfo(yytjInfo.value);
if (yytjInfo.value.doctor_date && i == -1) {
uni.navigateTo({
url: `/pages/main/selectDoctor/selectDoctor?date=${yytjInfo.value.doctor_date}`,
});
return;
}
} }
uni.navigateTo({ uni.navigateTo({
url: url, url: url,
@ -625,9 +649,7 @@ const toRouter = (url, status, index) => {
<view <view
class="mb-20rpx between" class="mb-20rpx between"
v-for="(val, index) in yytjInfo?.nmr_list" v-for="(val, index) in yytjInfo?.nmr_list"
@click=" @click="toRouter('/pages/main/yytjsj/yytjsj', 1, index)"
toRouter('/pages/main/yytjsj/yytjsj', 1, val.time ? index : 0)
"
:key="index" :key="index"
v-if="yytjInfo?.nmr_list?.length" v-if="yytjInfo?.nmr_list?.length"
> >
@ -643,7 +665,7 @@ const toRouter = (url, status, index) => {
</view> </view>
<view <view
class="mb-20rpx between" class="mb-20rpx between"
@click="toRouter('/pages/main/yytjsj/yytjsj', 1, 0)" @click="toRouter('/pages/main/yytjsj/yytjsj', 1, -1)"
> >
<text>体检医生</text> <text>体检医生</text>
<text class="text-30rpx">{{ <text class="text-30rpx">{{

@ -76,13 +76,22 @@ const getnmrList = async () => {
}); });
} }
nmrIndex.value = yytjInfo.value.nmrIndex; nmrIndex.value = yytjInfo.value.nmrIndex;
console.log(yytjInfo.value.nmr_list[nmrIndex.value]); if (nmrIndex.value == -1) {
//
if (yytjInfo.value.doctor_date) {
currentDate.value = yytjInfo.value.doctor_date;
}
clickDoctor(1);
} else {
//
xmmcClick(yytjInfo.value.nmr_list[nmrIndex.value], nmrIndex.value); xmmcClick(yytjInfo.value.nmr_list[nmrIndex.value], nmrIndex.value);
}
uni.hideLoading(); uni.hideLoading();
}); });
}; };
const moreTime = async (m, status) => { const moreTime = async (m, status) => {
uni.showLoading({ title: "加载中" });
isClickDoctor.value = status; isClickDoctor.value = status;
// //
const [year, month, day] = currentDate.value.split("-"); const [year, month, day] = currentDate.value.split("-");
@ -128,6 +137,7 @@ const moreTime = async (m, status) => {
console.log(rlArr); console.log(rlArr);
rl_list.value = rlArr; rl_list.value = rlArr;
calendarShow.value = true; calendarShow.value = true;
uni.hideLoading();
}); });
}; };
@ -196,7 +206,7 @@ const getTjTimeList = async (val) => {
time_list.value.forEach((item) => { time_list.value.forEach((item) => {
console.log(item.date); console.log(item.date);
item.newTime = item.time.slice(0, 5); item.newTime = item?.time.slice(0, 5);
item.date = currentDate.value; item.date = currentDate.value;
}); });
date_list.value.forEach((item) => { date_list.value.forEach((item) => {
@ -232,11 +242,36 @@ const changerl = (e) => {
uni.navigateTo({ uni.navigateTo({
url: `/pages/main/selectDoctor/selectDoctor?date=${e.fulldate}`, url: `/pages/main/selectDoctor/selectDoctor?date=${e.fulldate}`,
}); });
return;
} }
if (date_list.value[3]?.date == e.fulldate) { if (date_list.value[3]?.date == e.fulldate) {
calendarShow.value = false; calendarShow.value = false;
return; return;
} }
if (
nmrIndex.value == yytjInfo.value.nmr_list.length - 1 &&
yytjInfo.value.doctor_date
) {
console.log("切换体检时间");
uni.showModal({
title: "提示",
content: "已选择医生,切换日期将重新选择医生,是否继续",
showCancel: true,
success: ({ confirm }) => {
if (confirm) {
currentDate.value = e.fulldate;
time.value = "";
timeIndex.value = null;
yytjInfo.value.nmr_list[nmrIndex.value].time = "";
yytjInfo.value.nmr_list[nmrIndex.value].id = "";
yytjInfo.value.doctor_name = ""; //
getTjTimeList(yytjInfo.value.nmr_list[nmrIndex.value]);
calendarShow.value = false;
}
},
});
return;
}
// uni.showLoading({ // uni.showLoading({
// title: "", // title: "",
// }); // });
@ -263,6 +298,42 @@ const getCurrentClick = (item, i) => {
return; return;
} }
if (i != 3) { if (i != 3) {
if (
nmrIndex.value == yytjInfo.value.nmr_list.length - 1 &&
yytjInfo.value.doctor_date
) {
console.log("切换体检时间");
uni.showModal({
title: "提示",
content: "已选择医生,切换日期将重新选择医生,是否继续",
showCancel: true,
success: ({ confirm }) => {
console.log(confirm);
if (confirm) {
if (yytjInfo.value.nmr_list.length > 1 && nmrIndex.value == 0) {
yytjInfo.value.nmr_list = yytjInfo.value.nmr_list.map((val) => {
return {
...val,
time: "",
id: "",
};
});
}
time.value = "";
timeIndex.value = null;
yytjInfo.value.nmr_list[nmrIndex.value].time = "";
yytjInfo.value.nmr_list[nmrIndex.value].id = "";
yytjInfo.value.doctor_name = ""; //
yytjInfo.value.doctor_date = ""; //
$store.setYytjInfo(yytjInfo.value);
status.value = 0;
currentDate.value = item.date;
getTjTimeList(item); //
}
},
});
return;
}
if (yytjInfo.value.nmr_list.length > 1 && nmrIndex.value == 0) { if (yytjInfo.value.nmr_list.length > 1 && nmrIndex.value == 0) {
yytjInfo.value.nmr_list = yytjInfo.value.nmr_list.map((val) => { yytjInfo.value.nmr_list = yytjInfo.value.nmr_list.map((val) => {
return { return {
@ -305,14 +376,16 @@ const xmmcClick = (val, index, status) => {
if ( if (
yytjInfo.value.nmr_list.length > 1 && yytjInfo.value.nmr_list.length > 1 &&
index != 0 && index != 0 &&
yytjInfo.value.nmr_list[0].time == "" yytjInfo.value.nmr_list[0]?.time == ""
) { ) {
uni.$lu.toast("请先选择" + yytjInfo.value.nmr_list[0].name + "时间"); uni.$lu.toast("请先选择" + yytjInfo.value.nmr_list[0]?.name + "时间");
return; return;
} }
nmrIndex.value = index; nmrIndex.value = index;
time.value = ""; time.value = "";
timeIndex.value = null; timeIndex.value = null;
isClickDoctor.value = 0;
calendarShow.value = false;
if (val.time) { if (val.time) {
currentDate.value = val.time.split(" ")[0]; currentDate.value = val.time.split(" ")[0];
} else { } else {
@ -331,23 +404,29 @@ const xmmcClick = (val, index, status) => {
getTjTimeList(val); getTjTimeList(val);
}; };
const clickDoctor = () => { const clickDoctor = (s) => {
// //
console.log(yytjInfo.value.nmr_list[0]?.time);
console.log(yytjInfo.value.nmr_list[0]?.name);
if ( if (
yytjInfo.value.nmr_list.length > 1 && yytjInfo.value.nmr_list.length > 1 &&
yytjInfo.value.nmr_list[0].time == "" yytjInfo.value.nmr_list[0]?.time == ""
) { ) {
uni.$lu.toast("请先选择" + yytjInfo.value.nmr_list[0].name + "时间"); uni.$lu.toast("请先选择" + yytjInfo.value.nmr_list[0]?.name + "时间");
return; return;
} }
if (yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time == "") { // if (yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1]?.time == "") {
nmrIndex.value = yytjInfo.value.nmr_list?.length - 1; // nmrIndex.value = yytjInfo.value.nmr_list?.length - 1;
nmrIndex.value = -1;
moreTime(null, 1); moreTime(null, 1);
// return;
// }
if (s) {
return; return;
} }
status.value = 0; status.value = 0;
let date = let date =
yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time?.split( yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1]?.time?.split(
" " " "
)[0]; )[0];
yytjInfo.value.doctor_date = date; yytjInfo.value.doctor_date = date;
@ -460,7 +539,7 @@ onShow(() => {
/> />
<view class="flex items-center grow"> <view class="flex items-center grow">
<text class="text-#707070 text-24rpx">您好</text> <text class="text-#707070 text-24rpx">您好</text>
<text class="text-#0E0E0E text-32rpx">{{ groupInfo.name }}</text> <text class="text-#0E0E0E text-32rpx">{{ groupInfo?.name }}</text>
</view> </view>
</view> </view>
<view class="text-24rpx mt-40rpx"> <view class="text-24rpx mt-40rpx">
@ -536,18 +615,17 @@ onShow(() => {
@monthSwitch="monthSwitch" @monthSwitch="monthSwitch"
/> />
</view> </view>
<template v-else>
<view <view
style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)" style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
class="p-16rpx pb-20rpx pt-30rpx rounded-15rpx bg-#fff mt-15rpx" class="p-16rpx pb-20rpx pt-30rpx rounded-15rpx bg-#fff mt-15rpx"
v-if="date_list" v-if="date_list && !calendarShow"
> >
<view class=""> <view class="">
<view <view
class="text-30rpx text-#0E0E0E pb-34rpx font-500" class="text-30rpx text-#0E0E0E pb-34rpx font-500"
v-if="yytjInfo.nmr_list[nmrIndex].name" v-if="yytjInfo.nmr_list[nmrIndex]?.name"
> >
{{ yytjInfo.nmr_list[nmrIndex].name }} {{ yytjInfo.nmr_list[nmrIndex]?.name }}
</view> </view>
<view class="flex mb-30rpx items-center"> <view class="flex mb-30rpx items-center">
<view <view
@ -583,11 +661,7 @@ onShow(() => {
class="flex-1 col center text-#239EA3 text-20rpx bs b-#E7E7E7 b-l-1 h-80rpx" class="flex-1 col center text-#239EA3 text-20rpx bs b-#E7E7E7 b-l-1 h-80rpx"
@click="moreTime(null, 0)" @click="moreTime(null, 0)"
> >
<uni-icons <uni-icons type="calendar" size="30" color="#239EA3"></uni-icons>
type="calendar"
size="30"
color="#239EA3"
></uni-icons>
<text>更多</text> <text>更多</text>
</view> </view>
</view> </view>
@ -645,7 +719,8 @@ onShow(() => {
</view> </view>
<view <view
class="p-20rpx pl-10rpx pr-10rpx rounded-15rpx between" class="p-20rpx pl-10rpx pr-10rpx rounded-15rpx between"
@click="clickDoctor" :class="nmrIndex == -1 ? 'acitvetc' : ''"
@click="clickDoctor()"
> >
<text>体检医生</text> <text>体检医生</text>
<text class="ml-10rpx text-#0E0E0E center"> <text class="ml-10rpx text-#0E0E0E center">
@ -664,7 +739,6 @@ onShow(() => {
确定 确定
</view> </view>
</view> </view>
</template>
</view> </view>
</view> </view>
</template> </template>

Loading…
Cancel
Save