123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588 |
- <template>
- <view class="pharmacy">
- <view class="pharmacy_header">
- <view
- class="scanning_btn"
- hover-class="seimin-btn-hover"
- @click="drugsScanning()"
- >
- <text class="icon_transport transport-saoma"></text>
- </view>
- <view class="scanFont">扫一扫</view>
- <picker v-if="depts[index]" @change="bindPickerChange" :value="index" range-key="dept" :range="depts" class="pharmacy_changeDept">
- <view class="pharmacy_input">{{depts[index].dept}}</view>
- </picker>
- </view>
- <view class="pharmacy-heng">
- <view
- class="pharmacy-heng-tab"
- :class="{ 'cube-tab_active': selectedLabelSlots === item.id }"
- v-for="(item, i) in tabs"
- :key="i"
- @click="clickHandler(item.id)"
- >
- <view class="pharmacy-heng-label">{{ item.label }}</view>
- </view>
- </view>
- <view>
- <scroll-view
- scroll-y
- :refresher-enabled="scroll_refresher_enabled"
- :refresher-triggered="triggered"
- @refresherrefresh="refresherrefresh"
- @refresherrestore="refresherrestore"
- @scroll="scroll"
- @scrolltolower="scrolltolower"
- :scroll-top="scroll_top"
- @refresherabort="refresherabort"
- >
- <view class="page_scrollIt">
- <view
- class="page_item_wrap"
- v-for="row in list"
- :key="row.id"
- @click="getDetails(row.id)"
- >
- <view class="page_item">
- <view class="page_item_top">
- <view class="page_item_top-inner">
- <view class="page_item_top_L">
- <text class="L_text">请领单:{{ row.packid }}</text>
- </view>
- <view class="page_item_top_R">
- <text class="L_iocn">{{
- row.drugsState && row.drugsState.name
- }}</text>
- </view>
- </view>
- </view>
- <view class="page_item_cont">
- <view class="page_item_cont_T">
- <view class="page_item_cont_title">
- <text>批次号</text>
- <text class="text_big">{{ row.batchNo }}</text>
- </view>
- </view>
- <view class="page_item_cont_B">
- <view class="page_item_cont_title">
- <text>请领时间</text>
- <text class="text_big">
- <text>{{ row.creatTime }}</text>
- </text>
- </view>
- </view>
- <view class="page_item_cont_C">
- <view class="page_item_cont_title_C">
- <text>请领科室</text>
- <text class="text_big">
- <text>{{ row.target && row.target.dept }}</text>
- </text>
- </view>
- </view>
- </view>
- <view class="L"></view>
- <view class="R"></view>
- </view>
- <view class="L-l"></view>
- <view class="R-l"></view>
- </view>
- <view v-if="list.length == 0" class="zwsj">
- <image
- class="zwsj_img"
- mode="widthFix"
- src="../../static/img/zanwushuju.png"
- ></image>
- <view class="zwsj_txt">暂无数据</view>
- </view>
- </view>
- </scroll-view>
- </view>
- </view>
- </template>
- <script>
- import { get, post, SM, webHandle } from "../../http/http.js";
- export default {
- data() {
- return {
- triggered: false, //下拉刷新状态
- freshing: false, //上拉加载开关
- scroll_top: 0, //距离顶部的距离
- scroll_refresher_enabled: true, //是否开启自定义下拉刷新
- selectedLabelSlots: 4,
- list: [],
- idx: 0,
- totalNum: -1,
- tabs: [
- {
- id: 4,
- label: "待配药",
- },
- {
- id: 5,
- label: "配药中",
- },
- {
- id: 6,
- label: "核对中",
- },
- ],
- depts: [],//下拉框选项
- index: 0,//下拉框索引
- hosId: uni.getStorageSync("userData").user.currentHospital.id,//当前院区
- };
- },
- methods: {
- // tab切换
- clickHandler(id) {
- this.selectedLabelSlots = id;
- this.idx = 0;
- this.totalNum = -1;
- this.scroll_top = Math.random();
- //4为微信待配药、5为微信配药中、6为微信核对中
- this.getPharmacyListData(id, 0);
- },
- // 请求列表数据
- getPharmacyListData(type, idx) {
- if (this.list.length == this.totalNum) {
- uni.showToast({
- icon: "none",
- title: "没有更多数据了!",
- });
- this.freshing = true;
- return;
- }
- let data = {
- idx,
- sum: 20,
- drugsBag: {
- searchType: type,
- launch:{id:this.depts[this.index].id}
- },
- };
- uni.showLoading({
- title: "加载中",
- mask: true,
- });
- post("/api/fetchDataList/drugsBag", data).then((res) => {
- uni.hideLoading();
- if (res.status == 200) {
- this.triggered = false;
- this.freshing = true;
- this.totalNum = res.totalNum;
- if (idx === 0) {
- this.list = res.list;
- } else {
- this.list.push(...res.list);
- }
- } else {
- uni.showToast({
- icon: "none",
- title: "请求失败!",
- });
- }
- });
- },
- // 扫一扫
- drugsScanning() {
- SM().then((ress) => {
- uni.navigateTo({
- url: "../pharmacyDetails/pharmacyDetails?qrcode=" + ress,
- });
- });
- },
- //刷新
- refresherrefresh() {
- if (this.triggered) {
- return;
- }
- this.triggered = true;
- this.idx = 0;
- this.totalNum = -1;
- this.getPharmacyListData(this.selectedLabelSlots, 0);
- },
- // 滚动
- scroll(e) {
- if (e.detail.scrollTop < 20) {
- this.scroll_refresher_enabled = true;
- } else {
- this.scroll_refresher_enabled = false;
- }
- },
- // 下拉刷新复位
- refresherrestore() {
- this.triggered = false;
- console.log("下拉刷新复位");
- },
- //下拉刷新中止
- refresherabort() {
- this.triggered = false;
- console.log("下拉刷新中止");
- },
- //分页,上拉加载
- scrolltolower() {
- if (this.freshing) {
- this.freshing = false;
- this.getPharmacyListData(this.selectedLabelSlots, ++this.idx);
- }
- },
- // 详情页面
- getDetails(id) {
- uni.navigateTo({
- url: `../pharmacyDetails/pharmacyDetails?id=${id}`,
- });
- },
- // 阻止浏览器滑动
- stop(e) {
- e.preventDefault();
- },
- //选择药房科室
- bindPickerChange: function(e) {
- console.log('picker发送选择改变,携带值为', e.target.value)
- this.index = e.target.value;
- // 待配药
- this.getPharmacyListData(4, 0);
- },
- // 获取药房类型的科室
- getDeptByPharmacy(){
- let postData = {
- "idx": 0,
- "sum": 10,
- "department": {
- "hospital": {
- "id": this.hosId
- },
- "type": {
- "id": "386"
- },
- }
- };
- uni.showLoading({
- title: "加载中",
- mask: true,
- });
- post("/data/fetchDataList/department", postData).then((res) => {
- uni.hideLoading();
- if (res.status == 200) {
- this.depts = res.list.map(v=>({id:v.id,dept:v.dept}));
- if(this.depts.length){
- this.getPharmacyListData(this.selectedLabelSlots, 0);
- }
- } else {
- uni.showToast({
- icon: "none",
- title: "请求失败!",
- });
- }
- });
- }
- },
- onLoad(options) {
- //#ifdef H5
- console.log(options.login, "login");
- if (options.login == 1) {
- // uni.setStorageSync('type', 'pharmacy')
- uni.redirectTo({
- url: "../homePage/homePage?type=pharmacy",
- });
- }
- //#endif
- // 获取药房类型的科室
- this.getDeptByPharmacy();
- // #ifdef APP-PLUS
- webHandle("no", "app");
- // #endif
- // #ifdef H5
- webHandle("no", "wx");
- // #endif
- },
- onShow() {
- // #ifdef H5
- document.body.addEventListener("touchmove", this.stop, { passive: false });
- // #endif
- },
- onUnload() {
- // #ifdef H5
- document.body.removeEventListener("touchmove", this.stop, {
- passive: false,
- });
- // #endif
- },
- };
- </script>
- <style lang="less">
- // 覆盖cube
- .cube-tab-bar {
- display: block !important;
- }
- .pharmacy /deep/ .cube-tab-bar-slider {
- display: none !important;
- }
- .pharmacy {
- background-color: rgb(249, 250, 251);
- padding-top: 36rpx;
- .pharmacy_header{
- position: relative;
- .pharmacy_changeDept{
- position: absolute;
- top: 50%;
- right: 52rpx;
- transform: translateY(-50%);
- .pharmacy_input{
- background-image: linear-gradient(to right, #72c172, #3bb197);
- border-radius: 8rpx;
- color: #fff;
- font-size: 36rpx;
- font-weight: 700;
- padding: 8rpx 16rpx;
- }
- }
- }
- .scanning_btn {
- margin: 0 auto;
- width: 138rpx;
- height: 138rpx;
- background: #72c172;
- border-radius: 50%;
- /*偏移*/
- line-height: 200rpx;
- color: #fff;
- font-size: 36rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- text {
- font-size: 48rpx;
- }
- }
- .zwsj {
- // margin-top: 180rpx;
- padding-top: 10%;
- display: flex;
- flex-direction: column;
- align-items: center;
- .zwsj_txt {
- font-size: 36rpx;
- font-weight: 700;
- margin-top: 20rpx;
- }
- .zwsj_img {
- width: 582rpx;
- }
- }
- .page_item_wrap {
- position: relative;
- margin-bottom: 32rpx;
- .page_item {
- margin-top: 16rpx;
- margin-bottom: 124rpx;
- background: #fff;
- border-radius: 8rpx;
- margin: 0 20rpx;
- border: 2rpx solid #e5e9ed;
- position: relative;
- overflow: hidden;
- padding: 0 16rpx;
- .L {
- width: 40rpx;
- height: 40rpx;
- border-radius: 50%;
- background: #f9fafb;
- position: absolute;
- left: -20rpx;
- top: 68rpx;
- border: 2rpx solid #e5e9ed;
- }
- .R {
- width: 40rpx;
- height: 40rpx;
- border-radius: 50%;
- background: #f9fafb;
- position: absolute;
- float: right;
- right: -20rpx;
- top: 68rpx;
- border: 2rpx solid #e5e9ed;
- }
- .page_item_top {
- height: 88rpx;
- border-bottom: 2rpx dashed #e5e9ed;
- padding: 0 16rpx;
- .page_item_top-inner {
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 100%;
- .page_item_top_L {
- .L_text {
- font-size: 32rpx;
- font-weight: 700;
- }
- }
- .page_item_top_R {
- font-size: 32rpx;
- .L_iocn {
- color: rgb(7, 134, 60);
- font-size: 36rpx;
- font-weight: 700;
- }
- }
- }
- }
- .page_item_cont {
- min-height: 180rpx;
- max-height: 424rpx;
- padding: 0 16rpx;
- text-align: left;
- position: relative;
- .text_big {
- font-size: 32rpx;
- font-weight: 700;
- text {
- font-weight: 700;
- line-height: 1.5;
- }
- }
- .line {
- height: 20rpx;
- width: 2rpx;
- border-left: 2rpx solid #e5e9ed;
- position: absolute;
- top: 82rpx;
- left: 40rpx;
- }
- .page_item_cont_T {
- padding-top: 28rpx;
- font-size: 28rpx;
- .page_item_cont_title {
- height: 100%;
- font-size: 32rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- }
- .page_item_cont_B {
- padding-top: 28rpx;
- margin-bottom: 28rpx;
- .page_item_cont_title {
- font-size: 32rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- }
- .page_item_cont_C {
- margin-bottom: 28rpx;
- .page_item_cont_title_C {
- font-size: 32rpx;
- display: flex;
- justify-content: space-between;
- }
- }
- }
- #infos {
- display: none;
- }
- }
- .L-l {
- width: 2rpx;
- height: 40rpx;
- background: #f9fafb;
- position: absolute;
- left: 20rpx;
- top: 72rpx;
- }
- .R-l {
- width: 2rpx;
- height: 40rpx;
- background: #f9fafb;
- position: absolute;
- right: 20rpx;
- top: 72rpx;
- }
- }
- .pharmacy-heng {
- height: 90rpx;
- display: flex;
- background-color: #fff;
- margin-bottom: 32rpx;
- .pharmacy-heng-tab {
- flex: 1 !important;
- display: flex;
- align-items: center;
- .pharmacy-heng-label {
- flex: 1;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 36rpx;
- width: 204rpx;
- height: 60rpx;
- border-radius: 30rpx;
- background-color: #fff;
- color: rgb(102, 102, 102);
- }
- &.cube-tab_active {
- .pharmacy-heng-label {
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 36rpx;
- width: 204rpx;
- height: 60rpx;
- border-radius: 30rpx;
- background-color: rgb(229, 233, 237);
- color: rgb(51, 51, 51);
- }
- }
- }
- }
- // 滚动区域
- .page_scrollIt {
- height: calc(100vh - 380rpx);
- }
- // “扫一扫”文字
- .scanFont {
- font-size: 36rpx;
- font-weight: 700;
- margin-top: 16rpx;
- margin-bottom: 32rpx;
- text-align: center;
- }
- }
- </style>
|