解决冲突

This commit is contained in:
wangweidong 2026-03-17 14:46:04 +08:00
commit a680a10ade
50 changed files with 2023 additions and 645 deletions

View File

@ -21,130 +21,205 @@
)) -->
<template>
<view>
<image :src="isError ? defaultImage : links[currentIndex]" :style="{ width: width, height: height }"
:mode="objectFit" @error="isError = true" @load="isError = false" />
<button v-if="showButton" @click="$emit('update:playing', !playing)">
<image :src="displaySrc" :style="{ width: width, height: height }" :mode="objectFit" @error="handleError"
@load="handleLoad" />
<button v-if="showButton" @click="togglePlaying">
{{ playing ? '停止播放' : '开始播放' }}
</button>
</view>
</template>
<script setup>
import {
ref,
watch,
onUnmounted
} from 'vue'
<script setup lang="ts">
import { ref, computed, watch, onUnmounted } from 'vue'
// props
/* ---------------- props ---------------- */
const props = defineProps({
// links
links: {
type: Array,
type: Array as () => string[],
default: () => []
},
//
width: {
type: String,
default: '65rpx'
},
height: {
type: String,
default: '65rpx'
},
//
objectFit: {
type: String,
default: 'aspectFill'
},
//
defaultImage: {
type: String,
default: ''
},
//
interval: {
type: Number,
default: 80
},
// falsemountedtrue
playing: {
type: Boolean,
default: false
},
//
showButton: {
type: Boolean,
default: false
},
//
loop: {
type: Boolean,
default: false
}
width: { type: String, default: '65rpx' },
height: { type: String, default: '65rpx' },
objectFit: { type: String, default: 'aspectFill' },
defaultImage: { type: String, default: '' },
interval: { type: Number, default: 80 }, // ms
playing: { type: Boolean, default: false },
showButton: { type: Boolean, default: false },
loop: { type: Boolean, default: false },
//
maxRetryPerFrame: { type: Number, default: 1 }
})
//
const emit = defineEmits(['update:playing'])
//
const currentIndex = ref(0) //
const isPlaying = ref(false) //
const isError = ref(false) //
let timer = null //
/* ---------------- local state ---------------- */
const currentIndex = ref(0)
const internalPlaying = ref(false) // props.playing
const timer : { id : number | null } = { id: null } // 使便
//
const frameRetries = new Map<number, number>()
//
const failedFrames = new Set<number>()
//
const startPlay = () => {
if (isPlaying.value) return
isPlaying.value = true
timer = setInterval(() => {
if (props.loop) {
// 使
currentIndex.value = (currentIndex.value + 1) % props.links.length
isError.value = false
} else {
//
if (currentIndex.value < props.links.length - 1) {
currentIndex.value++
isError.value = false
} else {
stopPlay()
/* ---------------- helpers / computed ---------------- */
const hasLinks = computed(() => Array.isArray(props.links) && props.links.length > 0)
const displaySrc = computed(() => {
if (!hasLinks.value) {
return props.defaultImage || ''
}
// defaultImage
if (failedFrames.has(currentIndex.value) && props.defaultImage) {
return props.defaultImage
}
// defaultImage
const idx = currentIndex.value
return props.links[idx] || props.defaultImage || ''
})
/* ---------------- play control (使用递归 setTimeout) ---------------- */
function clearTimer() {
if (timer.id !== null) {
clearTimeout(timer.id)
timer.id = null
}
}
function scheduleNextTick() {
// schedule
if (timer.id !== null) return
timer.id = setTimeout(() => {
timer.id = null
tickFrame()
//
if (props.playing) {
// links schedule
if (hasLinks.value) {
scheduleNextTick()
}
}
}, props.interval)
}, Math.max(16, props.interval)) as unknown as number
}
//
const stopPlay = () => {
isPlaying.value = false
clearInterval(timer)
function startPlay() {
if (!hasLinks.value) return
if (timer.id !== null) return
internalPlaying.value = true
scheduleNextTick()
}
// playing
function stopPlay() {
internalPlaying.value = false
clearTimer()
}
function tickFrame() {
//
if (!hasLinks.value) return
const len = props.links.length
if (len === 0) return
if (props.loop) {
//
currentIndex.value = (currentIndex.value + 1) % len
} else {
//
if (currentIndex.value < len - 1) {
currentIndex.value++
} else {
//
stopPlay()
// playing
emit('update:playing', false)
}
}
}
/* ---------------- image event handlers ---------------- */
function handleError() {
//
const idx = currentIndex.value
const prev = frameRetries.get(idx) || 0
const nextCount = prev + 1
frameRetries.set(idx, nextCount)
if (nextCount > (props.maxRetryPerFrame || 0)) {
// defaultImage
failedFrames.add(idx)
// schedule scheduleNextTick
// tickFrame()
if (hasLinks.value) {
// loop loop advance stop
if (props.loop || currentIndex.value < props.links.length - 1) {
// advance scheduletickFrame timer
tickFrame()
} else {
stopPlay()
emit('update:playing', false)
}
}
} else {
//
if (hasLinks.value) {
if (props.loop || currentIndex.value < props.links.length - 1) {
tickFrame()
} else {
stopPlay()
emit('update:playing', false)
}
}
}
}
function handleLoad() {
//
const idx = currentIndex.value
frameRetries.delete(idx)
failedFrames.delete(idx)
}
/* ---------------- watch props ---------------- */
// props.playing props.playing /
watch(() => props.playing, (val) => {
currentIndex.value = 0
if (val) {
// reset index 0
// currentIndex.value = 0
startPlay()
} else {
stopPlay()
setTimeout(() => currentIndex.value = 0, 50)
//
setTimeout(() => {
currentIndex.value = 0
}, 50)
}
})
// links
watch(() => props.links, () => {
// links deep watch
// retry/failed
watch(() => props.links, (newLinks, oldLinks) => {
//
if (newLinks === oldLinks) return
//
currentIndex.value = 0
isError.value = false
if (isPlaying.value) {
frameRetries.clear()
failedFrames.clear()
// props.playing true timer
if (props.playing) {
stopPlay()
// schedule
setTimeout(() => {
if (props.playing) startPlay()
}, 30)
}
}, {
deep: true
})
}, { immediate: false })
//
/* ---------------- toggle via internal button ---------------- */
function togglePlaying() {
emit('update:playing', !props.playing)
}
/* ---------------- cleanup ---------------- */
onUnmounted(() => {
stopPlay()
clearTimer()
})
</script>

View File

@ -1586,7 +1586,7 @@
.message-view {
display: flex;
font-size: 25rpx;
.message-shu {
width: 3rpx;
height: 1.5vw;

View File

@ -25,14 +25,14 @@ export const getServiceTree2 = () => {
// 查询表格
export const getNclist = (nuId,elderId) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/getNclist?nuId=${nuId}&elderId=${elderId}`,
url: `${uni.getStorageSync('serverUrl')}/api/pad/${uni.getStorageSync('rulerbase')}/directive/getNclist?nuId=${nuId}&elderId=${elderId}`,
method: 'get',
})
}
// 保存表格
export const addBatch = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/addBatch`,
url: `${uni.getStorageSync('serverUrl')}/api/pad/${uni.getStorageSync('rulerbase')}/directive/addBatch`,
method: 'post',
data: params,
})
@ -70,7 +70,7 @@ export const getNcPackagelist = (instructionTagId) => {
// 新增即时指令
export const addInstant = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/addInstant`,
url: `${uni.getStorageSync('serverUrl')}/api/pad/${uni.getStorageSync('rulerbase')}/directive/addInstant`,
method: 'post',
data: params,
})
@ -79,7 +79,7 @@ export const addInstant = (params) => {
// 新增情绪/体型标签
export const addElderTag = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/addElderTag`,
url: `${uni.getStorageSync('serverUrl')}/api/pad/${uni.getStorageSync('rulerbase')}/directive/addElderTag`,
method: 'post',
data: params,
})
@ -97,7 +97,7 @@ export const addElderTag = (params) => {
// 编排护理流程-删除即时服务指令
export const deleteInstant = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}//api/pad/care/directive/deleteInstant`,
url: `${uni.getStorageSync('serverUrl')}/api/pad/${uni.getStorageSync('rulerbase')}/directive/deleteInstant`,
method: 'post',
data: params,
})
@ -106,7 +106,7 @@ export const deleteInstant = (params) => {
// 编排护理流程-删除情绪/体型标签
export const deleteElderTag = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/deleteElderTag`,
url: `${uni.getStorageSync('serverUrl')}/api/pad/${uni.getStorageSync('rulerbase')}/directive/deleteElderTag`,
method: 'post',
data: params,
})
@ -123,7 +123,7 @@ export const deleteElderTag = (params) => {
// 根据日期查询日程表
export const getDirectiveOrders = (date) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/getDirectiveOrders?nuId=${uni.getStorageSync('nuId')}&elderId=${uni.getStorageSync('elderId')}&queryDate=${date}`,
url: `${uni.getStorageSync('serverUrl')}/api/pad/${uni.getStorageSync('rulerbase')}/directive/getDirectiveOrders?nuId=${uni.getStorageSync('nuId')}&elderId=${uni.getStorageSync('elderId')}&queryDate=${date}`,
method: 'get',
})
}
@ -131,15 +131,23 @@ export const getDirectiveOrders = (date) => {
// 新增服务指令
export const addDirective = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/addDirective`,
url: `${uni.getStorageSync('serverUrl')}/api/pad/${uni.getStorageSync('rulerbase')}/directive/addDirective`,
method: 'post',
data: params,
})
}
// // 编排护理流程-修改服务指令
// export const editDirective = (params) => {
// return request({
// url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/directive/editDirective`,
// method: 'post',
// data: params,
// })
// }
// 删除服务指令
export const deleteDirective = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/deleteDirective`,
url: `${uni.getStorageSync('serverUrl')}/api/pad/${uni.getStorageSync('rulerbase')}/directive/deleteDirective`,
method: 'post',
data: params,
})
@ -147,7 +155,7 @@ export const deleteDirective = (params) => {
// 修改服务指令
export const editDirective = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/editDirective`,
url: `${uni.getStorageSync('serverUrl')}/api/pad/${uni.getStorageSync('rulerbase')}/directive/editDirective`,
method: 'post',
data: params,
})

View File

@ -666,8 +666,8 @@
.check-box {
margin-left: 52rpx;
width: 32rpx;
height: 32rpx;
width: 38rpx;
height: 38rpx;
border: 2rpx solid #d5d5d5;
border-radius: 12rpx;
@ -675,15 +675,15 @@
align-items: center;
justify-content: center;
font-size: 15rpx;
font-weight: 800;
font-size: 20rpx;
font-weight: 1000;
color: #d5d5d5;
}
.check-box-target {
margin-left: 52rpx;
width: 32rpx;
height: 32rpx;
width: 38rpx;
height: 38rpx;
border: 2rpx solid #0080FC;
border-radius: 12rpx;
@ -691,8 +691,8 @@
align-items: center;
justify-content: center;
font-size: 15rpx;
font-weight: 800;
font-size: 20rpx;
font-weight: 1000;
color: #0080FC;
}
@ -807,7 +807,7 @@
.blue-icon {
position: absolute;
right: 30rpx;
top: 20rpx;
top: 21rpx;
width: 45rpx;
height: 45rpx;
}
@ -1051,7 +1051,7 @@
.card-time {
position: absolute;
bottom: 30rpx;
bottom: 25rpx;
left: 30rpx;
font-size: 30rpx;
}
@ -1283,21 +1283,6 @@
transition: transform 1s cubic-bezier(.2, .9, .3, 1);
position: relative;
.instant-close {
width: 30rpx;
height: 30rpx;
border-radius: 50%;
display: flex;
/* background-color: #0184db; */
justify-content: center;
align-items: center;
position: absolute;
top: 20rpx;
right: 20rpx;
z-index: 10;
color: #fff;
}
.instant-icon {
width: 60rpx;
height: 60rpx;
@ -1314,6 +1299,20 @@
}
}
.instant-close {
width: 30rpx;
height: 30rpx;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 20rpx;
right: 20rpx;
z-index: 10;
color: #fff;
}
/* iOS 风格抖动 */
@keyframes wiggle {
0% {
@ -1340,7 +1339,7 @@
border-radius: 35rpx;
position: relative;
margin-top: 18rpx;
padding-top: 30rpx;
padding-top: 10rpx;
.right-servers {
width: 100%;
@ -1454,20 +1453,6 @@
margin-left: -5rpx;
display: flex;
align-items: center;
.target-gray {
background-color: #F8F8FA;
border: 1rpx solid #D5D5D5;
display: flex;
height: 100%;
align-items: center;
padding: 0 18rpx;
border-radius: 10rpx;
font-size: 28rpx;
color: #222222;
}
}
.target-contain {
@ -1525,7 +1510,7 @@
/* background-color: red; */
.target-blue {
/* color: #0089FE; */
color: #0089FE;
}
.target-shu {
@ -1551,7 +1536,7 @@
top: 310rpx;
left: 0;
width: 100%;
height: 472rpx;
height: 490rpx;
background-color: #fff;
border: 2rpx solid rgba(0, 137, 254, 0.29);
border-radius: 35rpx;
@ -1672,7 +1657,7 @@
.triangle {
position: absolute;
top: -8.34rpx;
right: 250rpx;
right: 280rpx;
width: 0;
height: 0;
border-left: 14.44rpx solid transparent;
@ -1801,7 +1786,7 @@
right: 20rpx;
top: 50%;
transform: translateY(-50%);
width: 200rpx;
width: 220rpx;
height: 70%;
background-color: #0089FE;
border-radius: 20rpx;
@ -1810,6 +1795,13 @@
align-items: center;
color: #fff;
font-size: 35rpx;
.white-imge {
width: 40rpx;
height: 40rpx;
margin-right: 5rpx;
}
}
}
@ -1850,6 +1842,21 @@
border-radius: 5rpx;
}
.more-card {
position: absolute;
right: 25rpx;
top: 25rpx;
width: 25rpx;
height: 25rpx;
/* font-size: 24rpx; */
/* display: flex;
justify-content: center;
align-items: center; */
/* background-color: #4690FF; */
/* color: #fff; */
/* border-radius: 5rpx; */
}
.forscroll {
width: 90%;
margin-left: 5%;
@ -1988,6 +1995,8 @@
justify-content: center;
align-items: center;
flex-direction: column;
/* border: 1rpx solid black; */
/* white-space: nowrap; */
/* 不换行 */
/* overflow: hidden; */
@ -2055,7 +2064,7 @@
/* background-color: red; */
.packtarget-blue {
/* color: #0089FE; */
color: #0089FE;
}
.packtarget-shu {
@ -2075,7 +2084,7 @@
.packtarget-detail {
width: 100%;
height: 250rpx;
height: 220rpx;
.detail-father {
display: flex;
@ -2086,7 +2095,7 @@
.details {
height: 125rpx;
height: 110rpx;
min-width: 180rpx;
max-width: 180rpx;
/* border: 1rpx solid black; */
@ -2098,6 +2107,7 @@
/* 不换行 */
/* overflow: hidden; */
font-size: 25rpx;
position: relative;
.detail-icon {
width: 50rpx;
@ -2111,16 +2121,17 @@
.packtarget-end {
width: 100%;
height: 200rpx;
height: 240rpx;
display: flex;
padding-top: 15rpx;
position: relative;
/* background-color: red; */
.target-edit {
position: absolute;
right: 5rpx;
bottom: 5rpx;
bottom: 0rpx;
width: 130rpx;
height: 60rpx;
display: flex;
@ -2134,37 +2145,39 @@
}
.end-icon {
width: 90rpx;
height: 90rpx;
margin-left: -5rpx;
width: 80rpx;
height: 80rpx;
margin-left: 20rpx;
margin-top: 5rpx;
margin-right: 5rpx;
margin-right: 20rpx;
/* background-color: red; */
}
}
.target-gray {
background-color: #F8F8FA;
border: 1rpx solid #D5D5D5;
display: flex;
height: 35rpx;
padding: 0 10rpx;
border-radius: 10rpx;
font-size: 25rpx;
color: #7a7a7a;
justify-content: center;
align-items: center;
}
.packtarget-title {
width: 100%;
width: 350rpx;
height: 40rpx;
display: flex;
position: relative;
.target-gray {
background-color: #F8F8FA;
border: 1rpx solid #D5D5D5;
display: flex;
height: 100%;
align-items: center;
padding: 0 10rpx;
border-radius: 10rpx;
font-size: 23rpx;
color: #222222;
}
.target-black {
position: absolute;
top: 2.5rpx;
right: 0;
font-size: 29rpx;
left: 0;
font-size: 32rpx;
/* margin-top: 3rpx; */
}
@ -2177,11 +2190,21 @@
}
.packtarget-serviceContent {
width: 430rpx;
height: 100rpx;
position: absolute;
left: 0;
top: 100rpx;
width: 530rpx;
height: 70rpx;
margin-top: 10rpx;
font-size: 25rpx;
color: #666666;
display: -webkit-box;
/* background-color: red; */
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/* 限制两行 */
overflow: hidden;
text-overflow: ellipsis;
}
/* 隐藏状态 */
@ -2331,8 +2354,97 @@
color: #555555;
}
}
.changerulertype{
.changerulertype {
width: 100%;
height: 125rpx;
/* background-color: red; */
margin-top: 40rpx;
/* height: 125rpx; */
display: flex;
/* align-items: center; */
justify-content: center;
.typeitem {
width: 88%;
height: 70rpx;
background-color: #F2F7FE;
border-radius: 30rpx;
display: flex;
position: relative;
.typeitem-one {
min-width: 20%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
border-radius: 40rpx;
font-size: 29rpx;
z-index: 1;
}
.typeitem-one-blue {
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 20%;
border-radius: 40rpx;
background-color: #0089FE;
transition: left 0.3s ease;
}
}
}
.typeitem-all {
display: flex;
width: 100%;
height: 100%;
}
.includestwo-father {
display: flex;
align-items: center;
margin-top: 5rpx;
}
.includestwo {
width: 110rpx;
height: 50rpx;
background-color: #0080FC;
border-radius: 15rpx;
display: flex;
font-size: 23rpx;
justify-content: center;
align-items: center;
color: #fff;
}
.includestwo-detail {
font-size: 25rpx;
margin-left: 10rpx;
}
.includestwo-image {
width: 12rpx;
height: 11rpx;
margin-left: 6rpx;
}
.target-gray-spec {
background-color: #F8F8FA;
border: 1rpx solid #D5D5D5;
display: flex;
height: 35rpx;
padding: 0 10rpx;
border-radius: 10rpx;
font-size: 25rpx;
color: #222222;
justify-content: center;
align-items: center;
}
.gray-view{
display: flex;
align-items: center;
margin-top: 7rpx;
}

View File

@ -61,9 +61,12 @@
<image class="blue-img"
:src="`/static/index/newtarget${timearr[index0]?.children[index1]?.id?`red`:``}.png`" />
</view>
<view class="card-bao" v-if="item1.izPackage==`Y`">
<!-- <view class="card-bao" v-if="item1.izPackage==`Y`">
</view>
</view> -->
<!-- <image class="more-card"
v-if="item1.includesarray && item1.includesarray.length>1"
src="/static/index/manycards.png" /> -->
<view :class="getClass(item1,index0,index1)"
style="font-size: 30rpx;overflow: hidden;"
:style="{ animationDelay:`-${computeDelay(index0, index1).toFixed(2)}s`,border:saveEditIndex.index0 == index0 && saveEditIndex.index1 == index1 && !isTuoing && item1.startTime? `2rpx solid #46B2F6`:'' }">
@ -79,6 +82,18 @@
class="title-time-font-tags">
({{ item1.directiveName?splitString(item1.directiveName)[1]:""}})
</view>
<view class="includestwo-father"
v-if="item1.includesarray && item1.includesarray.length>1">
<view class="includestwo">
指令集合
</view>
<view class="includestwo-detail">
详情
</view>
<image class="includestwo-image"
src="/static/index/rightmore.png" />
</view>
<view v-if="item1.startTime" class="card-time">
<view class="weight-time">
@ -111,7 +126,7 @@
<view class="blue-font">
情绪标签
</view>
<image class="blue-icon" @click.stop="tagsopen=!tagsopen"
<image class="blue-icon" @click.stop="clicktagsopen()"
src="/static/index/procurement/explain.png" mode="aspectFill"></image>
<view class="blue-text" v-show="tagsopen">
@ -182,17 +197,17 @@
<view :class="item.izSelected==`Y`?`check-box-target`: `check-box`">
</view>
<image class="check-img" :src="
<!-- <image class="check-img" :src="
item.izSelected === 'Y'
? (item.picFocus ? serverUrl + item.picFocus : noimageshowtarget)
: (item.pic ? serverUrl + item.pic : noimageshow)" />
: (item.pic ? serverUrl + item.pic : noimageshow)" /> -->
<image class="check-img" :src="
(item.pic ? serverUrl + item.pic : noimageshow)" />
<view class="check-text-view">
<view class="check-weight"
:style="item.izSelected==`Y`?{color:`#0074E1`}: {}">
<view class="check-weight">
{{ item.tagName }}
</view>
<view class="check-text"
:style="item.izSelected==`Y`?{color:`#0074E1`}: {}">
<view class="check-text">
{{ item.describ }}
</view>
</view>
@ -205,7 +220,7 @@
</view>
</view>
<view class="forfixed" @click.stop>
<view class="forfixed" @click.stop="cleanallopen">
<view class="right-instant" v-show="!openmore"
:style="isblue==`1`&&isTuoing?postitem?.packageName?{border:`4rpx dashed red`}:{border:`4rpx dashed #0089FE`}:{border:`4rpx dashed #fff`}">
<view class="right-instant-title">
@ -214,10 +229,10 @@
即时标签
</view>
</view>
<image class="explain-icon" style="right: 27rpx;" @click.stop="jishiopen=!jishiopen"
<image class="explain-icon" style="right: 27rpx;" @click.stop=" clickjishiopen()"
src="/static/index/procurement/explain.png" mode="aspectFill"></image>
<view class="explain-text" v-show="jishiopen">
<view class="explain-text" v-show="jishiopen" style="top: 70rpx;">
<view class="triangle">
<view class="triangle-small"></view>
</view>
@ -247,7 +262,7 @@
</view>
</view>
</view>
<view class="instant-more" @click="clickopenmore">
<view class="instant-more" @click.stop="clickopenmore">
<image class="more-imge" src="/static/index/down.png" />
</view>
</view>
@ -294,7 +309,7 @@
{{ bottomItems[moreindex]?.directiveName }}
</view>
<view class="detail-contain">
{{ bottomItems[moreindex]?.serviceContent }}
{{ bottomItems[moreindex]?.serviceContent || `暂无指令详细信息` }}
</view>
</view>
</view>
@ -309,11 +324,17 @@
</view>
</view>
</view>
<view class="right-tree" @click="editopen=false;settingopen = false;">
<view class="right-tree" @click="cleanallopen">
<view class="right-servers">
<view :class="servertype===index?`servertarget`:`server`"
v-show="!ruleritem.directiveName" v-for="(item,index) in [`服务指令`,`服务指令包`]"
:key="index" @click="openserver(index)">
<view class="right-instant-title">
<view class="blue-shu" style="margin-left: 30rpx;"></view>
<view class="blue-font">
服务指令
</view>
</view>
<!-- <view :class="servertype===index?`servertarget`:`server`"
v-show="!ruleritem.directiveName" v-for="(item,index) in [`服务指令`]" :key="index"
@click="openserver(index)">
{{ item }}
</view>
<view class="servers-heng" v-show="!ruleritem.directiveName"
@ -322,23 +343,26 @@
<view class="servertarget" v-show="ruleritem.directiveName && ruleritem.izPackage==`N` "
v-for="(item,index) in [`服务指令`]" :key="index">
{{ item }}
</view>
<view class="servertarget" v-show="ruleritem.directiveName && ruleritem.izPackage==`Y` "
</view> -->
<!-- <view class="servertarget" v-show="ruleritem.directiveName && ruleritem.izPackage==`Y` "
v-for="(item,index) in [`服务指令包`]" :key="index">
{{ item }}
</view>
<view class="servers-heng" :style="ruleritem.izPackage==`Y`?{left:`114rpx`}:{}"
v-show="ruleritem.directiveName"></view>
</view> -->
<!-- <view class="servers-heng" :style="ruleritem.izPackage==`Y`?{left:`114rpx`}:{}"
v-show="ruleritem.directiveName"></view> -->
<image class="explain-icon" @click="explainopen=!explainopen" style="top: 0;"
<image class="explain-icon" @click.stop="clickexplainopen" style="top: 25rpx;"
v-if="ruleritem.includesarray?.length !== 1 "
src="/static/index/procurement/explain.png" mode="aspectFill"></image>
<view class="explain-text" v-show="explainopen">
<view class="explain-text" v-show="explainopen" style="top: 78rpx;"
:style="ruleritem.includesarray?.length >1?{height:`80rpx`}:{height:`160rpx`}">
<view class="triangle">
<view class="triangle-small"></view>
</view>
<view class="">
双击服务指令可添加矩阵, 长按服务指令可拖动到即时指令区进行添加
{{ ruleritem.includesarray?.length >1?`长按可进行删除操作。`:`双击服务指令可添加矩阵, 长按服务指令可拖动到即时指令区进行添加。` }}
</view>
</view>
</view>
@ -391,7 +415,18 @@
</view>
</view>
<view class="changerulertype" v-show="!ruleritem.directiveName && !servertype">
<scroll-view scroll-x class="typeitem">
<view class="typeitem-all">
<view class="typeitem-one-blue" :style="{left:`${ whitchtype * 20}%`}">
</view>
<view class="typeitem-one" :style="whitchtype===index?{color:`#fff`}:{}"
v-for="(item,index) in typearray" :key="index" @click="clicktype(index)">
{{ item }}
</view>
</view>
</scroll-view>
</view>
<view class="three-items" v-show="!ruleritem.directiveName && servertype"
style="flex-direction: column;margin-left: 25rpx;width: 91.8%;">
@ -442,7 +477,7 @@
{{ savePackagelist[packnumber]?.directives[packdetail]?.directiveName }}
</view>
<view class="detail-contain">
{{ savePackagelist[packnumber]?.directives[packdetail]?.serviceContent }}
{{ savePackagelist[packnumber]?.directives[packdetail]?.serviceContent || `暂无指令详细信息` }}
</view>
</view>
</view>
@ -450,15 +485,15 @@
</scroll-view>
</view>
<view class="target-items-father"
v-if="ruleritem.directiveName && ruleritem.izPackage==`N`">
v-if="ruleritem.directiveName && ruleritem.includesarray?.length<2">
<view class="target-items">
<view class="target-gray">
<view class="target-gray-spec">
{{ ruleritem.categoryName }}
</view>
<view class="target-shu">
|
</view>
<view class="target-gray">
<view class="target-gray-spec">
{{ ruleritem.typeName }}
</view>
</view>
@ -479,7 +514,11 @@
<view class="target-shu">
|
</view>
<text class="target-blue">
<text v-if="!editingmode">
{{ ruleritem.newtypename }}
</text>
<text class="target-blue" v-else
@click.stop="edititems(ruleritem,false)">
{{ ruleritem.newtypename }}
</text>
<view class="target-shu">
@ -494,40 +533,47 @@
</view>
</view>
<view class="target-smalltext">
{{ ruleritem.serviceContent }}
{{ ruleritem.serviceContent || `暂无指令详细信息` }}
</view>
<view class="target-edit" style="right: 150rpx;" @click.stop="editcardname"
<view class="target-edit" style="right: 150rpx;" @click.stop="editcardname(0)"
v-show="editingmode">
修改
添加
</view>
<view class="target-edit" @click.stop="edititems(ruleritem)" v-show="editingmode">
<view class="target-edit" @click.stop="editcardname(1)" v-show="editingmode">
替换
</view>
<!-- <view class="target-edit" @click.stop="edititems(ruleritem,false)" v-show="editingmode">
编辑
</view>
</view> -->
</view>
<view class="target-items-father"
v-if="ruleritem.directiveName && ruleritem.izPackage==`Y`&& ruleritem?.directivesList">
<view class="target-items-father" @click="detailshake=false"
v-if="ruleritem.directiveName && ruleritem.includesarray?.length>1">
<view class="packtargetmessage">
<image class="packtargetmessage-icon" :src=" `/static/index/packtarget.png`"
<!-- <image class="packtargetmessage-icon" :src=" `/static/index/packtarget.png`"
mode="aspectFill" />
<view class="packtarget-font">
{{ ruleritem.directiveName }}
</view>
</view> -->
<view class="packtarget-strart">
{{ ruleritem.startTime }}
{{ ruleritem?.includesarray[packtargetindex]?.startTime }}
</view>
<view class="packtarget-other">
<view class="packtarget-shu">
|
</view>
<text class="packtarget-blue">
{{ ruleritem.newtypename }}
<text v-if="!editingmode">
{{ ruleritem?.includesarray[packtargetindex]?.newtypename }}
</text>
<text class="packtarget-blue" v-else @click.stop="edititems(ruleritem?.includesarray[packtargetindex],true)">
{{ ruleritem?.includesarray[packtargetindex]?.newtypename }}
</text>
<view class="packtarget-shu">
|
</view>
<view style="color: #919191;">
{{ ruleritem.serviceDuration }}分钟
{{ ruleritem?.includesarray[packtargetindex]?.serviceDuration }}分钟
</view>
</view>
</view>
@ -535,64 +581,86 @@
<scroll-view class="packtarget-detail" scroll-with-animation :scroll-y="canmovechange">
<view class="detail-father">
<view class="details" :style="packtargetindex==index?{color:`#0089FE`}:{}"
v-for="(item,index) in ruleritem?.directivesList"
@click="packtargetindex=index;killbaddata = true" :key="index">
<image class="detail-icon" :src="
v-for="(item,index) in ruleritem?.includesarray"
@touchstart="startdeletedetail" @touchend="enddeletedetail"
@click.stop="cleanallopen();packtargetindex=index;killbaddata = true"
:key="index">
<image class="detail-icon" :class="detailshake?`wiggle`:``" :src="
index === packtargetindex
? (item.immediateFileFocus ? serverUrl + item.immediateFileFocus : noimageshowtarget)
: (item.immediateFile ? serverUrl + item.immediateFile : noimageshow)
" mode="aspectFill">
</image>
<view class="">
{{ splitString(item.directiveName)[0] }}
{{ shortText(item.directiveName,6) }}
</view>
<view style="height: 3rpx;font-size: 20rpx;">
<view class="instant-close" v-show="detailshake"
@click.stop="killinstantopen(item)">
<image style="width: 80%;height: 80%;" src="/static/index/deleticon.png"
mode="aspectFill"></image>
</view>
<!-- <view style="height: 3rpx;font-size: 20rpx;">
{{ splitString(item.directiveName)[1] ? `(${splitString(item.directiveName)[1]})`:``}}
</view>
</view> -->
</view>
</view>
</scroll-view>
<view class="packtarget-heng"></view>
<view class="packtarget-end">
<image class="end-icon" :src="
ruleritem?.directivesList[packtargetindex]?.immediateFile
? serverUrl + ruleritem.directivesList[packtargetindex]?.immediateFile
: noimageshow
" mode="aspectFill">
</image>
<view class="">
<image class="end-icon" :src="
ruleritem?.includesarray[packtargetindex]?.immediateFile
? serverUrl + ruleritem.includesarray[packtargetindex]?.immediateFile
: noimageshow
" mode="aspectFill">
</image>
</view>
<view class="">
<view class="packtarget-title">
<view class="target-black">
{{ splitString(ruleritem?.includesarray[packtargetindex]?.directiveName)[0] + (splitString(ruleritem?.includesarray[packtargetindex]?.directiveName)[1]?`(${splitString(ruleritem?.includesarray[packtargetindex]?.directiveName)[1]})`:"") }}
</view>
<view class="target-black"
v-if="splitString(ruleritem?.includesarray[packtargetindex]?.directiveName)[1] ">
</view>
</view>
<view class="gray-view">
<view class="target-gray">
{{ ruleritem?.directivesList[packtargetindex]?.categoryName }}
{{ ruleritem?.includesarray[packtargetindex]?.categoryName }}
</view>
<view class="target-shu">
|
</view>
<view class="target-gray">
{{ ruleritem?.directivesList[packtargetindex]?.typeName }}
</view>
<view class="target-black">
{{ splitString(ruleritem?.directivesList[packtargetindex]?.directiveName)[0] }}
{{ ruleritem?.includesarray[packtargetindex]?.typeName }}
</view>
</view>
<view class="packtarget-serviceContent">
{{ ruleritem?.directivesList[packtargetindex]?.serviceContent }}
</view>
</view>
<view class="target-edit" style="right: 150rpx;" @click.stop="editcardname"
<!-- <view class="target-edit" style="right: 150rpx;" @click.stop="editcardname(1)"
v-show="editingmode">
修改
</view> -->
<view class="packtarget-serviceContent">
{{ ruleritem?.includesarray[packtargetindex]?.serviceContent || `暂无指令详细信息` }}
</view>
<view class="target-edit" @click.stop="edititems(ruleritem)" v-show="editingmode">
<view class="target-edit" @click.stop="editcardname(0)" v-show="editingmode">
添加
</view>
<!-- <view class="target-edit"
@click.stop="edititems(ruleritem?.includesarray[packtargetindex],true)"
v-show="editingmode">
编辑
</view>
</view> -->
</view>
</view>
<view class="edit-open" v-show="editopen" @click.stop>
<view class="edit-open" :style="whitetou?{top:`160rpx`}:{}" v-show="editopen" @click.stop>
<view class="edit-menu">
<view class="triangle">
<view class="triangle" :style="whitetou?{right:`390rpx`}:{}">
<view class="triangle-small"></view>
</view>
<view class="edit-tags" :style="edittype===index?{fontWeight:`800`}:{}"
@ -676,7 +744,8 @@
</view>
</view>
<view class="blue-right" @click="cleanallopen();editingmode = !editingmode">
{{ editingmode?"确定":"+编辑" }}
<image class="white-imge" src="/static/index/changemode.png" />
{{ editingmode?"只读模式":"编辑模式" }}
</view>
</view>
@ -782,7 +851,7 @@
</template>
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, computed, nextTick, watch, onUnmounted } from 'vue';
import { ref, onMounted, onBeforeUnmount, computed, nextTick, watch, onUnmounted, toRaw } from 'vue';
import { onShow, onHide } from '@dcloudio/uni-app';
import { getNclist, addBatch, addDirective, addInstant, deleteDirective, editDirective } from "./api.js";
import { myArray } from './yaoshandiao.js';
@ -814,6 +883,25 @@
}
});
const typearray = ["护理", "医疗", "后勤", "占位", "占位", "占位"]
const whitchtype = ref(0)
const typebasearray = ["care", "", "invoicing"]
const clicktype = (index : number) => {
if (index < 3) {
whitchtype.value = index
if (typebasearray[index]) {
uni.setStorageSync('rulerbase', typebasearray[index])
init()
}
}
}
const canmovechange = ref(true);
const nextpageing = ref(false)
let nextPageTimer = null
@ -924,14 +1012,21 @@
nosave.value.optCount = ""
}
}
const isclickright = ref(false)
const allisright = () => {
if (isclickright.value) return
//
if (nosave.value.cycleTypeId == `5` && nosave.value.cycleValue) {
nosave.value.cycleValue = Number(inputnum.value).toString()
}
let allobject = ruleritem.value
isclickright.value = true
let allobject = {}
if(whitetou.value){
allobject = smallcard.value
}else{
allobject = ruleritem.value
}
const now = new Date();
const ts = `${now.getFullYear()}-${(now.getMonth() + 1).toString().padStart(2, '0')}-${now.getDate().toString().padStart(2, '0')} ${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}:${now.getSeconds().toString().padStart(2, '0')}`;
let data = {
@ -948,21 +1043,22 @@
optCount: nosave.value.optCount,
optTime: ts,
}
// return
// console.log("", data)
editDirective(data).then((res) => {
console.log("kankan", data, res)
// console.log("1111", res)
if (res.success) {
geteverything()
setTimeout(() => {
editopen.value = false
rulerTouchClick(timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1], saveEditIndex.value.index0, saveEditIndex.value.index1)
}, 300)
}
editopen.value = false
isclickright.value = false
})
}
const inputnum = ref(-1)
const inputnum = ref(1)
const secondinstantshow = ref([-1, -1])
const gettop = ref(0)
const clickinstant = (index : number) => {
@ -996,7 +1092,14 @@
cycleValue: "",
optCount: "",
})
const edititems = (item : any) => {
const whitetou = ref(false);
const smallcard = ref({});
const edititems = (item : any, whitetoushow : boolean) => {
if(whitetoushow){
smallcard.value = item;
}
whitetou.value = whitetoushow
nosave.value.cycleTypeId = item.cycleTypeId;
nosave.value.cycleValue = item.cycleValue
nosave.value.optCount = item.optCount
@ -1018,6 +1121,15 @@
}, 1000)
const enddelete = () => clearTimeout(t)
const detailshake = ref(false);
const startdeletedetail = () => t = setTimeout(() => {
if (editingmode.value) {
detailshake.value = true
}
}, 1000)
const enddeletedetail = () => clearTimeout(t)
// startdeletedetail
const addinstantcommand = () => {
if (!postitem.value.packageName) {
const exists = bottomItems.value.some((element : any) => {
@ -1111,7 +1223,11 @@
editopen.value = false;
openmore.value = false;
deleteshake.value = false;
packtargetindex.value = 0
detailshake.value = false;
// packtargetindex.value = 0;
tagsopen.value = false;
jishiopen.value = false;
bodytagtarget.value = {};
}
//
const secondtemp = ref([])
@ -1121,6 +1237,7 @@
const DOUBLE_TAP_DELAY = 300
const clickopenmore = () => {
cleanallopen()
openmore.value = true;
deleteshake.value = false
moreindex.value = -1;
@ -1135,7 +1252,7 @@
}
}
const doChangeNew = () => {
console.log("啥啊")
// console.log("")
let object = postitem.value;
indexsave.value = [Number(props.sendxy[0]), Number(props.sendxy[1])]
// tagName
@ -1444,8 +1561,9 @@
}
//
const ruleritem = ref({})
const editcardname = () => {
const refreshtype = ref(0)
const editcardname = (type : number) => {
refreshtype.value = type
ruleritem.value = {
directiveName: ""
}
@ -1453,6 +1571,7 @@
const packtargetindex = ref(0)
const rulerTouchClick = (item : any, index0 : number, index1 : number) => {
packtargetindex.value = 0
killbaddata.value = true
saveEditIndex.value.index0 = index0;
saveEditIndex.value.index1 = index1;
@ -1478,6 +1597,27 @@
break
}
// console.log("kankan", item.includesarray)
item.includesarray.forEach((element : any) => {
switch (element.cycleTypeId) {
case `1`:
element.newtypename = "每天"
break
case `3`:
element.newtypename = weekDays[Number(element.cycleValue)]
break
case `4`:
element.newtypename = Number(element.cycleValue) + "日"
break
case `5`:
if (element.cycleValue) {
element.newtypename = Number(element.cycleValue) + "天执行一次"
} else {
element.newtypename = "临时一次"
}
break
}
})
cleanallopen()
}
@ -1549,9 +1689,13 @@
const killjishi = () => {
killisopen.value = false;
deleteshake.value = false;
detailshake.value = false;
deleteDirective({ id: killthisid.value.id }).then((res) => {
if (res.success) {
geteverything()
setTimeout(() => {
rulerTouchClick(timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1], saveEditIndex.value.index0, saveEditIndex.value.index1)
}, 200)
}
})
}
@ -1701,16 +1845,35 @@
// console.log("",uni.getStorageSync('elderId'))
if (uni.getStorageSync('nuId') && uni.getStorageSync('elderId')) {
getNclist(uni.getStorageSync('nuId'), uni.getStorageSync('elderId')).then((res : any) => {
// console.log("",res)
// console.log("", res.result.serviceList)
timearr.value = Array.from({ length: 24 }, (_, hour) => ({
positioning: hour.toString(),
children: minuteArr.map(time => ({
tagName: time, // '00', '05'
directiveName: '' // directiveName
directiveName: '',// directiveName
includesarray: []
}))
}))
res.result.serviceList.forEach((res : any) => {
timearr.value[res.positioning].children[res.positioningLong] = res;
res.result.serviceList.reverse().forEach((item) => {
const pos = item.positioning
const long = item.positioningLong
if (timearr.value[pos].children[long].directiveName) {
timearr.value[pos].children[long].includesarray.push({
...item
})
// console.log("",timearr.value[pos].children[long].includesarray)
} else {
const clone = { ...item }
clone.includesarray = [{ ...item }]
timearr.value[pos].children[long] = clone
}
})
bottomItems.value = res.result.instantList
// console.log("zzzz",res.result.serviceList)
@ -1736,10 +1899,10 @@
}
const savePackagelist = ref([]);
onMounted(() => {
savePackagelist.value = uni.getStorageSync('Packagelist') || []
// console.log("0000", savePackagelist.value)
let res = uni.getStorageSync('saveTree0')
const init = () => {
// savePackagelist.value = uni.getStorageSync('Packagelist') || []
let res = uni.getStorageSync(`saveTree${whitchtype.value}`)
let goodArray = []
myArray.forEach((element : any) => {
element?.children.forEach((element1 : any) => {
@ -1829,6 +1992,9 @@
})
smallArray.value = data1;
}
upmenuIndex.value = 1;
downmenuIndex.value = 1;
thirdmenuIndex.value = 1;
setTimeout(() => {
upmenuIndex.value = 0;
downmenuIndex.value = 0;
@ -1839,6 +2005,11 @@
nextTick(() => {
timeNowMove()
})
}
onMounted(() => {
uni.setStorageSync('rulerbase', "care")
init()
})
const hournow = ref(new Date().getHours());
//
@ -1883,7 +2054,7 @@
}
const clicktags = () => {
if (editingmode.value) {
if (editingmode.value && !tagsopen.value) {
clickopen()
}
}
@ -2176,7 +2347,10 @@
netPreviewFileSmall: allobject.netPreviewFileSmall,
}
//
timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1] = param;
if (!cardvalue.includesarray.length) {
timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1] = param;
}
// console.log("",param)
let data = {
index0: saveEditIndex.value.index0,
@ -2196,17 +2370,43 @@
cycleTypeId: 1,
}
if (cardvalue.directiveId) {
postdata.id = cardvalue.id,
editDirective(postdata).then((res) => {
if (refreshtype.value) {
postdata.id = cardvalue.id,
editDirective(postdata).then((res) => {
if (res.success) {
geteverything()
setTimeout(() => {
rulerTouchClick(timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1], saveEditIndex.value.index0, saveEditIndex.value.index1)
}, 300)
}
})
} else {
// console.log("",cardvalue.includesarray,postdata)
// return
const exists = cardvalue.includesarray.some((element : any) => {
return element.directiveId === postdata.directiveId
})
if (exists) {
errshow.value = "请勿添加相同的服务指令"
openerror.value = true
return // return
}
addDirective(postdata).then((res) => {
if (res.success) {
geteverything()
setTimeout(() => {
rulerTouchClick(timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1], saveEditIndex.value.index0, saveEditIndex.value.index1)
}, 300)
}
})
}
} else {
console.log("测试新增")
// console.log("")
addDirective(postdata).then((res) => {
if (res.success) {
geteverything()
@ -2281,7 +2481,9 @@
const detailtarget = ref(-1)
const clickbody = (item : any, index : number) => {
if (!editingmode.value) {
cleanallopen()
if (detailtarget.value === index) {
bodytagtarget.value = {};
detailtarget.value = -1
@ -2290,6 +2492,8 @@
detailtarget.value = index
}
} else {
clicktags()
}
}
@ -2306,6 +2510,30 @@
return 79
}
}
const clicktagsopen = () => {
if (!tagsopen.value) {
cleanallopen();
tagsopen.value = true
} else {
cleanallopen();
}
}
const clickjishiopen = () => {
if (!jishiopen.value) {
cleanallopen();
jishiopen.value = true
} else {
cleanallopen();
}
}
const clickexplainopen = () => {
if (!explainopen.value) {
cleanallopen();
explainopen.value = true
} else {
cleanallopen();
}
}
</script>
<style lang="less" scoped>

View File

@ -10,9 +10,8 @@
v-show="!isemity" enable-back-to-top>
<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"
:scroll-left="v.scrollleft" @scroll="scroll">
<view class="fler-view" @touchstart="ts($event)" @touchmove="canmove($event,index)">
<view class="carditem guodu" :style="openwhitchindex === index? { transform: 'translateX(-14vw)' }: { transform: 'translateX(0)' }">
<view class="zding" v-if="v.zhiDingId">
<image src="/static/index/procurement/zd.png" mode="aspectFill"></image>
</view>
@ -87,7 +86,7 @@
<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>
</view>
<view class="zkadd guodu" :class="v.isAdd==1?'zkf':''">
<view class="zkadd guodu">
<view @click.stop="comfig(v,index,1)" @touchend.stop>
请领记录
</view>
@ -98,7 +97,8 @@
{{v.zhiDingId?'取消置顶':'置 顶'}}
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
@ -197,6 +197,22 @@
scrollLeft.value = e.detail.scrollLeft
// console.log(e.detail.scrollLeft)
}
const startX = ref(0)
const openwhitchindex = ref(-1)
const ts = (e) => {
startX.value = e.touches[0].clientX;
}
const canmove = (e : any, index : number) => {
const moveX = e.touches[0].clientX
const diff = moveX - startX.value
// diff
if (diff < -40) { // 👉 60px 便
openwhitchindex.value = index
}
if (diff > 40) { // 👉 60px 便
openwhitchindex.value = -1
}
}
</script>
<style scoped lang="less">
@ -205,9 +221,14 @@
height: 100%;
display: inline-flex;
justify-content: flex-end;
position: absolute;
top: 0;
right: -12vw;
// background-color: red;
// position: absolute;
// top: 0;
// right: -12vw;
// width: 14vw;
// height: 100%;
// display: inline-flex;
// justify-content: flex-end;
view:active {
background: rgba(85, 166, 249, 1) !important;
@ -283,9 +304,10 @@
.msitem {
width: 24vw;
height: 100%;
position: absolute;
top: 0;
left: 15vw;
margin-right: 7vw;
// position: absolute;
// top: 0;
// left: 15vw;
// background-color: blue;
.msitem-item {
@ -351,9 +373,9 @@
height: 100%;
display: inline-flex;
flex-direction: column;
position: absolute;
top: 0;
left: 0;
// position: absolute;
// top: 0;
// left: 0;
.cardp {
// position: absolute;
@ -425,6 +447,19 @@
.fler {
width: 44vw;
height: 20.5vw;
position: relative;
// background-color: red;
.fler-view {
width: 44vw;
height: 19.5vw;
background: rgba(255, 255, 255, 1);
border-radius: 1.6vw;
position: relative;
margin-bottom: 1.1vw;
overflow: hidden;
white-space: nowrap;
}
// margin-bottom: 0.9vw;
.carditem {
@ -435,9 +470,11 @@
position: relative;
margin-bottom: 1.1vw;
display: flex;
overflow: hidden;
// overflow: hidden;
justify-content: flex-start;
white-space: nowrap;
transition: transform 500ms cubic-bezier(.2, .8, .2, 1);
will-change: transform;
}
}
}

View File

@ -484,7 +484,7 @@
margin-top: 2vw;
margin-bottom: 0.8vw;
margin-left: 1.2vw;
background: red;
// background: red;
// padding: 0.2vw;
// padding: 0.5vw;
// margin: 0.7vw auto 0.3vw;

View File

@ -143,7 +143,7 @@
})
}
const tabbrarr = ref([
{ name: '护理', url: '/static/shouye/sy/n0.png', urls: '/static/shouye/sy/n1.png', type: 'kzgn_hljz' },
{ name: '服务', url: '/static/shouye/sy/n0.png', urls: '/static/shouye/sy/n1.png', type: 'kzgn_hljz' },
{ name: '医疗', url: '/static/shouye/sy/y0.png', urls: '/static/shouye/sy/y1.png', type: 'kzgn_yljz' },
{ name: '后勤', url: '/static/shouye/sy/q0.png', urls: '/static/shouye/sy/q1.png', type: 'kzgn_hqjz' },
{ name: '库房', url: '/static/shouye/sy/l0.png', urls: '/static/shouye/sy/l1.png', type: 'kzgn_kfjz' },
@ -249,7 +249,7 @@
// console.log("???????????????",res.result.records[0].permissionList)
arrlist.value = [{ name: '首页', url: '/static/shouye/sy/h0.png', urls: '/static/shouye/sy/h1.png', type: 'hldy' }];
let tbr = [];
// console.log("xxxx",arr)
// console.log("xxxx",res)
if (arr) {
arr.forEach((v, i) => {
let obj = arrs.find(item =>
@ -268,9 +268,10 @@
if (obj) {
arrlist.value.push(obj);
}
})
}
arrlist.value.push(...tabbrarr.value);
let back = [
{ name: '请领', url: '/static/shouye/sy/l0.png', urls: '/static/shouye/sy/l1.png', type: 'hldy_ql' },
{ name: '物联', url: '/static/shouye/sy/g0.png', urls: '/static/shouye/sy/g1.png', type: 'wl' },

View File

@ -30,96 +30,96 @@
// export default {
// data() {
// return {
// items: [],
// // FPS 测量
// measuring: false,
// fpsDisplay: 0,
// avgFrameMsDisplay: 0,
// // items: [],
// // // FPS 测量
// // measuring: false,
// // fpsDisplay: 0,
// // avgFrameMsDisplay: 0,
// // 内部用
// _frames: [],
// _rafId: null,
// _idleTO: null
// // // 内部用
// // _frames: [],
// // _rafId: null,
// // _idleTO: null
// }
// },
// methods: {
// generate(n) {
// // 生成带颜色的占位项(避免网络请求)
// const list = []
// for (let i = 0; i < n; i++) {
// list.push({
// id: i + 1,
// color: this._randColor()
// })
// }
// this.items = list
// // 清除测量结果
// this.fpsDisplay = 0
// this.avgFrameMsDisplay = 0
// },
// clearList() {
// this.items = []
// this.fpsDisplay = 0
// this.avgFrameMsDisplay = 0
// },
// _randColor() {
// const h = Math.floor(Math.random() * 360)
// const s = 60 + Math.floor(Math.random() * 20)
// const l = 55 + Math.floor(Math.random() * 10)
// return `hsl(${h} ${s}% ${l}%)`
// },
// // generate(n) {
// // // 生成带颜色的占位项(避免网络请求)
// // const list = []
// // for (let i = 0; i < n; i++) {
// // list.push({
// // id: i + 1,
// // color: this._randColor()
// // })
// // }
// // this.items = list
// // // 清除测量结果
// // this.fpsDisplay = 0
// // this.avgFrameMsDisplay = 0
// // },
// // clearList() {
// // this.items = []
// // this.fpsDisplay = 0
// // this.avgFrameMsDisplay = 0
// // },
// // _randColor() {
// // const h = Math.floor(Math.random() * 360)
// // const s = 60 + Math.floor(Math.random() * 20)
// // const l = 55 + Math.floor(Math.random() * 10)
// // return `hsl(${h} ${s}% ${l}%)`
// // },
// // 滚动回调(来自原生 nvue scroll-view
// onScroll(e) {
// // 每次 scroll 事件触发时重置空闲计时器
// // 开始/继续测量 FPS
// if (!this.measuring) this._startMeasure()
// clearTimeout(this._idleTO)
// this._idleTO = setTimeout(() => {
// this._stopMeasure()
// }, 300)
// },
// // // 滚动回调(来自原生 nvue scroll-view
// // onScroll(e) {
// // // 每次 scroll 事件触发时重置空闲计时器
// // // 开始/继续测量 FPS
// // if (!this.measuring) this._startMeasure()
// // clearTimeout(this._idleTO)
// // this._idleTO = setTimeout(() => {
// // this._stopMeasure()
// // }, 300)
// // },
// _startMeasure() {
// this.measuring = true
// this._frames = []
// const pushFrame = (t) => {
// this._frames.push(t)
// // 保持最近 120 帧
// if (this._frames.length > 120) this._frames.shift()
// this._rafId = requestAnimationFrame(pushFrame)
// }
// this._rafId = requestAnimationFrame(pushFrame)
// },
// // _startMeasure() {
// // this.measuring = true
// // this._frames = []
// // const pushFrame = (t) => {
// // this._frames.push(t)
// // // 保持最近 120 帧
// // if (this._frames.length > 120) this._frames.shift()
// // // this._rafId = requestAnimationFrame(pushFrame)
// // }
// // // this._rafId = requestAnimationFrame(pushFrame)0
// // },
// _stopMeasure() {
// this.measuring = false
// if (this._rafId) {
// cancelAnimationFrame(this._rafId)
// this._rafId = null
// }
// // 计算 FPS 与平均帧时长
// if (this._frames.length < 2) {
// this.fpsDisplay = 0
// this.avgFrameMsDisplay = 0
// return
// }
// const intervals = []
// for (let i = 1; i < this._frames.length; i++) {
// intervals.push(this._frames[i] - this._frames[i - 1])
// }
// const sum = intervals.reduce((a, b) => a + b, 0)
// const avg = sum / intervals.length
// const fps = 1000 / avg
// this.avgFrameMsDisplay = avg.toFixed(2)
// this.fpsDisplay = Math.round(fps)
// // _stopMeasure() {
// // this.measuring = false
// // if (this._rafId) {
// // cancelAnimationFrame(this._rafId)
// // this._rafId = null
// // }
// // // 计算 FPS 与平均帧时长
// // if (this._frames.length < 2) {
// // this.fpsDisplay = 0
// // this.avgFrameMsDisplay = 0
// // return
// // }
// // const intervals = []
// // for (let i = 1; i < this._frames.length; i++) {
// // intervals.push(this._frames[i] - this._frames[i - 1])
// // }
// // const sum = intervals.reduce((a, b) => a + b, 0)
// // const avg = sum / intervals.length
// // const fps = 1000 / avg
// // this.avgFrameMsDisplay = avg.toFixed(2)
// // this.fpsDisplay = Math.round(fps)
// }
// }
// }
</script>
<style>
/* .page {
/* .page {
flex: 1;
background-color: #f5f6fa;
}
@ -189,6 +189,7 @@
color: #666;
line-height: 32px;
}
page,
body,
.page {

View File

@ -2,7 +2,7 @@
<template>
<view>
<view class="ceshi" v-if="ceshiopen" @click="ceshiopen=false">
<!-- <image class="all-home" src="/static/ceshi6.png" mode="aspectFit"></image> -->
<image class="all-home" src="/static/ceshi7.png" mode="aspectFit"></image>
</view>
<view class="home">
<image class="all-home" src="/static/index/warehouse/newindexhome/backdro.jpg" mode="scaleToFill"></image>
@ -158,7 +158,7 @@
onShow(() => {
setTimeout(() => {
playall.value = true;
}, 2000)
}, 500)
zyupgrade.value?.check_update();
queryPadPageList().then((res => {
@ -370,10 +370,11 @@
}
const ceshijump = () => {
// ceshiopen.value = true
uni.navigateTo({
url:"/pages/login/ceshi"
})
console.log("wtf")
// console.log("wtf")
// try {
// const Intent = plus.android.importClass('android.content.Intent')
// const Uri = plus.android.importClass('android.net.Uri')

View File

@ -4,68 +4,77 @@
<view class="titletop">全部库存预警</view>
<scroll-view scroll-y="true" class="crdcroll" scroll-with-animation @scrolltolower="scrolltolower">
<view class="fler">
<scroll-view class="carditem guodu" v-for="(v,index) in InvoicingList" :key="index"
@touchend="handleTouchEnd($event,v,index)" @touchstart="touchstart($event,v,index)"
scroll-with-animation scroll-x="true" :scroll-left="v.scrollleft" @scroll="scroll($event,v)">
<view class="speitem guodu" :class="v.zk?'spleft':''">
<view class="imghs">
<image :src="v.materialImg?serverUrl+v.materialImg:'/static/index/procurement/k.png'"
mode="aspectFill">
</image>
</view>
<view class="cardp">
<view v-if="v.categoryId_dictText">{{v.categoryId_dictText}}</view>
<view v-if="v.typeId_dictText">{{v.typeId_dictText}}</view>
<view v-if="v.medicationId_dictText">{{v.medicationId_dictText}}</view>
</view>
</view>
<view class="msitem guodu">
<view>
<view>{{v.materialName}}</view><text>{{v.materialNo}}</text>
</view>
<view style="white-space: nowrap;display: block;">
<text style="white-space: nowrap;display: block;"> 规格型号: {{v.specificationModel}}</text>
</view>
<view>
<text v-if="v.multiUnitType=='1'">采购单价:111111111111111
{{v.oneUnitPrice?Number(v.oneUnitPrice).toFixed(2):""}} </text>
<text v-if="v.multiUnitType=='1'">采购单位: {{ v.oneUnit}}</text>
<text v-if="v.multiUnitType=='2'">采购单价:
{{v.twoUnitPrice?Number(v.twoUnitPrice).toFixed(2):""}} </text>
<text v-if="v.multiUnitType=='2'">采购单位: {{ v.twoUnit}}</text>
<text v-if="v.multiUnitType=='3'">采购单价:
{{v.referenceUnitPrice?Number(v.referenceUnitPrice).toFixed(2):""}} </text>
<text v-if="v.multiUnitType=='3'">采购单位: {{ v.materialUnits}}</text>
</view>
<view>
<view>
<text>{{v.kcsl}}</text>
<text>库存数量</text>
<!-- <view class="fler-view"> -->
<view class="carditem guodu" v-for="(v,index) in InvoicingList" :key="index"
@touchstart="ts($event)" @touchmove="canmove($event,index)">
<view class="guodu"
:style="openwhitchindex === index? { transform: 'translateX(-14vw)' }: { transform: 'translateX(0)' }">
<view class="speitem guodu" :class="v.zk?'spleft':''">
<view class="imghs">
<image
:src="v.materialImg?serverUrl+v.materialImg:'/static/index/procurement/k.png'"
mode="aspectFill">
</image>
</view>
<view class="cardp">
<view v-if="v.categoryId_dictText">{{v.categoryId_dictText}}</view>
<view v-if="v.typeId_dictText">{{v.typeId_dictText}}</view>
<view v-if="v.medicationId_dictText">{{v.medicationId_dictText}}</view>
</view>
</view>
<view>
<text>{{v.upperLimit}}</text>
<text>物料上限 </text>
<view class="msitem guodu">
<view>
<view>{{v.materialName}}</view><text>{{v.materialNo}}</text>
</view>
<view style="white-space: nowrap;display: block;">
<text style="white-space: nowrap;display: block;"> 规格型号:
{{v.specificationModel}}</text>
</view>
<view>
<text v-if="v.multiUnitType=='1'">采购单价:
{{v.oneUnitPrice?Number(v.oneUnitPrice).toFixed(2):""}} </text>
<text v-if="v.multiUnitType=='1'">采购单位: {{ v.oneUnit}}</text>
<text v-if="v.multiUnitType=='2'">采购单价:
{{v.twoUnitPrice?Number(v.twoUnitPrice).toFixed(2):""}} </text>
<text v-if="v.multiUnitType=='2'">采购单位: {{ v.twoUnit}}</text>
<text v-if="v.multiUnitType=='3'">采购单价:
{{v.referenceUnitPrice?Number(v.referenceUnitPrice).toFixed(2):""}} </text>
<text v-if="v.multiUnitType=='3'">采购单位: {{ v.materialUnits}}</text>
</view>
<view>
<view>
<text>{{v.kcsl}}</text>
<text>库存数量</text>
</view>
<view>
<text>{{v.upperLimit}}</text>
<text>物料上限 </text>
</view>
<view>
<text>{{v.lowerLimit}}</text>
<text> 物料下限</text>
</view>
</view>
</view>
<view>
<text>{{v.lowerLimit}}</text>
<text> 物料下限</text>
<view class="add" @click.stop="clkzk(v,index)">
<view v-if="v.isAdd==1">已添加</view>
<image class="guodu" :style="openwhitchindex === index?'transform: rotate(180deg);':''"
:src="'/static/index/procurement/l.png'" mode="aspectFill"></image>
</view>
<view class="zkadd guodu" >
<view @click.stop="crk(v,index)" @touchend.stop>出入库</view>
<view @click.stop="addcar(v)" v-if="v.isAdd!=1" @touchend.stop>
<view>
加购物车
</view>
</view>
</view>
</view>
</view>
<view class="add" @click.stop="clkzk(v,index)">
<view v-if="v.isAdd==1">已添加</view>
<image class="guodu" :style="v.zk?'transform: rotate(180deg);':''"
:src="'/static/index/procurement/l.png'" mode="aspectFill"></image>
</view>
<view class="zkadd guodu" :class="v.isAdd==1?'zkf':''">
<view @click.stop="crk(v,index)" @touchend.stop>出入库</view>
<view @click.stop="addcar(v)" v-if="v.isAdd!=1" @touchend.stop>
<view>
加购物车
</view>
</view>
</view>
</scroll-view>
<!-- </view> -->
</view>
<view style="height:3vw;width: 100%;display: flex;align-items: center;justify-content: center;">
<u-loadmore :status="status" :loadText="{nomore:'暂无更多数据'}" v-if="InvoicingList.length>6" />
@ -76,7 +85,7 @@
</template>
<script setup lang="ts">
import { ref, onMounted, reactive, onBeforeUnmount, computed, nextTick, defineComponent } from 'vue';
import { ref, onMounted, reactive, onBeforeUnmount, computed, nextTick, defineComponent,watch } from 'vue';
import { queryInvoicingList, queryWlInfoByWlId, addShoppingCartList, queryShoppingCartList } from '../api/lunpan.js'
const props = defineProps({
InvoicingList: {
@ -92,6 +101,13 @@
required: true,
},
})
watch(
() => props.show,
() => {
if (props.show == false) {
openwhitchindex.value = -1
}
})
const emit = defineEmits(['addcartory', 'tolower', 'solleft', 'crk'])
const serverUrl = ref('')
onMounted(() => {
@ -103,18 +119,19 @@
}
const caigouobj = ref({})
const clkzk = (v : any, i : number) => {
caigouobj.value = v;
caigouobj.value.Limitnum = Number(caigouobj.value?.upperLimit) - Number(caigouobj.value.kcsl);
caigouobj.value.index = i;
caigouobj.value.yj = true;
if (v.zk == true) {
v.zk = false;
v.scrollleft = 0
} else {
v.zk = true;
v.scrollleft = 170;
}
solleft(v, i)
openwhitchindex.value = openwhitchindex.value === i ? -1 : i;
// caigouobj.value = v;
// caigouobj.value.Limitnum = Number(caigouobj.value?.upperLimit) - Number(caigouobj.value.kcsl);
// caigouobj.value.index = i;
// caigouobj.value.yj = true;
// if (v.zk == true) {
// v.zk = false;
// v.scrollleft = 0
// } else {
// v.zk = true;
// v.scrollleft = 170;
// }
// solleft(v, i)
}
const addcar = (v : any) => {
emit('addcartory', caigouobj.value)
@ -170,6 +187,29 @@
const crk = (v, i) => {
emit('crk', v, i)
}
const startX = ref(0)
const openwhitchindex = ref(-1)
const ts = (e) => {
startX.value = e.touches[0].clientX;
}
const canmove = (e : any, index : number) => {
const moveX = e.touches[0].clientX
const diff = moveX - startX.value
// diff
if (diff < -40) { // 👉 60px 便
openwhitchindex.value = index
}
if (diff > 40) { // 👉 60px 便
openwhitchindex.value = -1
}
}
const openmore = (index:number) => {
if(openwhitchindex.value==-1){
openwhitchindex.value = index
}else{
openwhitchindex.value = -1
}
}
</script>
<style scoped lang="less">
@ -177,23 +217,27 @@
width: 46.9vw;
height: 14.5vw;
background: rgba(255, 255, 255, 1);
border: 1rpx solid #D2D2D2;
border: 1px solid #D9DADC;
border-radius: 1.6vw;
position: relative;
margin-bottom: 1.1vw;
margin-bottom: 0.8vw;
display: flex;
overflow: hidden;
justify-content: flex-start;
white-space: nowrap;
.zkadd {
width: 14vw;
min-width: 14vw;
height: 100%;
display: inline-flex;
display: flex;
justify-content: flex-end;
// background-color: red;
position: absolute;
top: 0;
right: -14vw;
// position: absolute;
// top: 0;
// right: -14vw;
>view {
width: 7vw;
@ -225,6 +269,7 @@
&:nth-child(1) {
background: #e3e5e7;
color: #555555;
}
}
}
@ -242,6 +287,7 @@
align-items: center;
position: relative;
top: -2vw;
margin-right: 1vw;
>view {
width: 4.5vw;
@ -347,12 +393,12 @@
&:nth-child(2) {
text{
text {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
&:nth-child(1) {
@ -424,6 +470,7 @@
line-height: 1.8vw;
text-align: center;
}
&:nth-child(3) {
max-width: 11.5vw;
padding: 0 0.8vw;
@ -461,6 +508,21 @@
.fler {
display: grid;
grid-template-columns: 1fr;
position: relative;
width: 100%;
height: 100%;
// .fler-view {
// width: 100%;
// height: 100%;
// border-radius: 1.6vw;
// position: relative;
// margin-bottom: 1.1vw;
// // overflow: hidden;
// white-space: nowrap;
// // background: #fff;
// // border: 1px solid #D9DADC;
// }
}
}
@ -493,4 +555,5 @@
-webkit-transform-style: preserve-3d;
-webkit-overflow-scrolling: touch;
}
</style>

View File

@ -154,7 +154,7 @@
watch(
() => props.show,
() => {
console.log(props.caigouobj)
// console.log(props.caigouobj)
if (props.show) {
let a = [
{
@ -197,7 +197,7 @@
let n = [];
let id = [];
gysarr.value = [];
console.log("为啥报错", props.caigouobj)
// console.log("", props.caigouobj)
n = props.caigouobj.suppliers_dictText?.split(/[, ]+/);
id = props.caigouobj.suppliers?.split(/[, ]+/);
n.forEach((item, i) => {

View File

@ -2,6 +2,529 @@
<view>
<scroll-view scroll-y="true" class="crdcroll" scroll-with-animation @scrolltolower="scrolltolower()"
:enhanced="true" :bounce="true" enable-back-to-top>
<view class="box">
<view class="fler" v-for="(v,index) in InvoicingList" :key="index">
<view class="fler-view" @touchstart="ts($event)" @touchmove="canmove($event,index)">
<!-- @touchend="handleTouchEnd($event,v,index)"
@touchstart="touchstart($event,v,index)" scroll-with-animation scroll-x="true"
:scroll-left="v.scrollleft" @scroll="scroll" -->
<view class="carditem guodu"
:style="openwhitchindex === index? { transform: 'translateX(-14vw)' }: { transform: 'translateX(0)' }">
<view class="speitem guodu">
<view class="imghs">
<image style="border-radius: 1vw;"
:src="v.materialImg?serverUrl+v.materialImg:'/static/index/procurement/k.png'"
mode="aspectFill">
</image>
</view>
<view class="cardp">
<view v-if="v.categoryId_dictText">{{v.categoryId_dictText}}</view>
<view v-if="v.typeId_dictText">{{v.typeId_dictText}}</view>
<view v-if="v.medicationId_dictText">{{v.medicationId_dictText}}</view>
</view>
</view>
<view class="msitem guodu">
<view>
<view>{{v.materialName}}</view>
</view>
<view style="margin-top: 1vw;">
<text style="white-space: nowrap;"> 物料编码: {{v.materialNo}}</text>
</view>
<view>
<text style="white-space: nowrap;"> 规格型号: {{v.specificationModel}}</text>
</view>
<view>
<text v-if="v.multiUnitType=='1'">采购单价: {{Number(v.oneUnitPrice).toFixed(2) }}
</text>
<text v-if="v.multiUnitType=='2'">采购单价: {{Number(v.twoUnitPrice).toFixed(2) }}
</text>
<text v-if="v.multiUnitType=='3'">采购单价:
{{ Number(v.referenceUnitPrice).toFixed(2)}}
</text>
</view>
<view>
<text v-if="v.multiUnitType=='1'">采购单位: {{ v.oneUnit}}</text>
<text v-if="v.multiUnitType=='2'">采购单位: {{ v.twoUnit}}</text>
<text v-if="v.multiUnitType=='3'">采购单位: {{ v.materialUnits}}</text>
</view>
<view class="wlsy">
<view>
<text>{{v.kcsl}}</text>
<text>库存数量</text>
</view>
<view>
<text>{{v.upperLimit}}</text>
<text>物料上限 </text>
</view>
<view>
<text>{{v.lowerLimit}}</text>
<text> 物料下限</text>
</view>
</view>
</view>
<view class="add" @click.stop="addcar(v,index)">
<view v-if="v.isAdd==1">已添加</view>
<image :src="'/static/index/procurement/+.png'" mode="aspectFill"></image>
</view>
<view class="zkadd guodu" :class="v.isAdd==1?'':''">
<view v-if="v.isAdd==1">
</view>
<view class="zkadd-white" @click.stop="crk(v,index)" @touchend.stop>出入库</view>
<view class="zkadd-blue" @click.stop="addcar(v,index)" v-if="v.isAdd!=1" @touchend.stop>
<view>
加购物车
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view style="height:3vw;width: 100%;display: flex;align-items: center;justify-content: center;">
<u-loadmore :status="status" :loadText="{nomore:'暂无更多数据'}" v-if="InvoicingList.length>6" />
</view>
</scroll-view>
</view>
</template>
<script setup lang="ts">
import { ref, onMounted, reactive, onBeforeUnmount, computed, nextTick, defineComponent } from 'vue';
const props = defineProps({
InvoicingList: {
type: Array
},
status: {
type: String
},
show: {
type: Boolean,
default: false
},
})
const emit = defineEmits(['addcartory', 'scrolltolower', 'addcar', 'crk'])
const serverUrl = ref('')
onMounted(() => {
serverUrl.value = uni.getStorageSync('serverUrl') + '/sys/common/static/';
// setTimeout(()=>{
// console.log(serverUrl.value+props.InvoicingList[0].materialImg)
// },3000)
})
const caigouobj = ref({})
const addcar = (v : any, i : number) => {
// console.log("",i)
if (Number(v.kcsl) >= Number(v.upperLimit)) {
uni.showToast({
title: '库存数量已满,不可添加购物车!',
icon: 'none'
})
return
}
caigouobj.value = v;
caigouobj.value.index = i;
caigouobj.value.yj = false;
emit('addcartory', caigouobj.value)
}
// const pageX = ref(0);
// const pageY = ref(0);
// const touchstart = (event : any, v : any, i : number) => {
// pageX.value = event.changedTouches[0].pageX;
// pageY.value = event.changedTouches[0].pageY;
// solleft(v, i)
// }
// 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)
// let absy = Math.abs(y - pageY.value)
// if (absy > 30 && absx + 10 < absy) {
// v.scrollleft = 1
// setTimeout(() => {
// v.scrollleft = 0
// }, 20)
// return
// }
// if (absx < 10 && absy < 10) {
// if (v.zk == false) {
// setTimeout(() => {
// v.scrollleft = 0
// }, 20)
// }
// console.log("2")
// return
// }
// caigouobj.value = v;
// caigouobj.value.Limitnum = Number(caigouobj.value?.upperLimit) - Number(caigouobj.value.kcsl);
// caigouobj.value.index = i;
// caigouobj.value.yj = false;
// v.zk = x > pageX.value ? false : true;
// v.scrollleft = v.zk ? 150 : 0;
// }
// const solleft = (v : any, i : number) => {
// props.InvoicingList.forEach((item, k) => {
// if (k != i && item.zk == true) {
// item.zk = false;
// item.scrollleft = 0;
// }
// })
// }
const scrolltolower = () => {
emit('scrolltolower')
}
// const scrollLeft = ref(0)
// const scroll = (e) => {
// // scrollLeft.value = e.detail.scrollLeft
// // console.log(e.detail.scrollLeft)
// }
const crk = (v, i) => {
emit('crk', v, i)
}
const startX = ref(0)
const openwhitchindex = ref(-1)
const ts = (e) => {
startX.value = e.touches[0].clientX;
}
const canmove = (e : any, index : number) => {
const moveX = e.touches[0].clientX
const diff = moveX - startX.value
// diff
if (diff < -40) { // 👉 60px 便
openwhitchindex.value = index
}
if (diff > 40) { // 👉 60px 便
openwhitchindex.value = -1
}
}
</script>
<style scoped lang="less">
.crdcroll {
width: 90vw;
height: 64.5vh;
.box {
width: 90vw;
display: grid;
grid-template-columns: 1fr 1fr;
}
.fler {
width: 44vw;
height: 20.5vw;
position: relative;
// background-color: red;
.fler-view {
width: 44vw;
height: 19.5vw;
background: rgba(255, 255, 255, 1);
border-radius: 1.6vw;
position: relative;
margin-bottom: 1.1vw;
overflow: hidden;
white-space: nowrap;
}
}
}
.carditem {
position: absolute;
top: 0;
left: 0;
height: 100%;
display: flex;
transition: transform 500ms cubic-bezier(.2, .8, .2, 1);
will-change: transform;
.zkadd {
width: 14vw;
height: 100%;
display: inline-flex;
justify-content: flex-end;
// background-color: blue;
// position: absolute;
// top: 0;
// right: -14vw;
>view {
width: 5.7vw;
height: 100%;
font-weight: 400;
font-size: 1.5vw;
display: flex;
justify-content: center;
align-items: center;
writing-mode: vertical-rl;
text-orientation: upright;
text-align: center;
}
.zkadd-blue {
background: #1083F8;
color: #fff;
view {
width: 3.8vw;
height: 3.8vw;
display: flex;
justify-content: center;
align-items: center;
margin-top: -0.7vw;
}
}
.zkadd-white {
background: #e3e5e7;
color: #555555;
}
}
.zkf {
width: 7vw;
right: -7vw;
}
.add {
width: 4.5vw;
height: 100%;
position: absolute;
display: flex;
justify-content: center;
align-items: center;
top: 50%;
transform: translateY(-50%);
// top: 0.8vw;
right: 16vw;
// background-color: red;
>view {
width: 5.5vw;
height: 2.2vw;
background: #fff;
border-radius: 0.9vw;
border: 1px solid #1083F8;
font-weight: 400;
font-size: 1.4vw;
color: #1083F8;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 2.3vw;
right: 0.8vw;
}
image {
width: 2.5vw;
height: 2.5vw;
}
}
.msitem {
min-width: 25vw;
height: 100%;
padding: 1vw;
// background-color: red;
margin-right: 4.2vw;
// position: absolute;
// left: 15vw;
// top: 0;
>view {
&:nth-child(2),
&:nth-child(3),
&:nth-child(4),
&:nth-child(5) {
margin-top: 0.25vw;
max-width: 25vw;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
text {
font-weight: 400;
font-size: 1.3vw;
color: #777777;
margin-top: 0.25vw;
}
}
&:nth-child(1) {
display: flex;
justify-content: space-between;
align-items: center;
height: 2vw;
margin-top: 1vw;
>view {
width: 19vw;
height: 2vw;
font-weight: bold;
font-size: 1.8vw;
color: #222222;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
text {
width: 6vw;
font-weight: 300;
font-size: 1.4vw;
color: #222222;
}
}
}
>.wlsy {
width: 100%;
height: 3.4vw;
display: flex;
justify-content: space-between;
margin-top: 0vw;
>view {
width: 33.3%;
height: 100%;
display: flex;
flex-direction: column;
position: relative;
margin-top: 1vw;
&:nth-child(1) {
width: 30%;
align-items: left;
}
&:nth-child(2) {
width: 40%;
align-items: center;
}
&:nth-child(3) {
width: 30%;
text-align: right;
align-items: right;
}
&:nth-child(2)::after {
content: '';
position: absolute;
right: 0;
width: 100%;
height: 2.2vw;
border-left: 1px solid #C9C9C9;
border-right: 1px solid #C9C9C9;
top: 0.6vw;
}
text {
&:nth-child(1) {
font-weight: bold;
font-size: 1.8vw;
color: #555555;
}
&:nth-child(2) {
font-weight: 400;
font-size: 1.2vw;
color: #999999;
}
}
}
}
}
// .spleft{
// margin-left: -15vw !important;
// }
.speitem {
min-width: 14.8vw;
height: 100%;
// position: absolute;
display: flex;
flex-direction: column;
// top: 0;
// left: 0;
justify-content: center;
align-items: center;
.cardp {
width: 12.5vw;
height: 4vw;
display: flex;
flex-wrap: wrap;
margin: 0 auto;
align-items: center;
margin-top: -1vw;
view {
min-width: 5.5vw;
height: 1.8vw;
border-radius: 0.9vw;
border: 1px solid #D2D2D2;
margin: 0.5vw 0 0 0.5vw;
display: flex;
justify-content: center;
align-items: center;
font-weight: 400;
font-size: 1vw;
color: #555555;
padding: 0 0.25vw;
&:nth-child(1),
&:nth-child(2) {
max-width: 6vw;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: block;
line-height: 1.8vw;
text-align: center;
}
&:nth-child(3) {
max-width: 11.5vw;
padding: 0 0.8vw;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: block;
line-height: 1.8vw;
text-align: center;
}
}
}
.imghs {
width: 12vw;
height: 12vw;
margin: 0vw auto 0.25vw;
padding: 0.2vw;
padding-top: 0;
background: #fff;
border-radius: 1.1vw;
>image {
margin-top: -0.6vw;
width: 100%;
height: 100%;
border-radius: 1.1vw;
}
}
}
}
</style>
<!-- <template>
<view>
<scroll-view scroll-y="true" class="crdcroll" scroll-with-animation @scrolltolower="scrolltolower()"
enable-back-to-top>
<view class="box">
<view class="fler" v-for="(v,index) in InvoicingList" :key="index">
<scroll-view class="carditem guodu" @touchend="handleTouchEnd($event,v,index)"
@ -483,4 +1006,4 @@
}
}
</style>
</style> -->

View File

@ -5,99 +5,106 @@
enable-back-to-top>
<view class="box">
<view class="fler" v-for="(v,index) in InvoicingList" :key="index" @click="v.flag=!v.flag">
<view class="jiao guodu">
<image :src="v.flag?'/static/index/procurement/lxz.png':'/static/index/procurement/jxz.png'"
mode="aspectFill" class="jao guodu"></image>
<image src="/static/index/procurement/dh.png" mode="aspectFill" class="dui"></image>
</view>
<scroll-view class="carditem guodu " @touchend="handleTouchEnd($event,v,index)"
<view class="fler-view" @touchstart="ts($event)" @touchmove="canmove($event,index)" :class="v.flag?'actve':''">
<view class="jiao guodu">
<image :src="v.flag?'/static/index/procurement/lxz.png':'/static/index/procurement/jxz.png'"
mode="aspectFill" class="jao guodu"></image>
<image src="/static/index/procurement/dh.png" mode="aspectFill" class="dui"></image>
</view>
<view class="carditem guodu "
:style="openwhitchindex === index? { transform: 'translateX(-16vw)' }: { transform: 'translateX(0)' }"
>
<!-- @touchend="handleTouchEnd($event,v,index)"
@touchstart="touchstart($event,v,index)" scroll-with-animation scroll-x="true"
:scroll-left="v.scrollleft" @scroll="scroll" :class="v.flag?'actve':''">
<view class="speitem guodu">
<view class="imghs">
<image style="border-radius: 1vw;"
:src="v.materialImg?serverUrl+v.materialImg:'/static/index/procurement/k.png'"
mode="aspectFill">
</image>
</view>
<view class="cardp">
<view v-if="v.categoryId_dictText">{{v.categoryId_dictText}}</view>
<view v-if="v.typeId_dictText">{{v.typeId_dictText}}</view>
<view v-if="v.medicationId_dictText">{{v.medicationId_dictText}}</view>
</view>
</view>
<view class="msitem guodu">
<view>
<view>{{v.wlName}}</view>
</view>
<!-- <text>{{v.wlMaterialNo}}</text> -->
<view>
<text style="white-space: nowrap;"> 规格编号: {{v.wlMaterialNo}}</text>
</view>
<view>
<text style="white-space: nowrap;"> 规格型号: {{v.wlSpecificationModel}}</text>
</view>
<view>
<text v-if="v.wlUnits == v.materialUnits">采购单价:
{{Number(v.unitPrice).toFixed(2) }}</text>
<text v-if="v.wlUnits == v.twoUnit">采购单价: {{Number(v.twoUnitPrice).toFixed(2) }}</text>
<text v-if="v.wlUnits == v.oneUnit">采购单价: {{Number(v.oneUnitPrice).toFixed(2) }}</text>
</view>
<view>
<text>采购单位: {{v.wlUnits}}</text>
</view>
<view style="margin-bottom: 0;">
<!-- <text>供应商: {{v.suppliersName}}</text> -->
</view>
<view>
<view class="three-one">
<text style="margin-left: 42rpx;">{{v.kcsl?v.kcsl:'0'}}</text>
<text>库存数量</text>
<view class="three-shu">
</view>
:scroll-left="v.scrollleft" @scroll="scroll" -->
<view class="speitem guodu">
<view class="imghs">
<image style="border-radius: 1vw;"
:src="v.materialImg?serverUrl+v.materialImg:'/static/index/procurement/k.png'"
mode="aspectFill">
</image>
</view>
<view class="three-one">
<text style="text-align: center;">{{v.wlUpperLimit}}</text>
<text>物料上限 </text>
<view class="three-shu">
</view>
</view>
<view class="three-one">
<text style="text-align: end;margin-right: 20rpx;">{{v.wlLowerLimit}}</text>
<text> 物料下限</text>
<view class="cardp">
<view v-if="v.categoryId_dictText">{{v.categoryId_dictText}}</view>
<view v-if="v.typeId_dictText">{{v.typeId_dictText}}</view>
<view v-if="v.medicationId_dictText">{{v.medicationId_dictText}}</view>
</view>
</view>
<view class="gongyingshang">
供应商: {{v.suppliersName}}
</view>
<!-- 供应商: {{v.suppliersName}} -->
</view>
<view class="add" @click.stop="clkzk(v,index)">
<image class="guodu" :style="v.zk?'transform: rotate(180deg);':''"
:src="'/static/index/procurement/l.png'" mode="aspectFill"></image>
</view>
<view class="right-top">
<view style="font-size: 1.7vw;font-weight: 600;">
{{v.purchaseQuantity}}
</view>
<view style="font-size: 1.3vw;">
采购数量
</view>
</view>
<view class="zkadd guodu" :class="v.isAdd==1?'zkf':''">
<view @click.stop="addcar(v,index)" @touchend.stop>编辑</view>
<view @click.stop="del(v,index)" v-if="v.isAdd!=1" @touchend.stop>
<view class="msitem guodu">
<view>
删除
<view>{{v.wlName}}</view>
</view>
<!-- <text>{{v.wlMaterialNo}}</text> -->
<view>
<text style="white-space: nowrap;"> 规格编号: {{v.wlMaterialNo}}</text>
</view>
<view>
<text style="white-space: nowrap;"> 规格型号: {{v.wlSpecificationModel}}</text>
</view>
<view>
<text v-if="v.wlUnits == v.materialUnits">采购单价:
{{Number(v.unitPrice).toFixed(2) }}</text>
<text v-if="v.wlUnits == v.twoUnit">采购单价:
{{Number(v.twoUnitPrice).toFixed(2) }}</text>
<text v-if="v.wlUnits == v.oneUnit">采购单价:
{{Number(v.oneUnitPrice).toFixed(2) }}</text>
</view>
<view>
<text>采购单位: {{v.wlUnits}}</text>
</view>
<view style="margin-bottom: 0;">
<!-- <text>供应商: {{v.suppliersName}}</text> -->
</view>
<view>
<view class="three-one">
<text style="margin-left: 42rpx;">{{v.kcsl?v.kcsl:'0'}}</text>
<text>库存数量</text>
<view class="three-shu">
</view>
</view>
<view class="three-one">
<text style="text-align: center;">{{v.wlUpperLimit}}</text>
<text>物料上限 </text>
<view class="three-shu">
</view>
</view>
<view class="three-one">
<text style="text-align: end;margin-right: 20rpx;">{{v.wlLowerLimit}}</text>
<text> 物料下限</text>
</view>
</view>
<view class="gongyingshang">
供应商: {{v.suppliersName}}
</view>
<!-- 供应商: {{v.suppliersName}} -->
</view>
<view class="add" @click.stop="clkzk(v,index)">
<image class="guodu" :style="openwhitchindex === index?'transform: rotate(180deg);':''"
:src="'/static/index/procurement/l.png'" mode="aspectFill"></image>
</view>
<view class="right-top">
<view style="font-size: 1.7vw;font-weight: 600;">
{{v.purchaseQuantity}}
</view>
<view style="font-size: 1.3vw;">
采购数量
</view>
</view>
<view class="zkadd guodu" >
<view @click.stop="addcar(v,index)" @touchend.stop>编辑</view>
<view @click.stop="del(v,index)" v-if="v.isAdd!=1" @touchend.stop>
<view>
删除
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
<view style="height:3vw;width: 100%;display: flex;align-items: center;justify-content: center;"
@ -139,15 +146,19 @@
}
const caigouobj = ref({})
const clkzk = (v : any, i : number) => {
openwhitchindex.value = openwhitchindex.value === i ? -1 : i;
if (v.zk == true) {
v.zk = false;
v.scrollleft = 0
} else {
v.zk = true;
v.scrollleft = 150;
}
solleft(v, i)
// if (v.zk == true) {
// v.zk = false;
// v.scrollleft = 0
// } else {
// v.zk = true;
// v.scrollleft = 150;
// }
// solleft(v, i)
}
const pageX = ref(0);
@ -202,6 +213,22 @@
// scrollLeft.value = e.detail.scrollLeft
// console.log(e.detail.scrollLeft)
}
const startX = ref(0)
const openwhitchindex = ref(-1)
const ts = (e) => {
startX.value = e.touches[0].clientX;
}
const canmove = (e : any, index : number) => {
const moveX = e.touches[0].clientX
const diff = moveX - startX.value
// diff
if (diff < -40) { // 👉 60px 便
openwhitchindex.value = index
}
if (diff > 40) { // 👉 60px 便
openwhitchindex.value = -1
}
}
</script>
<style scoped lang="less">
@ -226,8 +253,21 @@
// background-color: red;
margin-right: 0.7vw;
border: 2px solid rgba(245, 246, 248, 1);
// border: 2px solid rgba(245, 246, 248, 1);
position: relative;
// background-color: red;
.fler-view {
width: 44.3vw;
height: 27.3vw;
background: rgba(255, 255, 255, 1);
border-radius: 1.6vw;
position: relative;
margin-bottom: 1.1vw;
overflow: hidden;
white-space: nowrap;
border: 1px solid rgba(245, 246, 248, 1);
}
.jiao {
width: 3.4vw;
@ -259,7 +299,7 @@
}
.actve {
border: 2rpx solid #3BA1FF !important;
border: 1px solid #3BA1FF !important;
}
.carditem {
@ -268,20 +308,18 @@
background: #fff;
position: relative;
display: flex;
overflow: hidden;
white-space: nowrap;
border-radius: 1.6vw;
border: 2px solid rgba(245, 246, 248, 1);
.zkadd {
width: 10vw;
height: 100%;
display: inline-flex;
height: 103%;
display: flex;
justify-content: flex-end;
position: absolute;
top: 0;
right: -14vw;
right: -16.6vw;
// background-color: red;
>view {
width: 7vw;
@ -487,24 +525,31 @@
.gongyingshang {
margin-top: -10rpx;
width: 500rpx; /* 你原来的宽度 */
font-size: 1.4vw; /* 建议不要用 vw 混用 */
line-height: 1.2; /* 行高(数字形式也可以),用于计算 */
color: #a9a9a9;
font-weight: 400;
/* 多行省略核心 */
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis; /* 单行兼容项 */
/* 兼容与保底 */
word-break: break-word;
white-space: normal; /* 确保允许换行 */
min-width: 0; /* 如果父容器是 flex 必需 */
max-height: calc(1.4 * 2 * 1em); /* 额外保底(可选) */
width: 500rpx;
/* 你原来的宽度 */
font-size: 1.4vw;
/* 建议不要用 vw 混用 */
line-height: 1.2;
/* 行高(数字形式也可以),用于计算 */
color: #a9a9a9;
font-weight: 400;
/* 多行省略核心 */
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
/* 单行兼容项 */
/* 兼容与保底 */
word-break: break-word;
white-space: normal;
/* 确保允许换行 */
min-width: 0;
/* 如果父容器是 flex 必需 */
max-height: calc(1.4 * 2 * 1em);
/* 额外保底(可选) */
}
.speitem {
@ -514,7 +559,7 @@
flex-direction: column;
// justify-content: center;
position: relative;
top: -8.2vw;
top: 2.5vw;
// background-color: red;
.cardp {

View File

@ -4,64 +4,68 @@
<view class="titletop">详情</view>
<view scroll-y="true" class="crdcroll" scroll-with-animation @scrolltolower="scrolltolower">
<view class="fler">
<scroll-view class="carditem guodu" v-for="(v,index) in InvoicingList" :key="index"
@touchend="handleTouchEnd($event,v,index)" @touchstart="touchstart($event,v,index)"
scroll-with-animation scroll-x="true" :scroll-left="v.scrollleft">
<view class="speitem guodu" :class="v.zk?'spleft':''">
<image :src="v.materialImg?serverUrl+v.materialImg:'/static/index/procurement/k.png'"
mode="aspectFill"></image>
<view class="cardp">
<view v-if="v.categoryId_dictText">{{v.categoryId_dictText}}</view>
<view v-if="v.typeId_dictText">{{v.typeId_dictText}}</view>
<view v-if="v.medicationId_dictText">{{v.medicationId_dictText}}</view>
<view class="fler-view" @touchstart="ts($event)" @touchmove="canmove($event,0)">
<view class="carditem guodu"
:style="openwhitchindex === index? { transform: 'translateX(-14vw)' }: { transform: 'translateX(0)' }"
v-for="(v,index) in InvoicingList" :key="index">
<view class="speitem guodu" :class="v.zk?'spleft':''">
<image :src="v.materialImg?serverUrl+v.materialImg:'/static/index/procurement/k.png'"
mode="aspectFill"></image>
<view class="cardp">
<view v-if="v.categoryId_dictText">{{v.categoryId_dictText}}</view>
<view v-if="v.typeId_dictText">{{v.typeId_dictText}}</view>
<view v-if="v.medicationId_dictText">{{v.medicationId_dictText}}</view>
</view>
</view>
</view>
<view class="msitem guodu">
<view>
<view>{{v.materialName}}</view><text>{{v.materialNo}}</text>
</view>
<view>
<text style="white-space: nowrap;"> 规格型号:
{{v.specificationModel}}</text>
</view>
<view>
<text v-if="v.multiUnitType=='1'">采购单价: {{Number(v.oneUnitPrice).toFixed(2)}} </text>
<text v-if="v.multiUnitType=='1'">采购单位: {{ v.oneUnit}}</text>
<text v-if="v.multiUnitType=='2'">采购单价: {{Number(v.twoUnitPrice).toFixed(2)}} </text>
<text v-if="v.multiUnitType=='2'">采购单位: {{ v.twoUnit}}</text>
<text v-if="v.multiUnitType=='3'">采购单价: {{Number(v.referenceUnitPrice).toFixed(2)}}
</text>
<text v-if="v.multiUnitType=='3'">采购单位: {{ v.materialUnits}}</text>
</view>
<view>
<view class="msitem guodu">
<view>
<text>{{v.kcsl}}</text>
<text>库存数量</text>
<view>{{v.materialName}}</view><text>{{v.materialNo}}</text>
</view>
<view>
<text>{{v.upperLimit}}</text>
<text>物料上限 </text>
<text style="white-space: nowrap;"> 规格型号:
{{v.specificationModel}}</text>
</view>
<view>
<text>{{v.lowerLimit}}</text>
<text> 物料下限</text>
<text v-if="v.multiUnitType=='1'">采购单价: {{Number(v.oneUnitPrice).toFixed(2)}}
</text>
<text v-if="v.multiUnitType=='1'">采购单位: {{ v.oneUnit}}</text>
<text v-if="v.multiUnitType=='2'">采购单价: {{Number(v.twoUnitPrice).toFixed(2)}}
</text>
<text v-if="v.multiUnitType=='2'">采购单位: {{ v.twoUnit}}</text>
<text v-if="v.multiUnitType=='3'">采购单价: {{Number(v.referenceUnitPrice).toFixed(2)}}
</text>
<text v-if="v.multiUnitType=='3'">采购单位: {{ v.materialUnits}}</text>
</view>
<view>
<view>
<text>{{v.kcsl}}</text>
<text>库存数量</text>
</view>
<view>
<text>{{v.upperLimit}}</text>
<text>物料上限 </text>
</view>
<view>
<text>{{v.lowerLimit}}</text>
<text> 物料下限</text>
</view>
</view>
</view>
<view class="add" @click.stop="clkzk(v,index)">
<view v-if="v.isAdd==1">已添加</view>
<image class="guodu" :style="openwhitchindex === index?'transform: rotate(180deg);':''"
:src="'/static/index/procurement/l.png'" mode="aspectFill" @click="openmore(index)"></image>
</view>
<view class="zkadd guodu">
<view :style="v.isAdd==1?{marginLeft:`7vw`}:{}" @click.stop="crk(v,index)" @touchend.stop>出入库</view>
<view @click.stop="addcar(v)" v-if="v.isAdd!=1" @touchend.stop>
<view>
加购物车
</view>
</view>
</view>
</view>
<view class="add" @click.stop="clkzk(v,index)">
<view v-if="v.isAdd==1">已添加</view>
<image class="guodu" :style="v.zk?'transform: rotate(180deg);':''"
:src="'/static/index/procurement/l.png'" mode="aspectFill"></image>
</view>
<view class="zkadd guodu" :class="v.isAdd==1?'zkf':''">
<view @click.stop="crk(v,index)" @touchend.stop>出入库</view>
<view @click.stop="addcar(v)" v-if="v.isAdd!=1" @touchend.stop>
<view>
加购物车
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
@ -90,6 +94,7 @@
() => {
if (props.show == false) {
props.InvoicingList[0].scrollleft = 0;
openwhitchindex.value = -1
}
})
const emit = defineEmits(['addcartory', 'tolower', 'solleft', 'crk'])
@ -165,34 +170,52 @@
}
})
}
// const scrollLeft = ref(0)
// const scroll = (e)=>{
// scrollLeft.value = e.detail.scrollLeft
// // console.log(e.detail.scrollLeft)
// }
const startX = ref(0)
const openwhitchindex = ref(-1)
const ts = (e) => {
startX.value = e.touches[0].clientX;
}
const canmove = (e : any, index : number) => {
const moveX = e.touches[0].clientX
const diff = moveX - startX.value
// diff
if (diff < -40) { // 👉 60px 便
openwhitchindex.value = index
}
if (diff > 40) { // 👉 60px 便
openwhitchindex.value = -1
}
}
const openmore = (index:number) => {
if(openwhitchindex.value==-1){
openwhitchindex.value = index
}else{
openwhitchindex.value = -1
}
}
</script>
<style scoped lang="less">
.carditem {
width: 44.8vw;
height: 14.5vw;
background: #fff;
border: 1px solid #D9DADC;
border-radius: 1.6vw;
position: relative;
margin-bottom: 1.1vw;
display: flex;
overflow: hidden;
// overflow: hidden;
justify-content: flex-start;
white-space: nowrap;
.zkadd {
width: 14vw;
min-width: 14vw;
height: 100%;
display: inline-flex;
justify-content: flex-end;
display: flex;
// background-color: red;
position: absolute;
top: 0;
right: 0;
right: -14vw;
>view {
@ -241,8 +264,10 @@
justify-content: center;
align-items: center;
position: relative;
top: -2vw;
margin-left: -1vw;
top: 0;
// margin-left: -1vw;
// background-color: red;
margin-right: 1.7vw;
>view {
width: 4.5vw;
@ -257,8 +282,8 @@
justify-content: center;
align-items: center;
position: absolute;
top: 0.8vw;
right: 0.8vw;
top: 1.6vw;
right: -0.6vw;
}
image {
@ -268,10 +293,11 @@
}
.msitem {
width: 25vw;
min-width: 25vw;
height: 100%;
padding: 1vw;
display: inline-block;
// margin-right: 2.7vw;
>view {
margin-top: 0.5vw;
@ -389,12 +415,12 @@
// margin-left: -15vw !important;
// }
.speitem {
width: 15vw;
min-width: 15vw;
height: 100%;
display: inline-flex;
flex-direction: column;
position: relative;
top: -2vw;
// top: -2vw;
.cardp {
width: 12.5vw;
@ -445,6 +471,18 @@
.fler {
display: grid;
grid-template-columns: 1fr;
position: relative;
.fler-view {
width: 44.8vw;
height: 14.5vw;
border-radius: 1.6vw;
position: relative;
margin-bottom: 1.1vw;
overflow: hidden;
white-space: nowrap;
background: #fff;
border: 1px solid #D9DADC;
}
}
}

View File

@ -382,6 +382,7 @@
const qk = () => {
ification.value = false;
addflag.value = false;
// console.log("")
}
const confirm = (e : any) => {
form.categoryId = e.categoryId;
@ -415,7 +416,7 @@
const addcartory = (e : any) => {
// eindexindex0
// console.log("",e)
console.log("啥啊", e)
// console.log("", e)
if (!e.suppliers_dictText || !e.suppliers) {
openerror.value = true;
errmsg.value = `此物料暂无供应商,请联系管理员`

View File

@ -125,7 +125,6 @@
const addcartory = (e : any) => {
caigouobj.value = e;
addflag.value = true;
}
const confirm = (e : any) => {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 KiB

After

Width:  |  Height:  |  Size: 145 KiB

BIN
static/index/changemode.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
static/index/manycards.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/index/rightmore.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,155 @@
import { resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, createTextVNode, toDisplayString, Fragment, renderList, normalizeStyle } from "vue";
import { _ as _export_sfc } from "../../_plugin-vue_export-helper.js";
const _style_0 = { "page": { "": { "flex": 1, "backgroundColor": "#f5f6fa", "height": 100 } }, "controls": { "": { "paddingTop": 20, "paddingRight": 20, "paddingBottom": 20, "paddingLeft": 20, "backgroundColor": "#ffffff" } }, "row": { "": { "flexDirection": "row", "alignItems": "center", "marginBottom": 10 } }, "btn": { "": { "paddingTop": 10, "paddingRight": 14, "paddingBottom": 10, "paddingLeft": 14, "borderRadius": 6, "backgroundColor": "#2d8cf0", "color": "#ffffff", "marginRight": 10 } }, "stat": { "": { "marginRight": 14, "fontSize": 28 } }, "hint": { "": { "color": "#888888", "fontSize": 24, "marginTop": 6 } }, "list": { "": { "flex": 1 } }, "item": { "": { "height": 160, "paddingTop": 12, "paddingRight": 12, "paddingBottom": 12, "paddingLeft": 12, "flexDirection": "row", "alignItems": "center", "borderBottomWidth": 1, "borderBottomStyle": "solid", "borderBottomColor": "rgba(0,0,0,0.06)", "backgroundColor": "#ffffff" } }, "thumb": { "": { "width": 120, "height": 120, "borderRadius": 8, "marginRight": 12 } }, "meta": { "": { "flex": 1 } }, "title": { "": { "fontSize": 30, "fontWeight": "bold", "marginBottom": 8 } }, "desc": { "": { "fontSize": 24, "color": "#666666", "lineHeight": 32 } } };
const _sfc_main = {
data() {
return {
items: [],
// FPS 测量
measuring: false,
fpsDisplay: 0,
avgFrameMsDisplay: 0,
// 内部用
_frames: [],
_rafId: null,
_idleTO: null
};
},
methods: {
generate(n) {
const list = [];
for (let i = 0; i < n; i++) {
list.push({
id: i + 1,
color: this._randColor()
});
}
this.items = list;
this.fpsDisplay = 0;
this.avgFrameMsDisplay = 0;
},
clearList() {
this.items = [];
this.fpsDisplay = 0;
this.avgFrameMsDisplay = 0;
},
_randColor() {
const h = Math.floor(Math.random() * 360);
const s = 60 + Math.floor(Math.random() * 20);
const l = 55 + Math.floor(Math.random() * 10);
return `hsl(${h} ${s}% ${l}%)`;
},
// 滚动回调(来自原生 nvue scroll-view
onScroll(e) {
if (!this.measuring)
this._startMeasure();
clearTimeout(this._idleTO);
this._idleTO = setTimeout(() => {
this._stopMeasure();
}, 300);
},
_startMeasure() {
this.measuring = true;
this._frames = [];
},
_stopMeasure() {
this.measuring = false;
if (this._rafId) {
cancelAnimationFrame(this._rafId);
this._rafId = null;
}
if (this._frames.length < 2) {
this.fpsDisplay = 0;
this.avgFrameMsDisplay = 0;
return;
}
const intervals = [];
for (let i = 1; i < this._frames.length; i++) {
intervals.push(this._frames[i] - this._frames[i - 1]);
}
const sum = intervals.reduce((a, b) => a + b, 0);
const avg = sum / intervals.length;
const fps = 1e3 / avg;
this.avgFrameMsDisplay = avg.toFixed(2);
this.fpsDisplay = Math.round(fps);
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_button = resolveComponent("button");
return openBlock(), createElementBlock("scroll-view", {
scrollY: true,
showScrollbar: true,
enableBackToTop: true,
bubble: "true",
style: { flexDirection: "column" }
}, [
createElementVNode("div", { class: "page" }, [
createElementVNode("div", { class: "controls" }, [
createElementVNode("div", { class: "row" }, [
createVNode(_component_button, {
class: "btn",
onClick: _cache[0] || (_cache[0] = ($event) => $options.generate(2e3))
}, {
default: withCtx(() => [
createTextVNode("生成 2000 项")
]),
_: 1
}),
createVNode(_component_button, {
class: "btn",
onClick: _cache[1] || (_cache[1] = ($event) => $options.generate(5e3))
}, {
default: withCtx(() => [
createTextVNode("生成 5000 项")
]),
_: 1
}),
createVNode(_component_button, {
class: "btn",
onClick: $options.clearList
}, {
default: withCtx(() => [
createTextVNode("清空")
]),
_: 1
}, 8, ["onClick"])
]),
createElementVNode("div", { class: "row" }, [
createElementVNode("u-text", { class: "stat" }, "FPS: " + toDisplayString($data.fpsDisplay), 1),
createElementVNode("u-text", { class: "stat" }, "平均帧(ms): " + toDisplayString($data.avgFrameMsDisplay), 1),
createElementVNode("u-text", { class: "stat" }, "items: " + toDisplayString($data.items.length), 1)
]),
createElementVNode("div", { class: "hint" }, [
createElementVNode("u-text", null, "说明:向下快速滚动列表以测试渲染/滚动性能nvue 将使用原生渲染。")
])
]),
createElementVNode("scroll-view", {
class: "list",
scrollY: true,
showScrollbar: "true",
onScroll: _cache[2] || (_cache[2] = (...args) => $options.onScroll && $options.onScroll(...args))
}, [
(openBlock(true), createElementBlock(Fragment, null, renderList($data.items, (item) => {
return openBlock(), createElementBlock("div", {
class: "item",
key: item.id
}, [
createElementVNode("div", {
class: "thumb",
style: normalizeStyle({ backgroundColor: item.color })
}, null, 4),
createElementVNode("div", { class: "meta" }, [
createElementVNode("u-text", { class: "title" }, "Item #" + toDisplayString(item.id), 1),
createElementVNode("u-text", { class: "desc" }, "这是第 " + toDisplayString(item.id) + " 个条目,用于增加每个 DOM 的复杂度以测试渲染成本。多行文本强制布局多次换行,模拟真实列表。", 1)
])
]);
}), 128))
], 32)
])
]);
}
const ceshi = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]]]);
export {
ceshi as default
};

View File

@ -0,0 +1,15 @@
import "vue";
function requireNativePlugin(name) {
return weex.requireModule(name);
}
function formatAppLog(type, filename, ...args) {
if (uni.__log__) {
uni.__log__(type, filename, ...args);
} else {
console[type].apply(console, [...args, filename]);
}
}
export {
formatAppLog as f,
requireNativePlugin as r
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 KiB

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB