123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876 |
- <template>
- <view class="content">
- <view class="top-fixed">
- <view class="date-box">
- <view class="text">体检日期</view>
- <!-- <picker class="birth-picker" mode="date">
- <view class="right-box"> -->
- <view class="input-box">
- <input type="text" :value="form.examDate" placeholder="请选择日期" placeholder-class="form-input" disabled="disabled" />
- </view>
- <!-- <image class="w48 h48" src="@/static/images/health/right_arrow_right_icon24.png"></image> -->
- <!-- </view> -->
- </picker>
- </view>
- <!-- tab切换 -->
-
- <view class="pub-tab-box">
- <!-- <scroll-view scroll-x="true" >
- <view class="inner">
- <view v-for="(item,index) in cateOptions" :key="index" :class="cateId == item.dictValue?'item active':'item'" @click="choseCate(item)">
- {{ item.dictLabel }}
- </view>
- </view>
- </scroll-view> -->
- <scroll-view scroll-x="true" >
- <view class="tab-inner" v-if="type=='edit'">
- <view v-for="(item,index) in orderStatus" :key="item.cateId"
- :class="item.cateId == showType?'item active':'item'" @click="choseCate(item)">
- <view class="text">
- {{item.cateName}}
- </view>
- </view>
- </view>
- <view class="tab-inner" v-else>
- <text class="fs32rpx ml30">身体信息</text>
- </view>
- </scroll-view>
-
- </view>
-
- </view>
-
- <view class="m-list" v-if="showType==10000">
- <view class="form-box">
- <view class="form-item">
- <text class="label">身高</text>
- <input maxlength="10" class="input-width" type="digit" v-model="form.height" placeholder="请输入身高"
- placeholder-class="form-input" />
- <text class="unit">厘米 (CM)</text>
- </view>
- <view class="form-item">
- <text class="label">体重</text>
- <input maxlength="10" class="input-width" type="digit" v-model="form.weight" placeholder="请输入体重"
- placeholder-class="form-input" />
- <text class="unit">千克 (KG)</text>
- </view>
- <view class="form-item justify-between">
- <view class="align-start">
- <text class="label">BMI</text>
- <input maxlength="10" class="input-width" type="digit" v-model="form.bmi"
- placeholder="请输入BMI" placeholder-class="form-input" />
- </view>
- <image src="/static/images/user/help_icon24.png" class="w32 h32"></image>
- </view>
- <view class="form-item">
- <text class="label">臀围</text>
- <input maxlength="10" class="input-width" type="digit" v-model="form.chestCircumference" placeholder="请输入臀围"
- placeholder-class="form-input" />
- <text class="unit">厘米 (CM)</text>
- </view>
- <view class="form-item">
- <text class="label">腰围</text>
- <input maxlength="10" class="input-width" type="digit" v-model="form.waistCircumference" placeholder="请输入腰围"
- placeholder-class="form-input" />
- <text class="unit">厘米 (CM)</text>
- </view>
- </view>
- </view>
- <view class="index-body" v-if="showType!==10000">
- <mescroll-body top="196upx" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
- <view class="search-cont">
- <view class="inner2">
- <image class="icon-search" src="/static/images/search.png" mode=""></image>
- <input type="text" v-model="keyword" placeholder="请输入想要搜索的指标" confirm-type="search" @confirm="doSearch" placeholder-style="font-size:28rpx;color:#BBBBBB;font-family: PingFang SC;" />
- </view>
- </view>
- <view class="title-box">
- <view class="left-title">指标信息({{num}}项)</view>
- <view class="right align-center" @click="pageTo()">
- <image class="w24 h24" src="@/static/images/company/edit_add_icon.png"></image>
- <text>编辑指标项</text>
- </view>
- </view>
-
- <view class="sms-list">
- <u-swipe-action>
- <view class="form-swipe" v-for="(item,index) in dataList" :key="index">
- <u-swipe-action-item :options="options" @click="cancel(item,index)" :name="index"
- :ref="'swipeAction' + index">
- <view class="item" @click.stop="showDetail(item)">
- <view class="item-box">
- <view class="left">
- <view class="align-center">
- <view class="title">{{item.indicatorName}}</view>
- <!-- <view class="unit" v-if="item.unitName!==null">({{item.unitName}})</view> -->
- </view>
- <view class="align-center">
- <view class="num">{{item.testValue||''}}</view>
- <view v-if="item.testValue!==null">
- <view :class="item.isAbnormal==0?'tag2':'tag'">{{item.isAbnormal==0?'正常':'异常'}}</view>
- </view>
-
- </view>
- <view class="reference">
- 参考值范围:{{item.refRange||''}} 单位:{{item.unitName||''}}
- </view>
- </view>
-
- <image src="/static/images/health/right_arrow_right_icon24.png" class="w48 h48"></image>
- </view>
- </view>
- </u-swipe-action-item>
- </view>
- </u-swipe-action>
- </view>
- <view class="h150"></view>
- </mescroll-body>
-
-
- </view>
-
- <!-- </mescroll-body> -->
- <view class="btn-box2">
- <view v-if="showType==10000" class="sub-btn" @click="submit()">
- <!-- <image src="/static/images/company/make_phone_call_icon.png" class="w48 h48"></image> -->
- <text>保存</text>
- </view>
- <view v-if="showType!==10000" class="sub-btn" @click="navgetTo()">
- <!-- <image src="/static/images/company/send_SMS_icon.png" class="w48 h48"></image> -->
- <text>批量编辑</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {getByUserAndDate,addReport,updateReport,getReportById,
- listByIndicator,getResult,deleteResult,getAllCateByReportId, listByReport
- } from '@/api/companyUser.js'
- import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
- export default {
- mixins: [MescrollMixin],
- data() {
- return {
- examDate:this.utils.timeFormat(new Date(),'yyyy-mm-dd'),
- num:null,
- type:null,
- keyword:'',
- orderStatus: [
- // {
- // cateName: "身体信息",
- // cateId: 10000
- // },
- // {
- // cateName: "指标检查",
- // cateId: 10001
- // },
- // {
- // name: "查体",
- // val: 2
- // },
- // {
- // name: "肝脏功能",
- // val: 3
- // },
- ],
- options: [{
- text: '删除',
- style: {
- backgroundColor: '#FF5030'
- }
- }],
- showType: 10000,
- userId:null,
- mescroll:null,
- // 上拉加载的配置
- upOption: {
- onScroll:true,
- use: true, // 是否启用上拉加载; 默认true
- page: {
- num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
- size: 10 // 每页数据的数量,默认10
- },
- noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
- empty: {
- icon:'https://user.test.ylrztop.com/images/empty_icon.png',
- tip: '暂无数据'
- }
- },
- indicatorCateId:'',
- form:{
- "bmi": null,
- "chestCircumference":null,
- "examDate":null,
- "height": null,
- // "reportId": 0,
- "reportStatus": 1,
- "userId": null,
- "waistCircumference":null,
- "weight": null,
- },
- // 列表数据
- dataList: [],
- }
- },
- onLoad(options) {
- this.type=options.type === 'edit' ? 'edit' : 'add';
- this.reportId=options.id;
- if(this.type=='edit'){
- this.getReportById();
- this.getAllCateByReportId()
- // this.getResult()
- }
- uni.$on('refreshInformation', () => {
- this.showType=10001
- this.indicatorCateId=''
- this.getAllCateByReportId()
- this.mescroll.resetUpScroll()
- })
- // var user=JSON.parse(uni.getStorageSync('userInfo'))
- // this.form.userId=user.userId
- this.form.userId=options.userId
- this.form.companyUserId=options.companyUserId
- this.form.examDate=this.examDate
- // this.getByUserAndDate()
- },
- methods: {
- pay(item) {
- uni.navigateTo({
- url: '/pages_/doctor/paymentOrder?orderId=' + item.orderId
- })
- },
- navgetTo(url) {
- uni.navigateTo({
- url: '/pages_user/user/batchRecord?id='+this.reportId+'&date='+this.form.examDate
- })
- },
- pageTo(url) {
- uni.navigateTo({
- url: '/pages_user/user/editIndicator?id='+this.reportId
- })
- },
- bindDateChange: function(e) {
- this.form.examDate = e.target.value
- },
- // tab切换
- choseCate(item) {
- this.showType = item.cateId
- // console.log(this.showType,item.cateId,'---')
- if(item.cateId!==10000&&item.cateId!==10001){
- this.indicatorCateId=item.cateId
- // this.mescroll.resetUpScroll()
- }else{
- this.indicatorCateId=''
- // this.mescroll.resetUpScroll()
- }
- // 关键修复:仅当 mescroll-body 渲染(showType!==10000)且 mescroll 已初始化时,才重置滚动
- if (this.showType!== 10000) {
- // 延迟 100ms 执行,等 tab 切换渲染完成
- setTimeout(() => {
- this.$nextTick(() => {
- if (this.mescroll && this.$refs.mescrollRef) {
- this.mescroll.resetUpScroll();
- }
- });
- }, 100);
- }
-
- },
- getAllCateByReportId(){
- var data={
- reportId:this.reportId,
- }
- var list=[{
- cateName: "身体信息",
- cateId: 10000
- },
- {
- cateName: "指标检查",
- cateId: 10001
- }]
- getAllCateByReportId(data).then(
- res => {
- if(res.code==200){
- this.orderStatus.splice(0, this.orderStatus.length, ...list.concat(res.data));
- }else{
- uni.showToast({
- title: res.msg,
- });
- }
- },
- rej => {}
- );
- },
- doSearch(){
- this.mescroll.resetUpScroll()
- },
- mescrollInit(mescroll) {
- this.mescroll = mescroll;
- // this.mescroll.resetUpScroll()
- },
- /*下拉刷新的回调 */
- downCallback(mescroll) {
- mescroll.resetUpScroll()
- },
- upCallback(page) {
- //联网加载数据
- var that = this;
- var data = {
- indicatorName:this.keyword,
- indicatorCateId:this.indicatorCateId,
- // indicatorId:this.showType,
- reportId:this.reportId ||'',
- pageNum: page.num,
- pageSize: page.size
- };
- getResult(data).then(res => {
- if (res.code == 200) {
- //设置列表数据
- if (page.num == 1) {
- that.dataList = res.data.list;
- this.num=res.data.total||0
-
- } else {
- that.dataList = that.dataList.concat(res.data.list);
-
- }
- that.mescroll.endBySize(res.data.list.length,res.data.total);
-
- } else {
- uni.showToast({
- icon: 'none',
- title: "请求失败",
- });
- that.dataList = null;
- that.mescroll.endErr();
- }
- });
- },
- listByReport(){
- listByReport(this.reportId).then(
- res => {
- if(res.code==200){
- this.dataList=res.data;
- this.num=res.data.length;
- // this.form.examDate=this.form.examDate.slice(0,5)
-
- }else{
- uni.showToast({
- title: res.msg,
- });
- }
- },
- rej => {}
- );
- },
- getReportById(){
- getReportById(this.reportId).then(
- res => {
- if(res.code==200){
- this.form=res.data;
- // this.form.examDate=this.form.examDate.slice(0,5)
-
- }else{
- uni.showToast({
- title: res.msg,
- });
- }
- },
- rej => {}
- );
- },
- cancel(item, index) {
- var that = this;
- let test = 'swipeAction' + index
- uni.showModal({
- title: '提示',
- content: '确定删除检查结果吗',
- success: function(res) {
- if (res.confirm) {
- // var data = {
- // orderId:item.orderId
- // };
- deleteResult(item.resultId).then(res => {
- if (res.code == 200) {
- uni.showToast({
- icon: 'success',
- title: '删除成功',
- });
- that.$refs[test][0].closeHandler()
- that.mescroll.resetUpScroll()
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg,
- });
- }
- });
- } else if (res.cancel) {
- that.$refs[test][0].closeHandler()
- }
- }
- });
- },
- submit(){
- // if(this.form.recordDate==null){
- // uni.showToast({
- // icon:'none',
- // title: "日期不能为空",
- // });
- // return;
- // }
- // if(this.form.recordTime==null){
- // uni.showToast({
- // icon:'none',
- // title: "记录时间不能为空",
- // });
- // return;
- // }
- // if(this.form.mealDescription==null){
- // uni.showToast({
- // icon:'none',
- // title: "用餐情况不能为空",
- // });
- // return;
- // }
- if(this.type=="add"){
- this.addReport()
- }
- else if(this.type=="edit"){
- this.updateReport()
- }
-
- },
- updateReport(){
- updateReport(this.form).then(
- res => {
- if(res.code==200){
- uni.showToast({
- icon:'success',
- title: "更新成功",
- });
- setTimeout(function() {
- uni.$emit('refreshReportList');
- uni.navigateBack({
- delta: 1
- })
- }, 500);
- }else{
- uni.showToast({
- icon:'none',
- title: res.msg,
- });
- }
- },
- rej => {}
- );
- },
- addReport(){
- addReport(this.form).then(
- res => {
- if(res.code==200){
- uni.showToast({
- icon:'success',
- title: "操作成功",
- });
- setTimeout(function() {
- uni.$emit('refreshReportList');
- uni.navigateBack({
- delta: 1
- })
- }, 500);
- }else{
- uni.showToast({
- icon:'none',
- title: res.msg,
- });
- }
- },
- rej => {}
- );
- },
- showDetail(item) {
-
- uni.navigateTo({
- url: '/pages_user/user/addResult?type=edit&resultId=' + item.resultId+'&reportId='+item.reportId
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .content {
- padding: 20upx;
- .top-fixed {
- width: 100%;
- position: fixed;
- top: 0;
- left: 0;
- z-index: 999;
- }
-
- .date-box {
- background: #fff;
- padding: 30rpx;
- border-bottom: 1rpx solid #ECECEC;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .text {
- font-family: PingFang SC, PingFang SC;
- font-weight: 500;
- font-size: 32rpx;
- color: #222426;
- line-height: 34rpx;
- text-align: left;
- }
- .time {
- font-weight: 400;
- font-size: 32rpx;
- color: #222426;
- line-height: 34rpx;
- text-align: right;
- }
- .input-box{
- text-align: right;
- }
- }
- .search-cont{
- // padding: 16upx 30upx;
- .inner2{
- box-sizing: border-box;
- width: 100%;
- height: 72upx;
- background: #fff;
- border-radius: 36upx;
- display: flex;
- align-items: center;
- padding: 0 30upx;
- .icon-search{
- width: 28upx;
- height: 28upx;
- margin-right: 20upx;
- }
- input{
- height: 60upx;
- line-height: 60upx;
- flex: 1;
- }
- }
- }
- .m-list{
- margin-top: 196upx;
- }
- .pub-tab-box {
- box-sizing: border-box;
- width: 100%;
- // padding: 0 40upx;
- background-color: #FFFFFF;
- .tab-inner {
- height: 88upx;
- line-height: 88upx;
- display: flex;
- align-items: center;
- // justify-content: space-between;
- // overflow-x: auto;
- position: relative;
- }
- .item {
- // flex: 1;
- /* 添加过渡动画 */
- transition: all 0.2s ease; /* 状态变化时平滑过渡 */
- font-size: 28upx;
- white-space: nowrap;
- line-height: 1;
- font-family: PingFang SC;
- font-weight: 500;
- color: #626468;
- // margin-right: 60upx;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 0 30rpx;
- &:last-child {
- margin-right: 0;
- }
- &.active {
- font-weight: bold;
- color: #222426;
- &::after {
- content: "";
- width: 48rpx;
- height: 8rpx;
- background: linear-gradient(120deg, #31A1FE 0%, #008FD3 100%);
- position: absolute;
- bottom: 0;
- border-radius: 6upx 6upx 0upx 0;
- }
- }
- .text {
- position: relative;
- z-index: 1;
- }
- .tab-bg {
- width: 72upx;
- height: 28upx;
- position: absolute;
- top: 17upx;
- left: 50%;
- transform: translateX(-36upx);
- z-index: -1;
- }
- }
- }
- .btn-box2 {
- z-index: 9999;
- width: 100%;
- padding: 30upx;
- position: fixed;
- bottom: 0;
- left: 0;
- box-sizing: border-box;
- background: #FFFFFF;
- .sub-btn {
- width: 100%;
- height: 88upx;
- line-height: 88upx;
- text-align: center;
- font-size: 30upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- background: #008FD3;
- border-radius: 44upx;
- display: flex;
- align-items: center;
- justify-content: center;
- image {
- margin-right: 16rpx;
- }
- }
- }
- .form-box {
- padding: 0 30upx;
- background: #FFFFFF;
- border-radius: 16upx;
- margin-bottom: 20upx;
- .form-title {
- font-family: PingFang SC;
- font-weight: 600;
- font-size: 40rpx;
- color: #222426;
- text-align: left;
- padding: 30rpx 0;
- display: block;
- }
- .form-item {
- padding: 30upx 0;
- display: flex;
- align-items: flex-start;
- border-bottom: 1px solid #F1F1F1;
- &:last-child {
- border-bottom: none;
- }
- .label {
- width: 150upx;
- text-align: left;
- font-size: 32upx;
- line-height: 44upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #222222;
- flex-shrink: 0;
- }
- input {
- text-align: left;
- }
- .unit {
- width: 150upx;
- text-align: right;
- font-size: 32upx;
- line-height: 44upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #222222;
- flex-shrink: 0;
- }
- .form-input {
- font-size: 30upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- text-align: left;
- }
- .form-item-tag {
- margin-right: 16rpx;
- .tag {
- border-radius: 8rpx 8rpx 8rpx 8rpx;
- border: 2rpx solid #ECECEC;
- display: flex;
- align-items: center;
- padding: 24rpx;
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- &.active {
- background: #F0FAFF;
- border: 2rpx solid #008FD3;
- color: #008FD3;
- }
- }
- }
- }
- }
- .index-body{
- .title-box {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 30rpx 0;
-
- .left-title {
- font-family: PingFang SC, PingFang SC;
- font-weight: 600;
- font-size: 32rpx;
- color: #222426;
- text-align: left;
- }
-
- .right {
- width: 216rpx;
- height: 64rpx;
- font-weight: 400;
- font-size: 24rpx;
- color: #626468;
- justify-content: center;
- background: #FFFFFF;
- border-radius: 32rpx 32rpx 32rpx 32rpx;
- text{
- margin-left:5rpx ;
- }
- }
- }
- }
- .sms-list {
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- overflow: hidden;
- .item {
- padding: 0rpx 20rpx;
- background: #FFFFFF;
- border-bottom: 1rpx solid #ECECEC;
- .item-box {
- display: flex;
- align-items: flex-start;
- justify-content: space-between;
-
-
- height: 150rpx;
- padding: 30rpx 0;
- .left {
- flex: 1;
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- justify-content: space-between;
- height: 100%;
-
- .title {
- font-family: PingFang SC, PingFang SC;
- font-weight: 600;
- font-size: 32rpx;
- color: #222426;
- text-align: left;
- }
- .unit {
- font-weight: 400;
- font-size: 28rpx;
- color: #898E91;
- text-align: left;
- }
- .num {
- font-family: PingFang SC, PingFang SC;
- font-weight: 600;
- font-size: 32rpx;
- color: #FF5030;
- text-align: left;
- margin-right: 16rpx;
- }
- .tag2 {
- width: 58rpx;
- height: 30rpx;
- line-height: 30rpx;
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 21rpx;
- color: #52D087;
- text-align: center;
- border-radius: 4rpx 4rpx 4rpx 4rpx;
- border: 1rpx solid #B0EAC9;
- }
- .tag {
- width: 58rpx;
- height: 30rpx;
- line-height: 30rpx;
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 21rpx;
- color: #FF4B33;
- text-align: center;
- border-radius: 4rpx 4rpx 4rpx 4rpx;
- border: 1rpx solid #FFA599;
- }
- .reference {
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #898E91;
- text-align: left;
- }
- }
- }
- &:last-child .item-box{
- border-bottom: 0;
- }
- }
- }
- }
- </style>
|