Commit 994827de authored by hailiang.sun's avatar hailiang.sun

前端分页

parent b5f3de7c
<template>
<div class="combo">
<div class="title">
<span class="point" v-if="reservedInfo"></span
>{{ reservedInfo.chooseName }}
</div>
<div class="title"><span class="point"></span>请选择套餐</div>
<!-- v-if="combos.type === '1'" -->
<a-radio-group class="items-radios" v-model="chooseId" @change="onChange">
<ul class="items">
......@@ -57,49 +54,6 @@ export default {
return {
chooseId: "",
chooseList: [],
// chkvalue: [],
// combos: {
// type: "2",
// items: [
// {
// id: 0,
// title: "21招商信诺-银保客户-豪华套餐女未婚",
// },
// {
// id: 1,
// title: "22招商信诺-银保客户-豪华套餐女未婚",
// },
// {
// id: 2,
// title: "23招商信诺-银保客户-豪华套餐女未婚",
// },
// {
// id: 3,
// title: "24招商信诺-银保客户-豪华套餐女未婚",
// },
// ],
// },
// combos2: {
// type: "1",
// items: [
// {
// value: 0,
// label: "21招商信诺-银保客户-豪华套餐女未婚",
// },
// {
// value: 1,
// label: "22招商信诺-银保客户-豪华套餐女未婚",
// },
// {
// value: 2,
// label: "23招商信诺-银保客户-豪华套餐女未婚",
// },
// {
// value: 3,
// label: "24招商信诺-银保客户-豪华套餐女未婚",
// },
// ],
// },
reservedInfo: [], //可选择的体检套餐
};
},
......@@ -108,7 +62,7 @@ export default {
this.reservedInfo = JSON.parse(window.localStorage.getItem("reservedInfo"));
let chooseList = JSON.parse(window.localStorage.getItem("chooseList"));
console.log("????", chooseList, this.reservedInfo);
this.chooseId = chooseList.id;
this.chooseId = chooseList ? chooseList[0].id : "";
this.chooseList = this.reservedInfo.chooseList.map((item) => {
return {
...item,
......@@ -119,9 +73,10 @@ export default {
},
methods: {
onChange(checkedValues) {
console.log("这个???", checkedValues);
const chooseList = [];
chooseList.push({
id: this.chooseId,
id: this.chooseId || checkedValues,
});
// 本地存储数据-选择的体检套餐
window.localStorage.setItem("chooseList", JSON.stringify(chooseList));
......
......@@ -16,7 +16,7 @@
<a-select-option
v-for="item in provinceList"
:key="item.id"
:value="item.provinceCode"
v-model="item.provinceCode"
>{{ item.provinceName }}</a-select-option
>
</a-select>
......@@ -27,7 +27,7 @@
<a-select-option
v-for="item in cityList"
:key="item.id"
:value="item.cityCode"
v-model="item.cityCode"
>{{ item.cityName }}</a-select-option
>
</a-select>
......@@ -38,7 +38,7 @@
<a-select-option
v-for="item in areaList"
:key="item.id"
:value="item.districtCode"
v-model="item.districtCode"
>{{ item.districtName }}</a-select-option
>
</a-select>
......@@ -67,7 +67,7 @@
<div class="type"><span class="point"></span> 请选择服务中心</div>
</div>
<ul class="hospital_box" v-if="isShowHospitalList">
<li v-for="(item, index) in hospitalList" :key="index">
<li v-for="(item, index) in pageData" :key="index">
<div>
<p class="top">{{ item.checkUnitName }}</p>
<p class="bottom">{{ item.address }}</p>
......@@ -82,6 +82,15 @@
</li>
</ul>
<div v-else class="hospital_none">暂无可选分院</div>
<a-pagination
style="text-align: right; position: relative; bottom: 10px"
v-if="hospitalList.length > 5"
v-model="current"
:pageSize="5"
:total="hospitalList.length"
show-less-items
@change="pagechange"
/>
</div>
<div class="mask" v-if="datePickShow && showDatemask">
<reserve-date
......@@ -121,6 +130,8 @@ export default {
},
data() {
return {
pageData: [],
current: 1,
showDatemask: false,
datePickShow: false,
selectIndex: 0,
......@@ -285,8 +296,8 @@ export default {
// 选择服务机构
clickTab(index, id) {
this.selectIndex = index;
console.log("选择服务机构id", index, id);
this.supplierIds = id;
this.current = 1;
// 点击选择服务机构,显示该机构下的服务中心
this.getShopByDistrictCode();
},
......@@ -309,14 +320,29 @@ export default {
if (res.returnCode === "0000") {
this.isShowHospitalList = true;
this.hospitalList = res.content;
console.log("数量", this.hospitalList);
console.log("total");
if (res.content.length > 5) {
this.pagechange(1, 5);
} else {
this.pageData = res.content;
}
console.log("根据服务机构-获取服务中心列表=", this.hospitalList);
} else {
this.hospitalList = 0;
this.isShowHospitalList = false;
// this.$message.error(res.returnMsg)
}
});
},
// 分页
pagechange(current, size) {
var skipNum = (current - 1) * size;
this.pageData =
skipNum + size >= this.hospitalList.length
? this.hospitalList.slice(skipNum, this.hospitalList.length)
: this.hospitalList.slice(skipNum, skipNum + size);
},
// 打开日期弹框
openDatePicker(item) {
if (item.isDisabled) {
......@@ -349,15 +375,6 @@ export default {
payList: [],
supplierId: this.supplierId, //供应商id
hospitalId: this.hospitalId, //医院id
// checkUnitCode: '2152',
// chooseList: [{ id: 1069 }],
// customerId: 56418,
// dataSource: 'M',
// hospitalId: 2152,
// payList: [],
// serviceDate: '20211127',
// servicepackageId: 1043,
// supplierId: 1007,
};
console.log("立即预约=", query);
......@@ -368,12 +385,8 @@ export default {
okText: "确认",
cancelText: "取消",
onOk() {
// return new Promise((resolve, reject) => {
// setTimeout(Math.random() > 0.5 ? resolve : reject, 1000)
// }).catch(() => console.log('Oops errors!'))
api.addAppointment(query).then((res) => {
if (res.returnCode === "0000") {
console.log("立即预约=", res);
_this.$message.success("预约成功");
_this.appointmentId = res.content;
// 提示预约成功,之后跳转到预约详情页面
......
......@@ -14,7 +14,10 @@
</div>
<div class="item">
<span class="label">婚姻状况</span>
<a-radio-group v-model="customerInfo.maritalStatus">
<a-radio-group
v-model="customerInfo.maritalStatus"
:disabled="!state.edit"
>
<a-radio value="01">未婚 </a-radio>
<a-radio value="02">已婚</a-radio>
</a-radio-group>
......@@ -25,7 +28,12 @@
</div>
<div class="item">
<span class="label">手机号码:</span>
<a-input :value="customerInfo.phone" />
<a-input
v-model="customerInfo.phone"
:disabled="!state.edit"
:maxLength="11"
@input="phonechange"
/>
</div>
<div class="item">
<span class="label">出生日期:</span>
......@@ -36,7 +44,10 @@
</div>
</div>
<div class="reset">
<a-button type="primary" @click="onSubmit">点击修改</a-button>
<a-button type="primary" @click="edit" v-if="!state.edit"
>点击修改</a-button
>
<a-button type="primary" @click="onSubmit" v-else>确认修改</a-button>
</div>
</div>
......@@ -68,6 +79,11 @@ export default {
props: {},
data() {
return {
state: {
edit: false,
text1: "点击修改",
text2: "确认修改",
},
next: false,
previous: false,
id: "", //客户id
......@@ -87,9 +103,11 @@ export default {
const { id } = this.$route.query;
this.id = id;
this.getCustomerDetail(); //客户信息
console.log("xxxxx");
},
methods: {
phonechange() {
this.customerInfo.phone = this.customerInfo.phone.replace(/[^\d]/g, "");
},
nextStep() {
this.previous = true;
this.next = false;
......@@ -115,6 +133,9 @@ export default {
}
});
},
edit() {
this.state.edit = true;
},
// "立即修改"
onSubmit() {
const { name, idType, sex, idNo, phone, birthDate, maritalStatus } =
......@@ -130,10 +151,16 @@ export default {
birthDate,
maritalStatus,
};
// 校验手机长度
if (this.customerInfo.phone.length < 11) {
this.$message.info("请输入正确的手机号码以确保后续接收短信提醒,谢谢");
return;
}
api.improveInformation(query).then((res) => {
if (res.returnCode == "0000") {
// 提交成功之后,提示成功信息,关闭"个人信息填写弹窗",并刷新当前页面
this.$message.success("修改信息成功");
this.state.edit = false;
setTimeout(() => {
// 刷新列表
this.getCustomerDetail();
......
......@@ -5,15 +5,23 @@
<span class="point"></span> {{ item.servicepackageName }}
</div>
<!-- $router.push(item.fileList[0]&&item.fileList[0].url) -->
<div class="detail">
<img :src="eyes" alt="" @click="openModel" />点击查看服务套餐详情
<div class="detail" @click="openModel">
<img :src="eyes" alt="" />点击查看服务套餐详情
<!-- {{item.fileList[0].url}} -->
</div>
</div>
<div class="right">
<a-button v-if="listType == 2" style="background: #ffcc00; color: white; border: none; width: 86px"
@click="handleReadDetail">查看</a-button>
<a-button v-else style="background: #3f7ffb; color: white; border: none; width: 86px" @click="handleSubmit">立即预约
<a-button
v-if="listType == 2"
style="background: #ffcc00; color: white; border: none; width: 86px"
@click="handleReadDetail"
>查看</a-button
>
<a-button
v-else
style="background: #3f7ffb; color: white; border: none; width: 86px"
@click="handleSubmit"
>立即预约
</a-button>
<div class="date">
{{
......@@ -24,13 +32,17 @@
</div>
</div>
<a-modal v-model="visible" width="1000px" :footer="null">
<img style="width: 100%; padding: 20px 20px" :src="item.fileList[0] && item.fileList[0].url" alt="" />
<img
style="width: 100%; padding: 20px 20px"
:src="item.fileList[0] && item.fileList[0].url"
alt=""
/>
</a-modal>
</div>
</template>
<script>
export default {
export default {
name: "item",
components: {},
props: {
......@@ -44,7 +56,7 @@
},
item: {
type: Object,
default: () => { },
default: () => {},
},
},
data() {
......@@ -79,14 +91,15 @@
});
},
openModel() {
this.visible = true
}
console.log("什么问题?");
this.visible = true;
},
};
},
};
</script>
<style lang="less" scoped>
.item {
.item {
display: flex;
justify-content: space-between;
background: #fafafa;
......@@ -125,5 +138,5 @@
}
}
}
}
}
</style>
......@@ -12,34 +12,36 @@
</template>
<script>
import Cookies from 'js-cookie'
import Cookies from "js-cookie";
export default {
name: "Header",
components: {},
data() {
return {
logoImg: require("@/assets/imgs/login/logo.png"),
logoImg: "",
logout: require("@/assets/imgs/login/logout.png"),
};
},
created() {
console.log("sssss", this.$route);
this.logoImg = this.$route.query.logo;
},
methods: {
logoutEvt(){
logoutEvt() {
this.$confirm({
title: '提示',
content: '退出登录',
okText: '确认',
cancelText: '取消',
onOk: ()=>{
Cookies.remove('JSESSIONID');
title: "提示",
content: "退出登录",
okText: "确认",
cancelText: "取消",
onOk: () => {
Cookies.remove("JSESSIONID");
this.$router.push({
path: '/login'
})
path: "/login",
});
},
onCancel: () => {},
});
},
onCancel: ()=>{
}
})
}
},
};
</script>
......
......@@ -32,9 +32,13 @@
],
},
]"
:placeholder= 'userNameHolder'
:placeholder="userNameHolder"
>
<a-icon slot="prefix" type="user" style="color: rgba(0, 0, 0, 0.25)" />
<a-icon
slot="prefix"
type="user"
style="color: rgba(0, 0, 0, 0.25)"
/>
</a-input>
</a-form-item>
<a-form-item>
......@@ -53,18 +57,27 @@
type="password"
:placeholder="passwordHolder"
>
<a-icon slot="prefix" type="lock" style="color: rgba(0, 0, 0, 0.25)" />
<a-icon
slot="prefix"
type="lock"
style="color: rgba(0, 0, 0, 0.25)"
/>
</a-input>
</a-form-item>
<a-form-item>
<!-- :disabled="isSub" -->
<a-button type="primary" html-type="submit" class="login-form-button">登陆</a-button>
<a-button
type="primary"
html-type="submit"
class="login-form-button"
>登陆</a-button
>
</a-form-item>
</a-form>
<div class="concat">
<!-- 如果遇到操作问题,请拨打椋鸟健康热线
<span class="code">400-820-6523</span> -->
<img :src="downImg" alt="">
<img :src="downImg" alt="" />
</div>
</div>
</div>
......@@ -79,14 +92,14 @@ export default {
components: {},
data() {
return {
logo:"",
logo: "",
left: require("../../assets/imgs/login/left-bg.png"),
downImg:'',
downImg: "",
isSub: true,
passwordHolder:"",
userNameHolder:"",
fields:[],
loading: false //是否显示loading
passwordHolder: "",
userNameHolder: "",
fields: [],
loading: false, //是否显示loading
};
},
beforeCreate() {
......@@ -103,7 +116,8 @@ export default {
isNumber(val) {
//判断是否是数字
var regPos = /^\d+(\.\d+)?$/; //非负浮点数
var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
var regNeg =
/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
if (regPos.test(val) && regNeg.test(val)) {
return true;
} else {
......@@ -116,22 +130,24 @@ export default {
},
getLoginConfigFn() {
const query = {
id: "1002" //暂时写死的
id: "1002", //暂时写死的
};
api.getLoginConfig(query).then(res => {
if(res.returnCode == '0000'){ //logo 配置
if(res.content.loginUp&&res.content.loginUp[0]){
this.logo = res.content.loginUp[0].url
this.logo = res.content.loginUp[0].url
api.getLoginConfig(query).then((res) => {
if (res.returnCode == "0000") {
//logo 配置
if (res.content.loginUp && res.content.loginUp[0]) {
this.logo = res.content.loginUp[0].url;
this.logo = res.content.loginUp[0].url;
}
if(res.content.loginDown&&res.content.loginDown[0]){ //电话说明配置
this.downImg = res.content.loginDown[0].url
if (res.content.loginDown && res.content.loginDown[0]) {
//电话说明配置
this.downImg = res.content.loginDown[0].url;
}
if(res.content.lnhConfigs){
let lnhConfigs = res.content.lnhConfigs
this.fields = lnhConfigs
this.userNameHolder = `请输入`+lnhConfigs[0].remark
this.passwordHolder = `请输入`+lnhConfigs[1].remark
if (res.content.lnhConfigs) {
let lnhConfigs = res.content.lnhConfigs;
this.fields = lnhConfigs;
this.userNameHolder = `请输入` + lnhConfigs[0].remark;
this.passwordHolder = `请输入` + lnhConfigs[1].remark;
}
}
});
......@@ -147,16 +163,16 @@ export default {
{
fieldName: this.fields[0].remark,
value: values.userName,
field: this.fields[0].field
field: this.fields[0].field,
},
{
fieldName: this.fields[1].remark,
value: values.password,
field: this.fields[1].field
}
]
field: this.fields[1].field,
},
],
};
api.userLogin(query).then(res => {
api.userLogin(query).then((res) => {
console.log(res);
if (res.returnCode == "0000") {
console.log("登陆成功");
......@@ -167,8 +183,9 @@ export default {
this.$router.push({
name: "Index",
query: {
id: res.content.id
}
id: res.content.id,
logo: this.logo,
},
});
}, 1000);
} else {
......@@ -178,8 +195,8 @@ export default {
console.log("Received values of form: ", values);
}
});
}
}
},
},
};
</script>
......@@ -191,7 +208,7 @@ export default {
.header {
padding: 2.5px 21.5px;
background: rgba(225, 225, 225, 0.32);
img{
img {
width: 70px;
height: 50px;
}
......@@ -257,7 +274,7 @@ export default {
.code {
color: #3f7ffb;
}
img{
img {
width: 100%;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment