You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1061 lines
36 KiB
HTML
1061 lines
36 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh">
|
|
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport"
|
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
|
<link type="image/x-icon" rel="shortcut icon" href="./favicon.png" />
|
|
<link rel="stylesheet" href="./assets/import/element-plus.css" />
|
|
<link rel="stylesheet" href="./assets/import/element.css" />
|
|
<link href="./assets/import/tailwind.min.css" rel="stylesheet" />
|
|
<script src="./assets/import/vue.js"></script>
|
|
<script src="./assets/import/element-plus.js"></script>
|
|
<link rel="stylesheet" href="./assets/import/icon/style.css" />
|
|
<script src="./assets/import/axios.js"></script>
|
|
<title>体检登记</title>
|
|
<style>
|
|
[v-cloak] {
|
|
display: none;
|
|
}
|
|
|
|
.cursor-pointer {
|
|
cursor: pointer;
|
|
}
|
|
|
|
.page_wrapper {
|
|
width: calc(100vw - 40px);
|
|
margin: 0 auto;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 20px 0;
|
|
}
|
|
|
|
.input_box_wrapper {
|
|
width: 300px;
|
|
}
|
|
|
|
.select_box_wrapper {
|
|
width: calc(100% - 300px - 20px);
|
|
}
|
|
|
|
.select_input_wrapper {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.price_wrapper {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-top: 10px;
|
|
}
|
|
|
|
.price_value_wrapper {
|
|
font-size: 18px;
|
|
color: rgb(201, 90, 90);
|
|
}
|
|
|
|
.select_flex_wrapper {
|
|
display: flex;
|
|
}
|
|
|
|
.combo_active {
|
|
--el-table-tr-bg-color: #4e75a620;
|
|
}
|
|
|
|
.plan_show_wrapper {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.plan_item_wrapper {
|
|
width: calc((100% / 6) - 10px);
|
|
height: 48px;
|
|
background: #9fea6a;
|
|
border-radius: 6px;
|
|
margin: 5px;
|
|
cursor: pointer;
|
|
text-align: center;
|
|
line-height: 40px;
|
|
font-size: 20px;
|
|
border: 4px solid #ffffff;
|
|
}
|
|
|
|
.plan_item_blank_wrapper {
|
|
width: calc((100% / 6) - 10px);
|
|
margin: 5px;
|
|
}
|
|
|
|
.plan_item_vip_wrapper {
|
|
background: #f6c65e;
|
|
}
|
|
|
|
.plan_item_error_wrapper {
|
|
background: #cccccc;
|
|
}
|
|
|
|
.plan_item_active_wrapper {
|
|
border: 4px solid #cf6464;
|
|
}
|
|
|
|
.select_flex_center_wrapper {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.item_active {
|
|
background: #cccccc50 !important;
|
|
}
|
|
|
|
.table_title_wrapper {
|
|
background: var(--el-fill-color-light);
|
|
border: #ebeef5 1px solid;
|
|
border-bottom: 0px;
|
|
padding: 8px 12px;
|
|
line-height: 23px;
|
|
font-size: 14px;
|
|
color: #909399;
|
|
font-weight: bold;
|
|
}
|
|
</style>
|
|
<script></script>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="app">
|
|
<el-config-provider :button="button_config" :locale="elZh">
|
|
<el-dialog v-model="combo_dialog_show" title="选择套餐" width="800">
|
|
<div>
|
|
<div>
|
|
<div class="select_flex_wrapper">
|
|
<el-form label-width="40px" inline>
|
|
<el-form-item label="简拼">
|
|
<el-input v-model="combo_search_input" placeholder="" />
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-button type="primary" @click="comboSearchClick()">搜索</el-button>
|
|
</div>
|
|
</div>
|
|
<el-table border :data="combo_list_show" style="width: 100%" height="calc(50vh - 45px)" show-overflow-tooltip
|
|
ref="combo_table_ref" @row-click="comboRowClick" :row-class-name="comboRowClassName">
|
|
<el-table-column property="combo_id" label="套餐ID" width="120"></el-table-column>
|
|
<el-table-column property="name" label="套餐名称"></el-table-column>
|
|
<el-table-column label="性别" width="60">
|
|
<template #default="scope">
|
|
{{ ['全部', '男', '女'][scope.row.sex] }}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column property="pinyin" label="套餐简拼" width="120"></el-table-column>
|
|
<el-table-column property="price" label="价格" width="120"></el-table-column>
|
|
</el-table>
|
|
</div>
|
|
</el-dialog>
|
|
|
|
<el-dialog v-model="plan_dialog_show" title="号源" width="800">
|
|
<div>
|
|
<div class="select_flex_wrapper">
|
|
<el-form label-width="40px" inline>
|
|
<el-form-item label="日期">
|
|
<el-date-picker v-model="plan_data.date" type="date" placeholder="请选择号源日期" format="YYYY-MM-DD"
|
|
value-format="YYYY-MM-DD"></el-date-picker>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-button @click="getPlanList()" type="primary">查看号源</el-button>
|
|
</div>
|
|
<div class="plan_show_wrapper">
|
|
<div @click="selectPlanClick(i)" class="plan_item_wrapper" v-for="(i,k) in plan_list" :key="k" :class="[
|
|
i.is_vip === 1 ? 'plan_item_vip_wrapper' : '',
|
|
(i.sex !== Number(input_data.gender) && i.sex !== 0) ? 'plan_item_error_wrapper' : '',
|
|
i.status === 2 ? 'plan_item_error_wrapper' : '',
|
|
(i.is_vip === 1 && input_data.vip !== '1') ? 'plan_item_error_wrapper' : '',
|
|
(i.id === plan_data.active) ? 'plan_item_active_wrapper' : '',
|
|
]">
|
|
{{ i.plan_number }}
|
|
</div>
|
|
<div class="plan_item_blank_wrapper" v-for="(i,k) in 6" :key="k"></div>
|
|
</div>
|
|
<div class="select_flex_center_wrapper">
|
|
<el-button @click="plan_dialog_show = false">取消</el-button>
|
|
<el-button @click="createOrderClick()" type="primary">预约</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
|
|
<div class="page_wrapper">
|
|
<div class="input_box_wrapper">
|
|
<el-form label-width="80px">
|
|
<el-form-item label="院区">
|
|
<el-select v-model="input_data.hospital" placeholder="请选择院区">
|
|
<el-option label="秀英院区" value="1"></el-option>
|
|
<el-option label="府城院区" value="4"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="姓名">
|
|
<el-input v-model="input_data.name" placeholder="请输入姓名" />
|
|
</el-form-item>
|
|
<el-form-item label="证件号">
|
|
<el-input @change="idNumberUpdate" v-model="input_data.id_number" placeholder="请输入证件号" />
|
|
</el-form-item>
|
|
<el-form-item label="手机号">
|
|
<el-input v-model="input_data.phone" placeholder="请输入手机号" />
|
|
</el-form-item>
|
|
<el-form-item label="性别">
|
|
<el-select v-model="input_data.gender" placeholder="请选择性别">
|
|
<el-option label="男" value="1"></el-option>
|
|
<el-option label="女" value="2"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="婚否">
|
|
<el-select v-model="input_data.married" placeholder="请选择婚否">
|
|
<el-option v-for="(i,k) in married_array" :label="i.label" :value="i.value"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="VIP">
|
|
<el-select v-model="input_data.vip" placeholder="请选择VIP类型">
|
|
<el-option label="是" value="1"></el-option>
|
|
<el-option label="否" value="2"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="出生日期">
|
|
<el-date-picker v-model="input_data.birthday" type="date" placeholder="请选择出生日期" format="YYYY-MM-DD"
|
|
value-format="YYYY-MM-DD"></el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item label="登记人">
|
|
<el-input v-model="input_data.doctor" placeholder="请输入登记人" />
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
<div class="select_box_wrapper">
|
|
<div class="select_input_wrapper">
|
|
<div class="select_flex_wrapper">
|
|
<el-form label-width="40px" inline>
|
|
<el-form-item label="简拼">
|
|
<el-input v-model="search_input" placeholder="" />
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-button type="primary" @click="searchClick()">搜索</el-button>
|
|
</div>
|
|
<div class="select_flex_wrapper">
|
|
<el-form v-if="combo_list.length > 0" label-width="40px" inline>
|
|
<el-form-item label="套餐">
|
|
<div class="combo_show_wrapper">
|
|
{{ !!combo_show ? combo_show.name : '无' }}
|
|
</div>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-button @click="selectComboFunc()" type="primary">选择套餐</el-button>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="table_title_wrapper">待选项目</div>
|
|
<el-table border @selection-change="itemSelectionChange" highlight-current-row @row-click="tableRowClick"
|
|
ref="item_table_ref" show-overflow-tooltip :data="item_list_show" style="width: 100%"
|
|
height="calc(50vh - 100px)" :row-class-name="itemTableRowClassName">
|
|
<el-table-column type="selection" width="38"></el-table-column>
|
|
<el-table-column property="title" label="项目名称" width="120"></el-table-column>
|
|
<el-table-column property="price" label="价格" width="80"></el-table-column>
|
|
<el-table-column property="group" label="科室" width="80"></el-table-column>
|
|
<el-table-column label="性别" width="60">
|
|
<template #default="scope">
|
|
{{ ['全部', '男', '女'][scope.row.sex] }}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column property="desc" label="备注"></el-table-column>
|
|
<el-table-column property="id" label="项目ID" width="120"></el-table-column>
|
|
<el-table-column property="can_qian_hou" label="餐前/餐后" width="90"></el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<div class="mt-3">
|
|
<div class="table_title_wrapper">已选项目</div>
|
|
<el-table border :data="select_table_computed" style="width: 100%" height="calc(50vh - 45px - 79px)"
|
|
show-overflow-tooltip ref="select_table_ref" row-class-name="cursor-pointer" highlight-current-row
|
|
@row-click="itemRowClick">
|
|
<el-table-column type="selection" width="38"></el-table-column>
|
|
<el-table-column property="name" label="项目名称" width="120"></el-table-column>
|
|
<el-table-column property="group" label="科室" width="100"></el-table-column>
|
|
<el-table-column property="desc" label="备注"></el-table-column>
|
|
<el-table-column property="type" label="类型" width="80"></el-table-column>
|
|
<el-table-column property="id" label="项目ID" width="120"></el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<div class="price_wrapper">
|
|
<div class="price_value_wrapper">
|
|
<span v-if="!!pay_info">合计价格:¥ {{ pay_info.true_price }}</span>
|
|
</div>
|
|
<div>
|
|
<el-button @click="removeItemClick()" type="danger">移除项目</el-button>
|
|
<el-button @click="planDialogShowClick()" type="primary">预约登记</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</el-config-provider>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
const { createApp, onMounted, ref, nextTick, computed } = Vue;
|
|
const { ElLoading, ElMessage, ElMessageBox } = ElementPlus;
|
|
</script>
|
|
<script src="./assets/mounting.js"></script>
|
|
<script>
|
|
const App = {
|
|
setup() {
|
|
var zhCn = {
|
|
name: "zh-cn",
|
|
el: {
|
|
breadcrumb: {
|
|
label: "\u9762\u5305\u5C51"
|
|
},
|
|
colorpicker: {
|
|
confirm: "\u786E\u5B9A",
|
|
clear: "\u6E05\u7A7A"
|
|
},
|
|
datepicker: {
|
|
now: "\u6B64\u523B",
|
|
today: "\u4ECA\u5929",
|
|
cancel: "\u53D6\u6D88",
|
|
clear: "\u6E05\u7A7A",
|
|
confirm: "\u786E\u5B9A",
|
|
selectDate: "\u9009\u62E9\u65E5\u671F",
|
|
selectTime: "\u9009\u62E9\u65F6\u95F4",
|
|
startDate: "\u5F00\u59CB\u65E5\u671F",
|
|
startTime: "\u5F00\u59CB\u65F6\u95F4",
|
|
endDate: "\u7ED3\u675F\u65E5\u671F",
|
|
endTime: "\u7ED3\u675F\u65F6\u95F4",
|
|
prevYear: "\u524D\u4E00\u5E74",
|
|
nextYear: "\u540E\u4E00\u5E74",
|
|
prevMonth: "\u4E0A\u4E2A\u6708",
|
|
nextMonth: "\u4E0B\u4E2A\u6708",
|
|
year: "\u5E74",
|
|
month1: "1 \u6708",
|
|
month2: "2 \u6708",
|
|
month3: "3 \u6708",
|
|
month4: "4 \u6708",
|
|
month5: "5 \u6708",
|
|
month6: "6 \u6708",
|
|
month7: "7 \u6708",
|
|
month8: "8 \u6708",
|
|
month9: "9 \u6708",
|
|
month10: "10 \u6708",
|
|
month11: "11 \u6708",
|
|
month12: "12 \u6708",
|
|
weeks: {
|
|
sun: "\u65E5",
|
|
mon: "\u4E00",
|
|
tue: "\u4E8C",
|
|
wed: "\u4E09",
|
|
thu: "\u56DB",
|
|
fri: "\u4E94",
|
|
sat: "\u516D"
|
|
},
|
|
months: {
|
|
jan: "\u4E00\u6708",
|
|
feb: "\u4E8C\u6708",
|
|
mar: "\u4E09\u6708",
|
|
apr: "\u56DB\u6708",
|
|
may: "\u4E94\u6708",
|
|
jun: "\u516D\u6708",
|
|
jul: "\u4E03\u6708",
|
|
aug: "\u516B\u6708",
|
|
sep: "\u4E5D\u6708",
|
|
oct: "\u5341\u6708",
|
|
nov: "\u5341\u4E00\u6708",
|
|
dec: "\u5341\u4E8C\u6708"
|
|
}
|
|
},
|
|
select: {
|
|
loading: "\u52A0\u8F7D\u4E2D",
|
|
noMatch: "\u65E0\u5339\u914D\u6570\u636E",
|
|
noData: "\u65E0\u6570\u636E",
|
|
placeholder: "\u8BF7\u9009\u62E9"
|
|
},
|
|
cascader: {
|
|
noMatch: "\u65E0\u5339\u914D\u6570\u636E",
|
|
loading: "\u52A0\u8F7D\u4E2D",
|
|
placeholder: "\u8BF7\u9009\u62E9",
|
|
noData: "\u6682\u65E0\u6570\u636E"
|
|
},
|
|
pagination: {
|
|
goto: "\u524D\u5F80",
|
|
pagesize: "\u6761/\u9875",
|
|
total: "\u5171 {total} \u6761",
|
|
pageClassifier: "\u9875",
|
|
page: "\u9875",
|
|
prev: "\u4E0A\u4E00\u9875",
|
|
next: "\u4E0B\u4E00\u9875",
|
|
currentPage: "\u7B2C {pager} \u9875",
|
|
prevPages: "\u5411\u524D {pager} \u9875",
|
|
nextPages: "\u5411\u540E {pager} \u9875",
|
|
deprecationWarning: "\u4F60\u4F7F\u7528\u4E86\u4E00\u4E9B\u5DF2\u88AB\u5E9F\u5F03\u7684\u7528\u6CD5\uFF0C\u8BF7\u53C2\u8003 el-pagination \u7684\u5B98\u65B9\u6587\u6863"
|
|
},
|
|
messagebox: {
|
|
title: "\u63D0\u793A",
|
|
confirm: "\u786E\u5B9A",
|
|
cancel: "\u53D6\u6D88",
|
|
error: "\u8F93\u5165\u7684\u6570\u636E\u4E0D\u5408\u6CD5!"
|
|
},
|
|
upload: {
|
|
deleteTip: "\u6309 delete \u952E\u53EF\u5220\u9664",
|
|
delete: "\u5220\u9664",
|
|
preview: "\u67E5\u770B\u56FE\u7247",
|
|
continue: "\u7EE7\u7EED\u4E0A\u4F20"
|
|
},
|
|
table: {
|
|
emptyText: "\u6682\u65E0\u6570\u636E",
|
|
confirmFilter: "\u7B5B\u9009",
|
|
resetFilter: "\u91CD\u7F6E",
|
|
clearFilter: "\u5168\u90E8",
|
|
sumText: "\u5408\u8BA1"
|
|
},
|
|
tour: {
|
|
next: "\u4E0B\u4E00\u6B65",
|
|
previous: "\u4E0A\u4E00\u6B65",
|
|
finish: "\u7ED3\u675F\u5BFC\u89C8"
|
|
},
|
|
tree: {
|
|
emptyText: "\u6682\u65E0\u6570\u636E"
|
|
},
|
|
transfer: {
|
|
noMatch: "\u65E0\u5339\u914D\u6570\u636E",
|
|
noData: "\u65E0\u6570\u636E",
|
|
titles: ["\u5217\u8868 1", "\u5217\u8868 2"],
|
|
filterPlaceholder: "\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",
|
|
noCheckedFormat: "\u5171 {total} \u9879",
|
|
hasCheckedFormat: "\u5DF2\u9009 {checked}/{total} \u9879"
|
|
},
|
|
image: {
|
|
error: "\u52A0\u8F7D\u5931\u8D25"
|
|
},
|
|
pageHeader: {
|
|
title: "\u8FD4\u56DE"
|
|
},
|
|
popconfirm: {
|
|
confirmButtonText: "\u786E\u5B9A",
|
|
cancelButtonText: "\u53D6\u6D88"
|
|
},
|
|
carousel: {
|
|
leftArrow: "\u4E0A\u4E00\u5F20\u5E7B\u706F\u7247",
|
|
rightArrow: "\u4E0B\u4E00\u5F20\u5E7B\u706F\u7247",
|
|
indicator: "\u5E7B\u706F\u7247\u5207\u6362\u81F3\u7D22\u5F15 {index}"
|
|
}
|
|
}
|
|
};
|
|
let elZh = zhCn
|
|
const button_config = {
|
|
autoInsertSpace: true,
|
|
};
|
|
|
|
const search_input = ref("");
|
|
const select_items_deep = ref("");
|
|
const select_data_default = {
|
|
combo: "",
|
|
items: "",
|
|
};
|
|
const select_data = ref(
|
|
JSON.parse(JSON.stringify(select_data_default))
|
|
);
|
|
|
|
const formatDatetime = (datetime, format = "YYYY-MM-DD HH:mm:ss") => {
|
|
let date = new Date(datetime);
|
|
let year = date.getFullYear();
|
|
let month = date.getMonth() + 1;
|
|
let day = date.getDate();
|
|
let hour = date.getHours();
|
|
let minute = date.getMinutes();
|
|
let second = date.getSeconds();
|
|
if (month < 10) month = "0" + month;
|
|
if (day < 10) day = "0" + day;
|
|
if (hour < 10) hour = "0" + hour;
|
|
if (minute < 10) minute = "0" + minute;
|
|
if (second < 10) second = "0" + second;
|
|
return format
|
|
.replace("YYYY", year)
|
|
.replace("MM", month)
|
|
.replace("DD", day)
|
|
.replace("HH", hour)
|
|
.replace("mm", minute)
|
|
.replace("ss", second);
|
|
};
|
|
const plan_data_default = {
|
|
active: '',
|
|
date: formatDatetime(new Date(), "YYYY-MM-DD"),
|
|
};
|
|
const plan_data = ref(JSON.parse(JSON.stringify(plan_data_default)))
|
|
const married_array = [{
|
|
value: '已婚',
|
|
label: '已婚'
|
|
}, {
|
|
value: '未婚',
|
|
label: '未婚'
|
|
}, {
|
|
value: '丧偶',
|
|
label: '丧偶'
|
|
}, {
|
|
value: '离婚',
|
|
label: '离婚'
|
|
}, {
|
|
value: '其他',
|
|
label: '其他'
|
|
}]
|
|
const input_data_default = {
|
|
hospital: "1",
|
|
name: "",
|
|
id_number: "",
|
|
phone: "",
|
|
gender: "1",
|
|
married: "未婚",
|
|
vip: "2",
|
|
doctor: "",
|
|
birthday: formatDatetime(new Date(), "YYYY-MM-DD"),
|
|
};
|
|
const api_map = {
|
|
ItemGetList: "/api/Web/ItemGetList",
|
|
ComboGetList: "/api/Web/ComboGetList",
|
|
BuyInfo: "/api/Web/BuyInfo",
|
|
Create: "/api/Web/Create",
|
|
GetDayPlanList: "/api/H5/GetDayPlanList",
|
|
CreateYuYueOrder: "/api/Web/CreateYuYueOrder"
|
|
};
|
|
const $api = (key) => {
|
|
return api_map[key];
|
|
};
|
|
const item_list = ref([]);
|
|
const item_list_show = ref([]);
|
|
const saveSelectDeep = () => {
|
|
const select_str = select_data.value.items;
|
|
const deep_str = select_items_deep.value;
|
|
let ids = [];
|
|
let ids_array = [];
|
|
for (let i in item_list_show.value) {
|
|
ids_array.push(item_list_show.value[i].id)
|
|
}
|
|
const deep_str_split = deep_str.split(",")
|
|
const select_str_split = select_str.split(",")
|
|
for (let i in deep_str_split) {
|
|
if (!ids_array.includes(deep_str_split[i])) {
|
|
if (!ids.includes(deep_str_split[i])) {
|
|
!!deep_str_split[i] && ids.push(deep_str_split[i]);
|
|
}
|
|
}
|
|
}
|
|
for (let i in select_str_split) {
|
|
if (!ids.includes(select_str_split[i])) {
|
|
!!select_str_split[i] && ids.push(select_str_split[i]);
|
|
}
|
|
}
|
|
select_items_deep.value = ids.join(',');
|
|
};
|
|
const search_input_deep = ref('search_input_deep')
|
|
const combo_search_input = ref('')
|
|
const combo_search_input_deep = ref('')
|
|
const comboSearchClick = () => {
|
|
if (combo_search_input.value === combo_search_input_deep.value) {
|
|
return
|
|
}
|
|
combo_search_input_deep.value = combo_search_input.value
|
|
}
|
|
const searchClick = () => {
|
|
if (search_input_deep.value === search_input.value) {
|
|
return
|
|
}
|
|
search_input_deep.value = search_input.value
|
|
saveSelectDeep();
|
|
if (!!search_input.value) {
|
|
let search_str = search_input.value.toUpperCase();
|
|
let il = []
|
|
for (let i in item_list.value) {
|
|
if (!!item_list.value[i].pinyin.includes(search_str)) {
|
|
il.push(item_list.value[i])
|
|
}
|
|
}
|
|
item_list_show.value = il
|
|
} else {
|
|
item_list_show.value = item_list.value
|
|
}
|
|
nextTick(() => {
|
|
let select_deep = JSON.parse(JSON.stringify(select_items_deep.value)).split(',')
|
|
get_buy_info.value = false
|
|
for (let i in item_list_show.value) {
|
|
if (select_deep.includes(item_list_show.value[i].id)) {
|
|
item_table_ref.value.toggleRowSelection(item_list_show.value[i]);
|
|
}
|
|
}
|
|
const select_items = item_table_ref.value.getSelectionRows();
|
|
let ids = [];
|
|
select_items.forEach((item) => {
|
|
if (!ids.includes(item.id)) {
|
|
ids.push(item.id);
|
|
}
|
|
});
|
|
select_data.value.items = ids.join(",");
|
|
get_buy_info.value = true
|
|
getBuyInfo('2');
|
|
})
|
|
}
|
|
const getSelectItemIds = () => {
|
|
const select_str = select_data.value.items;
|
|
const deep_str = select_items_deep.value;
|
|
let ids = [];
|
|
let ids_array = [];
|
|
for (let i in item_list_show.value) {
|
|
ids_array.push(item_list_show.value[i].id)
|
|
}
|
|
const deep_str_split = deep_str.split(",")
|
|
const select_str_split = select_str.split(",")
|
|
for (let i in deep_str_split) {
|
|
if (!ids_array.includes(deep_str_split[i])) {
|
|
if (!ids.includes(deep_str_split[i])) {
|
|
!!deep_str_split[i] && ids.push(deep_str_split[i]);
|
|
}
|
|
}
|
|
}
|
|
for (let i in select_str_split) {
|
|
if (!ids.includes(select_str_split[i])) {
|
|
!!select_str_split[i] && ids.push(select_str_split[i]);
|
|
}
|
|
}
|
|
return ids
|
|
}
|
|
const pay_info = ref(false)
|
|
const getBuyInfo = async (type) => {
|
|
let item_ids = getSelectItemIds();
|
|
let combo_id = select_data.value.combo;
|
|
if (item_ids.length === 0 && !combo_id && type !== '3') {
|
|
pay_info.value = false
|
|
return
|
|
}
|
|
const response = await await axios.post($api('BuyInfo'), {
|
|
hospital: input_data.value.hospital,
|
|
combo_id: combo_id,
|
|
item_ids: item_ids,
|
|
});
|
|
window.$response(response, () => {
|
|
pay_info.value = response.data.data;
|
|
})
|
|
}
|
|
const getItemGetList = async () => {
|
|
const response = await axios.post($api("ItemGetList"));
|
|
window.$response(response.data, () => {
|
|
let il_map = response.data.data.list;
|
|
let il = [];
|
|
for (let i in il_map) {
|
|
for (let j in il_map[i].children) {
|
|
il.push({
|
|
...il_map[i].children[j],
|
|
group: il_map[i].title,
|
|
group_id: il_map[i].id,
|
|
});
|
|
}
|
|
}
|
|
item_list.value = il;
|
|
searchClick();
|
|
getComboGetList();
|
|
});
|
|
};
|
|
const combo_list = ref([])
|
|
const combo_list_show = computed(() => {
|
|
if (!!combo_search_input_deep.value) {
|
|
let search_str = combo_search_input_deep.value.toUpperCase();
|
|
let il = []
|
|
for (let i in combo_list.value) {
|
|
if (!!combo_list.value[i].pinyin.includes(search_str)) {
|
|
il.push(combo_list.value[i])
|
|
}
|
|
}
|
|
return il
|
|
} else {
|
|
return combo_list.value
|
|
}
|
|
})
|
|
const getComboGetList = async () => {
|
|
const response = await axios.post($api("ComboGetList"), {
|
|
hospital: input_data.value.hospital,
|
|
sex: !!input_data.value.name ? input_data.value.gender : 0,
|
|
});
|
|
window.$response(response.data, () => {
|
|
combo_list.value = response.data.data.list;
|
|
});
|
|
};
|
|
const input_data = ref(JSON.parse(JSON.stringify(input_data_default)));
|
|
const idNumberUpdate = () => {
|
|
input_data.value.id_number = input_data.value.id_number.toUpperCase();
|
|
let id_number = input_data.value.id_number;
|
|
if (id_number.length !== 15 && id_number.length !== 18) {
|
|
return;
|
|
}
|
|
let birthday = "";
|
|
switch (id_number.length) {
|
|
case 15:
|
|
birthday = "19" + id_number.substr(6, 6);
|
|
break;
|
|
case 18:
|
|
birthday = id_number.substr(6, 8);
|
|
break;
|
|
}
|
|
birthday = formatDatetime(
|
|
new Date(
|
|
birthday.substr(0, 4) +
|
|
"-" +
|
|
birthday.substr(4, 2) +
|
|
"-" +
|
|
birthday.substr(6, 2) +
|
|
" 00:00:00"
|
|
),
|
|
"YYYY-MM-DD"
|
|
);
|
|
!!birthday && (input_data.value.birthday = birthday);
|
|
let gender = "";
|
|
switch (id_number.substr(-2, 1)) {
|
|
case "1":
|
|
case "3":
|
|
case "5":
|
|
case "7":
|
|
case "9":
|
|
gender = "1";
|
|
break;
|
|
case "2":
|
|
case "4":
|
|
case "6":
|
|
case "8":
|
|
gender = "2";
|
|
break;
|
|
}
|
|
!!gender && (input_data.value.gender = gender);
|
|
};
|
|
|
|
const getQueryData = () => {
|
|
let query = {};
|
|
let query_str = location.search.substr(1);
|
|
let query_arr = query_str.split("&");
|
|
query_arr.forEach((item) => {
|
|
let item_arr = item.split("=");
|
|
query[item_arr[0]] = decodeURIComponent(item_arr[1]);
|
|
});
|
|
for (let i in input_data_default) {
|
|
input_data.value[i] = query[i] || input_data_default[i];
|
|
}
|
|
for (let i in select_data_default) {
|
|
select_data.value[i] = query[i] || select_data_default[i];
|
|
}
|
|
};
|
|
const item_table_ref = ref(false);
|
|
const select_table_computed = computed(() => {
|
|
let items = []
|
|
if (!!pay_info.value) {
|
|
if (!!pay_info.value.combo_info) {
|
|
let combo_items = pay_info.value.combo_info.items
|
|
for (let i in combo_items) {
|
|
for (let j in combo_items[i].children) {
|
|
items.push({
|
|
...combo_items[i].children[j],
|
|
group: combo_items[i].keshi_name,
|
|
type: '套餐'
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!!pay_info.value) {
|
|
if (!!pay_info.value.items_info) {
|
|
let group_items = pay_info.value.items_info.items
|
|
for (let i in group_items) {
|
|
for (let j in group_items[i].children) {
|
|
items.push({
|
|
...group_items[i].children[j],
|
|
group: group_items[i].keshi_name,
|
|
type: '自选'
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return [
|
|
...items,
|
|
]
|
|
});
|
|
const tableRowClick = (e, index) => {
|
|
const select_rows = item_table_ref.value.getSelectionRows();
|
|
let is_exist = false;
|
|
select_rows.forEach((item) => {
|
|
if (item.id === e.id) {
|
|
is_exist = true;
|
|
}
|
|
});
|
|
item_table_ref.value.toggleRowSelection(e, !is_exist);
|
|
};
|
|
const itemRowClick = (e, index) => {
|
|
if (e.type === '自选') {
|
|
const select_rows = select_table_ref.value.getSelectionRows();
|
|
let is_exist = false;
|
|
select_rows.forEach((item) => {
|
|
if (item.id === e.id) {
|
|
is_exist = true;
|
|
}
|
|
});
|
|
select_table_ref.value.toggleRowSelection(e, !is_exist);
|
|
}
|
|
};
|
|
const get_buy_info = ref(true)
|
|
const itemSelectionChange = () => {
|
|
const select_items = item_table_ref.value.getSelectionRows();
|
|
let ids = [];
|
|
select_items.forEach((item) => {
|
|
if (!ids.includes(item.id)) {
|
|
ids.push(item.id);
|
|
}
|
|
});
|
|
select_data.value.items = ids.join(",");
|
|
if (!!get_buy_info.value) {
|
|
getBuyInfo('1');
|
|
}
|
|
};
|
|
|
|
const select_table_ref = ref(null)
|
|
const removeItemClick = () => {
|
|
const select_items = select_table_ref.value.getSelectionRows();
|
|
let has_combo_items = false
|
|
for (let i in select_items) {
|
|
if (select_items[i].type !== '自选') {
|
|
has_combo_items = true
|
|
break
|
|
}
|
|
}
|
|
if (!!has_combo_items) {
|
|
return window.$message().error('套餐内项目不可移除')
|
|
}
|
|
const select_str = select_data.value.items;
|
|
const deep_str = select_items_deep.value;
|
|
const select_str_split = select_str.split(",")
|
|
const deep_str_split = deep_str.split(",")
|
|
let select_ids = []
|
|
for (let i in select_items) {
|
|
select_ids.push(select_items[i].id)
|
|
if (select_str_split.includes(select_items[i])) {
|
|
select_str_split.splice(select_str_split.indexOf(select_items[i]), 1);
|
|
}
|
|
if (deep_str_split.includes(select_items[i])) {
|
|
deep_str_split.splice(deep_str_split.indexOf(select_items[i]), 1);
|
|
}
|
|
}
|
|
const select_rows = item_table_ref.value.getSelectionRows();
|
|
for (let i in select_rows) {
|
|
if (select_ids.includes(select_rows[i].id)) {
|
|
item_table_ref.value.toggleRowSelection(select_rows[i], false);
|
|
}
|
|
}
|
|
getBuyInfo('3');
|
|
}
|
|
const selectComboFunc = ()=>{
|
|
combo_dialog_show.value = true
|
|
ComboisClickDisabled.value = false;
|
|
}
|
|
const combo_table_ref = ref(null)
|
|
const combo_dialog_show = ref(false)
|
|
let ComboisClickDisabled =ref(false) ;
|
|
const comboRowClick = (e, index) => {
|
|
if (ComboisClickDisabled.value) return;
|
|
ComboisClickDisabled.value = true;
|
|
if (select_data.value.combo === e.combo_id) {
|
|
select_data.value.combo = ''
|
|
} else {
|
|
select_data.value.combo = e.combo_id
|
|
}
|
|
getBuyInfo('4');
|
|
combo_dialog_show.value = false
|
|
}
|
|
|
|
const comboRowClassName = ({ row }) => {
|
|
if (select_data.value.combo === row.combo_id) {
|
|
return 'combo_active cursor-pointer'
|
|
} else {
|
|
return 'cursor-pointer'
|
|
}
|
|
}
|
|
const combo_show = computed(() => {
|
|
if (!select_data.value.combo) {
|
|
return false
|
|
} else {
|
|
for (let i in combo_list.value) {
|
|
if (Number(select_data.value.combo) === Number(combo_list.value[i].combo_id)) {
|
|
return combo_list.value[i]
|
|
}
|
|
}
|
|
}
|
|
select_data.value.combo = ''
|
|
getBuyInfo('5');
|
|
return false
|
|
})
|
|
|
|
const plan_dialog_show = ref(false)
|
|
const checkInputData = () => {
|
|
if (input_data.value.name === '') {
|
|
window.$message().error('请输入姓名')
|
|
return false
|
|
}
|
|
if (input_data.value.phone === '') {
|
|
window.$message().error('请输入手机号')
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
const planDialogShowClick = () => {
|
|
const check = checkInputData()
|
|
if (!!check) {
|
|
plan_data.value.active = ''
|
|
getPlanList();
|
|
}
|
|
}
|
|
const selectPlanClick = (plan) => {
|
|
if (plan_data.value.active === plan.id) {
|
|
plan_data.value.active = ''
|
|
} else {
|
|
if (plan.status === 2) {
|
|
return window.$message().error('号源不可用')
|
|
}
|
|
if (plan.sex !== Number(input_data.value.gender) && plan.sex !== 0) {
|
|
return window.$message().error('号源性别不符')
|
|
}
|
|
if (plan.is_vip === 1 && input_data.value.vip !== '1') {
|
|
return window.$message().error('号源VIP不符')
|
|
}
|
|
plan_data.value.active = plan.id
|
|
}
|
|
}
|
|
const plan_list = ref([])
|
|
const getPlanList = async () => {
|
|
if(input_data.value.gender==='男') input_data.value.gender="1"
|
|
if(input_data.value.gender==='女') input_data.value.gender="2"
|
|
const response = await axios.post($api("GetDayPlanList"), {
|
|
hospital: input_data.value.hospital,
|
|
openid: "",
|
|
person_id: "",
|
|
person_sex:input_data.value.gender,
|
|
date: plan_data.value.date,
|
|
use_type: 1,
|
|
checkup_type_id: 1,
|
|
amount: "500"
|
|
});
|
|
window.$response(response.data, () => {
|
|
plan_list.value = response.data.data.list;
|
|
plan_dialog_show.value = true
|
|
if(plan_list.value.length===0){
|
|
alert("当前日期暂无号源");
|
|
}
|
|
});
|
|
}
|
|
|
|
const createOrderClick = async () => {
|
|
let item_ids = getSelectItemIds();
|
|
let combo_id = select_data.value.combo;
|
|
let create_type = true
|
|
if (item_ids.length === 0 && !combo_id) {
|
|
create_type = false
|
|
}
|
|
if (!plan_data.value.active) {
|
|
return window.$message().error('请选择预约号源')
|
|
}
|
|
const check = checkInputData()
|
|
if (!check) {
|
|
return
|
|
}
|
|
if (input_data.value.id_number === '') {
|
|
create_type = false
|
|
}
|
|
const response = await axios.post($api(!!create_type ? "Create" : 'CreateYuYueOrder'), {
|
|
type: 1,
|
|
hospital: input_data.value.hospital,
|
|
combo_id: combo_id,
|
|
item_ids: item_ids,
|
|
appdoctor: input_data.value.doctor,
|
|
person: {
|
|
sex: input_data.value.gender,
|
|
birthday: input_data.value.birthday,
|
|
married: input_data.value.married,
|
|
name: input_data.value.name,
|
|
id_number: input_data.value.id_number,
|
|
phone: input_data.value.phone,
|
|
},
|
|
group_id: '',
|
|
plan_id: plan_data.value.active
|
|
});
|
|
window.$response(response.data, () => {
|
|
window.$message().success('预约完成')
|
|
plan_dialog_show.value = false
|
|
setTimeout(() => {
|
|
window.location.reload();
|
|
}, 2000);
|
|
});
|
|
}
|
|
|
|
const itemTableRowClassName = (e) => {
|
|
const select_rows = item_table_ref.value.getSelectionRows();
|
|
let select_ids = [];
|
|
for (let i in select_rows) {
|
|
select_ids.push(select_rows[i].id)
|
|
}
|
|
if (select_ids.includes(e.row.id)) {
|
|
console.log('select_ids', select_ids, e.row.id)
|
|
return 'item_active cursor-pointer'
|
|
} else {
|
|
return 'cursor-pointer'
|
|
}
|
|
}
|
|
|
|
onMounted(() => {
|
|
getQueryData();
|
|
getItemGetList();
|
|
// getPlanList();
|
|
});
|
|
|
|
return {
|
|
elZh,
|
|
itemTableRowClassName,
|
|
createOrderClick,
|
|
selectPlanClick,
|
|
getPlanList,
|
|
comboRowClassName,
|
|
comboRowClick,
|
|
itemRowClick,
|
|
removeItemClick,
|
|
itemSelectionChange,
|
|
searchClick,
|
|
idNumberUpdate,
|
|
tableRowClick,
|
|
planDialogShowClick,
|
|
comboSearchClick,
|
|
selectComboFunc,
|
|
combo_search_input,
|
|
married_array,
|
|
plan_list,
|
|
plan_data,
|
|
plan_dialog_show,
|
|
combo_show,
|
|
combo_table_ref,
|
|
combo_dialog_show,
|
|
combo_list,
|
|
combo_list_show,
|
|
select_table_ref,
|
|
pay_info,
|
|
item_list_show,
|
|
select_table_computed,
|
|
item_table_ref,
|
|
item_list,
|
|
search_input,
|
|
select_data,
|
|
input_data,
|
|
button_config,
|
|
};
|
|
},
|
|
};
|
|
const app = createApp(App);
|
|
app.use(ElementPlus);
|
|
app.mount("#app");
|
|
</script>
|
|
|
|
</html>
|