hldy_app_mini/pages/NursingNew/component/pleasetake/common/carditem.vue

420 lines
9.2 KiB
Vue
Raw Normal View History

2025-11-28 17:34:02 +08:00
<template>
<view>
2026-02-06 17:24:51 +08:00
<scroll-view scroll-y="true" class="itembox" scroll-with-animation @scrolltolower="scrolltolower()"
enable-back-to-top>
2025-11-28 17:34:02 +08:00
<view class="box">
<view class="fler" v-for="(v,index) in InvoicingList" :key="index">
<scroll-view class="carditem guodu" @touchend="handleTouchEnd($event,v,index)"
@touchstart="touchstart($event,v,index)" scroll-with-animation scroll-x="true"
2026-02-06 17:24:51 +08:00
:scroll-left="v.scrollleft" @scroll="scroll">
2025-12-02 09:41:23 +08:00
<view class="zding" v-if="v.zhiDingId">
<image src="/static/index/procurement/zd.png" mode="aspectFill"></image>
</view>
2026-02-06 17:24:51 +08:00
<view class="speitem guodu">
2025-12-19 16:08:58 +08:00
<view class="imgs">
<image :src="v?.materialImg?serverUrl+v?.materialImg:'/static/index/procurement/k.png'"
mode="aspectFill">
</image>
</view>
2025-11-28 17:34:02 +08:00
<view class="cardp">
<view v-if="v.categoryId_dictText">{{v.categoryId_dictText}}</view>
<view v-if="v.typeId_dictText">{{v.typeId_dictText}}</view>
2025-12-19 16:08:58 +08:00
<view v-if="v.medicationId_dictText">{{v.medicationId_dictText}}</view>
2025-11-28 17:34:02 +08:00
</view>
</view>
2026-02-06 17:24:51 +08:00
<view class="msitem guodu">
2025-11-28 17:34:02 +08:00
<view>
2025-12-09 16:06:38 +08:00
<view>{{v?.materialName}}</view>
2025-11-28 17:34:02 +08:00
</view>
2026-02-06 17:24:51 +08:00
<view class="msitem-item">
<text class="msitem-item-left">
物料编码:
</text>
<text class="msitem-item-right">
{{ v?.materialNo }}
</text>
</view>
<view class="msitem-item">
<text class="msitem-item-left">
规格型号:
</text>
<text class="msitem-item-right">
{{ v?.specificationModel }}
</text>
</view>
<view class="msitem-item">
<text class="msitem-item-left">
请领数量:
</text>
<text class="msitem-item-right" :style="v.qlNum?{fontWeight:`600`}:{}">
{{v.qlNum?v.qlNum:'--'}}
</text>
</view>
<view class="msitem-item">
<text class="msitem-item-left">
请领单位:
</text>
<text class="msitem-item-right">
{{ v?.twoUnit }}
</text>
</view>
<!-- <view>
2025-11-28 17:34:02 +08:00
<text style="white-space: nowrap;"> 规格型号: </text>
2025-12-09 16:06:38 +08:00
<view>{{v?.specificationModel}}</view>
2025-11-28 17:34:02 +08:00
</view>
<view>
<view>
<text>{{v.qlNum?v.qlNum:'--'}}</text>
<text>请领数量</text>
</view>
<view>
<text>{{v.materialUnits}}</text>
<text>请领单位</text>
</view>
2026-02-06 17:24:51 +08:00
</view> -->
2025-11-28 17:34:02 +08:00
</view>
2025-12-02 09:41:23 +08:00
<view class="add" @click.stop="comfig(v,index,0)">
2025-11-28 17:34:02 +08:00
<view v-if="v.isAdd==1">已添加</view>
2025-12-02 15:59:32 +08:00
<image v-if="v.isAdd!=1" :src="'/static/index/procurement/+.png'" mode="aspectFill"></image>
<image v-if="v.isAdd==1" :src="'/static/index/procurement/-.png'" mode="aspectFill"></image>
2025-11-28 17:34:02 +08:00
</view>
<view class="zkadd guodu" :class="v.isAdd==1?'zkf':''">
2025-12-02 09:41:23 +08:00
<view @click.stop="comfig(v,index,1)" @touchend.stop>
2025-11-28 17:34:02 +08:00
请领记录
</view>
2025-12-02 09:41:23 +08:00
<view @click.stop="comfig(v,index,2)" @touchend.stop>
2025-11-28 17:34:02 +08:00
物料详情
</view>
2025-12-02 09:41:23 +08:00
<view @click.stop="comfig(v,index,3)" @touchend.stop>
{{v.zhiDingId?'取消置顶':'置 顶'}}
2025-11-28 17:34:02 +08:00
</view>
</view>
</scroll-view>
</view>
</view>
2025-12-02 15:59:32 +08:00
<view style="height:3vw;width: 100%;display: flex;align-items: center;justify-content: center;">
2025-12-02 09:41:23 +08:00
<u-loadmore :status="status" :loadText="{nomore:'暂无更多数据'}" v-if="InvoicingList.length>6" />
</view>
2025-11-28 17:34:02 +08:00
</scroll-view>
</view>
</template>
<script setup lang="ts">
2026-02-06 17:24:51 +08:00
import { ref, onMounted, onBeforeUnmount, computed, nextTick, watch, reactive } from 'vue';
2025-11-28 17:34:02 +08:00
const props = defineProps({
InvoicingList: {
type: Array,
2026-02-06 17:24:51 +08:00
required: true
2025-11-28 17:34:02 +08:00
},
status: {
type: String
2026-02-06 17:24:51 +08:00
}
2025-11-28 17:34:02 +08:00
})
const caigouobj = ref({})
2025-12-02 09:41:23 +08:00
const serverUrl = ref(uni.getStorageSync('serverUrl') + '/sys/common/static/')
2026-02-06 17:24:51 +08:00
const emit = defineEmits(['scrolltolower', 'comfig'])
2025-11-28 17:34:02 +08:00
const pageX = ref(0);
const pageY = ref(0);
2025-12-02 09:41:23 +08:00
const ones = ref(true)
2026-02-06 17:24:51 +08:00
const touchstart = (event : any, v : any, i : number) => {
2025-11-28 17:34:02 +08:00
caigouobj.value = v;
pageX.value = event.changedTouches[0].pageX;
pageY.value = event.changedTouches[0].pageY;
2026-02-06 17:24:51 +08:00
if (ones.value) {
2025-12-02 09:41:23 +08:00
ones.value = false;
solleft(v, i)
}
}
2026-02-06 17:24:51 +08:00
const comfig = (v, i, t) => {
emit('comfig', v, i, t)
2025-11-28 17:34:02 +08:00
}
const handleTouchEnd = (event : any, v : any, i : number) => {
let y = event.changedTouches[0].pageY;
let x = event.changedTouches[0].pageX;
let absx = Math.abs(x - pageX.value)
2025-12-02 09:41:23 +08:00
let absy = Math.abs(y - pageY.value);
ones.value = true;
2026-02-06 17:24:51 +08:00
if (absy > 30 && absx + 10 < absy) {
2025-12-04 08:36:59 +08:00
caigouobj.value.scrollleft = 0.01
2026-02-06 17:24:51 +08:00
setTimeout(() => {
2025-11-28 17:34:02 +08:00
caigouobj.value.scrollleft = 0
2026-02-06 17:24:51 +08:00
}, 20)
2025-11-28 17:34:02 +08:00
return
}
if (absx < 10 && absy < 10) {
2026-02-06 17:24:51 +08:00
if (caigouobj.value.zk == false) {
setTimeout(() => {
2025-11-28 17:34:02 +08:00
caigouobj.value.scrollleft = 0
2026-02-06 17:24:51 +08:00
}, 20)
}
2025-11-28 17:34:02 +08:00
return
}
2026-02-06 17:24:51 +08:00
if (scrollLeft.value <= 40) {
2025-11-28 17:34:02 +08:00
caigouobj.value.scrollleft = scrollLeft.value;
caigouobj.value.zk = false;
2026-02-06 17:24:51 +08:00
nextTick(() => {
2025-11-28 17:34:02 +08:00
caigouobj.value.scrollleft = 0;
scrollLeft.value = 0;
})
2026-02-06 17:24:51 +08:00
} else {
2025-12-02 09:41:23 +08:00
scrollLeft.value = 150
caigouobj.value.scrollleft = scrollLeft.value;
2025-11-28 17:34:02 +08:00
caigouobj.value.zk = true;
}
caigouobj.value.zk = x > pageX.value ? false : true;
caigouobj.value.scrollleft = caigouobj.value.zk ? 150 : 0;
}
2026-02-06 17:24:51 +08:00
const solleft = (v : any, i : number) => {
2025-12-05 10:09:24 +08:00
// console.log(v)
2025-11-28 17:34:02 +08:00
props.InvoicingList.forEach((item, k) => {
2026-02-06 17:24:51 +08:00
if (k != i && item.zk == true) {
2025-11-28 17:34:02 +08:00
item.zk = false;
2026-02-06 17:24:51 +08:00
item.scrollleft = 0;
2025-11-28 17:34:02 +08:00
}
})
}
const scrolltolower = () => {
2026-02-06 17:24:51 +08:00
emit('scrolltolower')
2025-11-28 17:34:02 +08:00
}
const scrollLeft = ref(0)
2026-02-06 17:24:51 +08:00
const scroll = (e) => {
2025-11-28 17:34:02 +08:00
scrollLeft.value = e.detail.scrollLeft
2025-12-02 09:41:23 +08:00
// console.log(e.detail.scrollLeft)
2025-11-28 17:34:02 +08:00
}
2026-02-06 17:24:51 +08:00
2025-11-28 17:34:02 +08:00
</script>
<style scoped lang="less">
.zkadd {
2026-02-06 17:24:51 +08:00
width: 12vw;
2025-11-28 17:34:02 +08:00
height: 100%;
display: inline-flex;
justify-content: flex-end;
position: absolute;
top: 0;
2026-02-06 17:24:51 +08:00
right: -12vw;
view:active {
background: rgba(85, 166, 249, 1) !important;
2025-11-28 17:34:02 +08:00
color: #FFFFFF !important;
}
2026-02-06 17:24:51 +08:00
2025-11-28 17:34:02 +08:00
>view {
2026-02-06 17:24:51 +08:00
width: 4vw;
2025-11-28 17:34:02 +08:00
height: 100%;
font-weight: 400;
2026-02-06 17:24:51 +08:00
font-size: 1.4vw;
2025-11-28 17:34:02 +08:00
display: flex;
justify-content: center;
align-items: center;
writing-mode: vertical-rl;
text-orientation: upright;
2026-02-06 17:24:51 +08:00
letter-spacing: 2px;
2025-11-28 17:34:02 +08:00
&:nth-child(3) {
2026-02-06 17:24:51 +08:00
background: rgba(224, 225, 228, .6);
2025-11-28 17:34:02 +08:00
color: #555555;
}
2026-02-06 17:24:51 +08:00
2025-11-28 17:34:02 +08:00
&:nth-child(2) {
2026-02-06 17:24:51 +08:00
background: rgba(224, 225, 228, .4);
2025-11-28 17:34:02 +08:00
color: #666666;
}
2026-02-06 17:24:51 +08:00
2025-11-28 17:34:02 +08:00
&:nth-child(1) {
2026-02-06 17:24:51 +08:00
background: rgba(224, 225, 228, .2);
2025-11-28 17:34:02 +08:00
color: #666666;
}
}
}
2026-02-06 17:24:51 +08:00
2025-11-28 17:34:02 +08:00
.add {
2026-02-06 17:24:51 +08:00
width: 5vw;
2025-11-28 17:34:02 +08:00
height: 13vw;
display: inline-flex;
justify-content: space-between;
align-items: center;
position: absolute;
2026-02-06 17:24:51 +08:00
top: 0;
right: 1.5vw;
2025-11-28 17:34:02 +08:00
>view {
2026-02-06 17:24:51 +08:00
width: 5vw;
height: 2.3vw;
2025-11-28 17:34:02 +08:00
background: #E3EEF7;
2026-02-06 17:24:51 +08:00
border-radius: 1vw;
2025-11-28 17:34:02 +08:00
border: 1px solid rgba(3, 133, 250, 0.34);
font-weight: 400;
2026-02-06 17:24:51 +08:00
font-size: 1.25vw;
2025-11-28 17:34:02 +08:00
color: #1083F8;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
2026-02-06 17:24:51 +08:00
top: 1.7vw;
2025-11-28 17:34:02 +08:00
right: 0vw;
}
2026-02-06 17:24:51 +08:00
2025-11-28 17:34:02 +08:00
image {
2026-02-06 17:24:51 +08:00
width: 2.5vw;
height: 2.5vw;
2025-11-28 17:34:02 +08:00
position: absolute;
bottom: 0.8vw;
right: 0vw;
2026-02-06 17:24:51 +08:00
2025-11-28 17:34:02 +08:00
}
}
2026-02-06 17:24:51 +08:00
2025-11-28 17:34:02 +08:00
.msitem {
width: 11.5vw;
height: 100%;
position: absolute;
2026-02-06 17:24:51 +08:00
top: 0;
left: 15vw;
.msitem-item {
width: 25vw;
// background-color: red;
margin-top: 10rpx;
font-size: 34rpx;
white-space: nowrap;
/* 不换行 */
overflow: hidden;
/* 超出隐藏 */
text-overflow: ellipsis;
/* 显示 ... */
.msitem-item-left {
color: #777777;
2025-11-28 17:34:02 +08:00
}
2026-02-06 17:24:51 +08:00
.msitem-item-right {
margin-left: 10rpx;
2025-11-28 17:34:02 +08:00
}
2026-02-06 17:24:51 +08:00
}
>view {
margin-top: 0vw;
2025-11-28 17:34:02 +08:00
&:nth-child(1) {
2026-02-06 17:24:51 +08:00
view {
2025-11-28 17:34:02 +08:00
display: inline-block;
width: 10vw;
font-weight: bold;
2026-02-06 17:24:51 +08:00
font-size: 1.8vw;
2025-11-28 17:34:02 +08:00
color: #222222;
2026-02-06 17:24:51 +08:00
padding-top: 1.9vw;
2025-11-28 17:34:02 +08:00
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
2026-02-06 17:24:51 +08:00
margin-bottom: 30rpx;
2025-11-28 17:34:02 +08:00
}
}
}
}
2026-02-06 17:24:51 +08:00
.zding {
width: 6vw;
height: 6vw;
2025-12-02 09:41:23 +08:00
position: absolute;
2026-02-06 17:24:51 +08:00
left: 0vw;
top: 0vw;
2025-12-02 13:33:11 +08:00
z-index: 11;
2026-02-06 17:24:51 +08:00
image {
2025-12-02 09:41:23 +08:00
width: 100%;
height: 100%;
}
}
2026-02-06 17:24:51 +08:00
2025-11-28 17:34:02 +08:00
.speitem {
2026-02-06 17:24:51 +08:00
width: 15vw;
2025-11-28 17:34:02 +08:00
height: 100%;
display: inline-flex;
flex-direction: column;
position: absolute;
2026-02-06 17:24:51 +08:00
top: 0;
2025-11-28 17:34:02 +08:00
left: 0;
2026-02-06 17:24:51 +08:00
2025-11-28 17:34:02 +08:00
.cardp {
2026-02-06 17:24:51 +08:00
width: 9vw;
2025-11-28 17:34:02 +08:00
display: flex;
2026-02-06 17:24:51 +08:00
margin: 0.3vw auto;
margin-top: 0;
2025-11-28 17:34:02 +08:00
align-items: center;
justify-content: center;
2025-12-19 16:08:58 +08:00
flex-wrap: wrap;
2026-02-06 17:24:51 +08:00
2025-12-19 16:08:58 +08:00
// flex-direction: column;
2025-11-28 17:34:02 +08:00
view {
2026-02-06 17:24:51 +08:00
min-width: 6vw;
height: 2vw;
2025-11-28 17:34:02 +08:00
border-radius: 0.9vw;
border: 1px solid #D2D2D2;
2025-12-19 16:08:58 +08:00
margin: 0.25vw 0 0 0;
2025-11-28 17:34:02 +08:00
display: flex;
justify-content: center;
align-items: center;
font-weight: 400;
2026-02-06 17:24:51 +08:00
font-size: 1vw;
2025-11-28 17:34:02 +08:00
color: #555555;
padding: 0 0.25vw;
}
}
2026-02-06 17:24:51 +08:00
2025-12-19 16:08:58 +08:00
.imgs {
2026-02-06 17:24:51 +08:00
width: 11vw;
height: 11vw;
// background: #fff;
2025-12-19 16:08:58 +08:00
border-radius: 1.1vw;
display: flex;
justify-content: center;
align-items: center;
margin: 0.8vw auto 0;
padding: 0.3vw;
2026-02-06 17:24:51 +08:00
2025-12-19 16:08:58 +08:00
>image {
width: 100%;
height: 100%;
}
2025-11-28 17:34:02 +08:00
}
}
2026-02-06 17:24:51 +08:00
.itembox {
// width: 100%;
// height: 66vh;
padding: 1vw 2vw 0 0;
width: 90vw;
height: 64.5vh;
.box {
width: 90vw;
2025-11-28 17:34:02 +08:00
display: grid;
2026-02-06 17:24:51 +08:00
grid-template-columns: 1fr 1fr;
2025-11-28 17:34:02 +08:00
}
2026-02-06 17:24:51 +08:00
.fler {
width: 44vw;
height: 20.5vw;
// margin-bottom: 0.9vw;
.carditem {
width: 44vw;
height: 19.5vw;
background: rgba(255, 255, 255, 1);
border-radius: 1.6vw;
2025-11-28 17:34:02 +08:00
position: relative;
2026-02-06 17:24:51 +08:00
margin-bottom: 1.1vw;
display: flex;
2025-11-28 17:34:02 +08:00
overflow: hidden;
2026-02-06 17:24:51 +08:00
justify-content: flex-start;
white-space: nowrap;
2025-11-28 17:34:02 +08:00
}
}
2026-02-06 17:24:51 +08:00
}
</style>