hldy_app_mini/pages/procurement/common/thitem.vue

489 lines
10 KiB
Vue
Raw Normal View History

2025-12-05 10:10:53 +08:00
<template>
<view>
2025-12-16 11:05:37 +08:00
<scroll-view scroll-y="true" class="itembox" scroll-with-animation @scrolltolower="scrolltolower()"
enable-back-to-top>
2025-12-05 10:10:53 +08:00
<view class="box">
<view class="fler" v-for="(v,index) in InvoicingList" :key="index">
<scroll-view class="carditem guodu" @touchend="handleTouchEnd($event,v,index)"
@touchstart="touchstart($event,v,index)" scroll-with-animation scroll-x="true"
2025-12-16 11:05:37 +08:00
:scroll-left="v.scrollleft" @scroll="scroll">
2025-12-05 10:10:53 +08:00
<view class="zding" v-if="v.zhiDingId">
<image src="/static/index/procurement/zd.png" mode="aspectFill"></image>
</view>
2025-12-16 11:05:37 +08:00
<view class="speitem guodu">
<image
:src="v.materialInfo?.materialImg?serverUrl+v.materialInfo?.materialImg:'/static/index/procurement/k.png'"
2025-12-05 10:10:53 +08:00
mode="aspectFill">
</image>
<view class="cardp">
2025-12-09 15:05:45 +08:00
<view v-if="v.materialInfo?.categoryName">{{v.materialInfo?.categoryName}}</view>
<view v-if="v.materialInfo?.typeName">{{v.materialInfo?.typeName}}</view>
2025-12-05 10:10:53 +08:00
</view>
</view>
2025-12-16 11:05:37 +08:00
<view class="msitem guodu">
2025-12-05 10:10:53 +08:00
<view>
2025-12-09 15:05:45 +08:00
<view>{{v.materialInfo?.materialName}}</view>
2025-12-05 10:10:53 +08:00
</view>
<view>
2025-12-16 11:05:37 +08:00
<text style="white-space: nowrap;"> 规格型号: </text>
2025-12-09 15:05:45 +08:00
<view>{{v.materialInfo?.specificationModel}}</view>
2025-12-05 10:10:53 +08:00
</view>
<view>
<view>
2025-12-08 09:29:30 +08:00
<text>{{v.thNum?v.thNum:'--'}}</text>
2025-12-05 10:10:53 +08:00
<text>退货数量</text>
</view>
<view>
2025-12-09 15:05:45 +08:00
<text>{{v.materialInfo?.materialUnits}}</text>
2025-12-05 10:10:53 +08:00
<text>退货单位</text>
</view>
</view>
</view>
2025-12-16 11:05:37 +08:00
<view class="add">
2025-12-05 10:10:53 +08:00
<view v-if="v.isAdd==1">已添加</view>
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
<!-- <image v-if="v.isAdd!=1" :src="'/static/index/procurement/+.png'" mode="aspectFill"></image>
<image v-if="v.isAdd==1" :src="'/static/index/procurement/-.png'" mode="aspectFill"></image> -->
</view>
2025-12-16 11:05:37 +08:00
<view class="nextadd" @click.stop="clkzk(v,index)">
<image class="guodu" :style="v.zk?'transform: rotate(180deg);':''"
:src="'/static/index/procurement/l.png'" mode="aspectFill"></image>
</view>
2025-12-05 16:13:49 +08:00
<view class="zkadd guodu" v-if="status<2">
2025-12-05 10:10:53 +08:00
<view @click.stop="comfig(v,index,1)" @touchend.stop>
添加物料
</view>
</view>
</scroll-view>
</view>
2025-12-16 11:05:37 +08:00
<defaultr cont="暂无数据" v-if="InvoicingList.length==0 "
style="position: absolute;width: 10vw;height: 10vw;"></defaultr>
2025-12-05 10:10:53 +08:00
</view>
</scroll-view>
2025-12-16 11:05:37 +08:00
<taking :show="tuihuoshow" :objtake="tuihuoobj" @fill="tuihuoshow = false" @right="right"></taking>
<errorshow :show="openerror" :font="errmsg" @close="openerror=false" />
2025-12-05 10:10:53 +08:00
</view>
</template>
<script setup lang="ts">
2025-12-16 11:05:37 +08:00
import { ref, onMounted, onBeforeUnmount, computed, nextTick, watch, reactive } from 'vue';
2025-12-05 10:10:53 +08:00
import taking from './takeing.vue'
2025-12-08 14:04:09 +08:00
import defaultr from '../components/default.vue'
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
const props = defineProps({
InvoicingList: {
type: Array,
2025-12-16 11:05:37 +08:00
required: true
2025-12-05 10:10:53 +08:00
},
status: {
type: String
2025-12-16 11:05:37 +08:00
}
2025-12-05 10:10:53 +08:00
})
2025-12-09 15:05:45 +08:00
const openerror = ref(false)
const errmsg = ref('')
2025-12-05 16:13:49 +08:00
const carnum = ref(0)
2025-12-05 10:10:53 +08:00
const caigouobj = ref({})
const serverUrl = ref(uni.getStorageSync('serverUrl') + '/sys/common/static/')
2025-12-16 11:05:37 +08:00
const emit = defineEmits(['scrolltolower', 'comfig'])
2025-12-05 10:10:53 +08:00
const pageX = ref(0);
const pageY = ref(0);
const ones = ref(true)
2025-12-16 11:05:37 +08:00
const clkzk = (v : any, i : number) => {
if(v.zk==true){
v.zk = false;
v.scrollleft =0.01
setTimeout(()=>{
v.scrollleft = 0
},20)
}else{
v.zk = true;
v.scrollleft =149.99
setTimeout(()=>{
v.scrollleft = 150;
},20)
}
solleft(v,i)
}
const touchstart = (event : any, v : any, i : number) => {
2025-12-05 10:10:53 +08:00
caigouobj.value = v;
pageX.value = event.changedTouches[0].pageX;
pageY.value = event.changedTouches[0].pageY;
2025-12-16 11:05:37 +08:00
if (ones.value) {
2025-12-05 10:10:53 +08:00
ones.value = false;
solleft(v, i)
}
}
const tuihuoshow = ref(false)
const tuihuoobj = ref({})
2025-12-16 11:05:37 +08:00
const comfig = (v, i, t) => {
if (props.status == '0') {
2025-12-09 15:05:45 +08:00
errmsg.value = '未开始服务不能添加退货物料!';
openerror.value = true;
return
}
2025-12-05 10:10:53 +08:00
tuihuoobj.value = v;
tuihuoshow.value = true;
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
// emit('comfig',v,i,t)
}
2025-12-16 11:05:37 +08:00
const right = (e, v) => {
emit('comfig', e, v);
2025-12-05 10:10:53 +08:00
tuihuoshow.value = false;
}
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);
ones.value = true;
2025-12-16 11:05:37 +08:00
if (absy > 30 && absx + 10 < absy) {
2025-12-05 10:10:53 +08:00
caigouobj.value.scrollleft = 0.01
2025-12-16 11:05:37 +08:00
setTimeout(() => {
2025-12-05 10:10:53 +08:00
caigouobj.value.scrollleft = 0
2025-12-16 11:05:37 +08:00
}, 20)
2025-12-05 10:10:53 +08:00
return
}
if (absx < 10 && absy < 10) {
2025-12-16 11:05:37 +08:00
if (caigouobj.value.zk == false) {
setTimeout(() => {
2025-12-05 10:10:53 +08:00
caigouobj.value.scrollleft = 0
2025-12-16 11:05:37 +08:00
}, 20)
}
2025-12-05 10:10:53 +08:00
return
}
2025-12-16 11:05:37 +08:00
if (scrollLeft.value <= 40) {
2025-12-05 10:10:53 +08:00
caigouobj.value.scrollleft = scrollLeft.value;
caigouobj.value.zk = false;
2025-12-16 11:05:37 +08:00
nextTick(() => {
2025-12-05 10:10:53 +08:00
caigouobj.value.scrollleft = 0;
scrollLeft.value = 0;
})
2025-12-16 11:05:37 +08:00
} else {
2025-12-05 10:10:53 +08:00
scrollLeft.value = 150
caigouobj.value.scrollleft = scrollLeft.value;
caigouobj.value.zk = true;
}
caigouobj.value.zk = x > pageX.value ? false : true;
caigouobj.value.scrollleft = caigouobj.value.zk ? 150 : 0;
}
2025-12-16 11:05:37 +08:00
const solleft = (v : any, i : number) => {
2025-12-05 10:10:53 +08:00
console.log(v)
props.InvoicingList.forEach((item, k) => {
2025-12-16 11:05:37 +08:00
if (k != i && item.zk == true) {
2025-12-05 10:10:53 +08:00
item.zk = false;
2025-12-16 11:05:37 +08:00
item.scrollleft = 0;
2025-12-05 10:10:53 +08:00
}
})
}
const scrolltolower = () => {
2025-12-16 11:05:37 +08:00
emit('scrolltolower')
2025-12-05 10:10:53 +08:00
}
const scrollLeft = ref(0)
2025-12-16 11:05:37 +08:00
const scroll = (e) => {
2025-12-05 10:10:53 +08:00
scrollLeft.value = e.detail.scrollLeft
// console.log(e.detail.scrollLeft)
}
</script>
<style scoped lang="less">
.zkadd {
width: 9vw;
height: 100%;
display: inline-flex;
justify-content: flex-end;
position: absolute;
top: 0;
right: -9vw;
2025-12-16 11:05:37 +08:00
view:active {
background: rgba(85, 166, 249, 1) !important;
2025-12-05 10:10:53 +08:00
color: #FFFFFF !important;
}
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
>view {
width: 3.6vw;
height: 100%;
font-weight: 400;
font-size: 1.3vw;
display: flex;
justify-content: center;
align-items: center;
writing-mode: vertical-rl;
text-orientation: upright;
2025-12-16 11:05:37 +08:00
letter-spacing: 2px;
background: rgba(85, 166, 249, 1) !important;
2025-12-05 10:10:53 +08:00
color: #FFFFFF !important;
}
}
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
.add {
2025-12-16 11:05:37 +08:00
width: 5vw;
2025-12-05 10:10:53 +08:00
height: 13vw;
display: inline-flex;
justify-content: space-between;
align-items: center;
position: absolute;
2025-12-16 11:05:37 +08:00
top: 0;
right: 0.8vw;
2025-12-05 10:10:53 +08:00
>view {
width: 4.5vw;
height: 1.8vw;
background: #E3EEF7;
border-radius: 0.9vw;
border: 1px solid rgba(3, 133, 250, 0.34);
font-weight: 400;
font-size: 1.1vw;
color: #1083F8;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 0.8vw;
right: 0vw;
}
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
image {
width: 3vw;
height: 3vw;
position: absolute;
bottom: 0.8vw;
right: 0vw;
}
}
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
.msitem {
2025-12-15 13:36:09 +08:00
width: 11vw;
2025-12-05 10:10:53 +08:00
height: 100%;
position: absolute;
2025-12-16 11:05:37 +08:00
top: 0;
2025-12-05 10:10:53 +08:00
left: 10vw;
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
>view {
2025-12-15 17:09:12 +08:00
margin-top: 0vw;
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
&:nth-child(3) {
width: 100%;
height: 3.4vw;
display: flex;
justify-content: space-between;
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
>view {
width: 50%;
height: 100%;
display: flex;
flex-direction: column;
position: relative;
2025-12-16 11:05:37 +08:00
margin-top: 1vw;
2025-12-05 10:10:53 +08:00
white-space: nowrap;
2025-12-16 11:05:37 +08:00
&:nth-child(1) {
2025-12-05 10:10:53 +08:00
padding-right: 1.7vw;
align-items: flex-start;
}
2025-12-16 11:05:37 +08:00
&:nth-child(2) {
2025-12-05 10:10:53 +08:00
padding-left: 1.7vw;
align-items: flex-start;
}
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
&:nth-child(1)::after {
content: '';
position: absolute;
right: 0;
width: 100%;
height: 2.2vw;
border-right: 1px solid #C9C9C9;
top: 0.6vw;
}
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
text {
&:nth-child(1) {
font-weight: bold;
font-size: 1.7vw;
color: #555555;
}
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
&:nth-child(2) {
font-weight: 400;
font-size: 1.1vw;
color: #999999;
white-space: nowrap;
}
}
}
}
2025-12-16 11:05:37 +08:00
&:nth-child(2) {
2025-12-05 10:10:53 +08:00
display: flex;
justify-content: space-between;
flex-direction: column;
margin-top: 0.1vw;
2025-12-16 11:05:37 +08:00
view {
2025-12-05 10:10:53 +08:00
font-size: 1.4vw;
color: #888888;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
text {
font-weight: 400;
font-size: 1.1vw;
color: #777777;
margin-top: 0.25vw;
}
}
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
&:nth-child(1) {
2025-12-16 11:05:37 +08:00
view {
2025-12-05 10:10:53 +08:00
display: inline-block;
width: 10vw;
font-weight: bold;
font-size: 1.6vw;
color: #222222;
2025-12-15 13:36:09 +08:00
height: 3.1vw;
2025-12-17 15:48:36 +08:00
padding-top: 0.8vw;
2025-12-05 10:10:53 +08:00
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
}
}
}
2025-12-16 11:05:37 +08:00
.zding {
2025-12-05 10:10:53 +08:00
width: 4.6vw;
height: 4.6vw;
position: absolute;
left: 0;
top: 0;
z-index: 11;
2025-12-16 11:05:37 +08:00
image {
2025-12-05 10:10:53 +08:00
width: 100%;
height: 100%;
}
}
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
.speitem {
width: 10vw;
height: 100%;
display: inline-flex;
flex-direction: column;
position: absolute;
2025-12-16 11:05:37 +08:00
top: 0;
2025-12-05 10:10:53 +08:00
left: 0;
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
.cardp {
2025-12-16 11:05:37 +08:00
width: 8vw;
2025-12-15 13:36:09 +08:00
height: 4.2vw;
2025-12-05 10:10:53 +08:00
display: flex;
margin: 0 auto;
align-items: center;
justify-content: center;
flex-direction: column;
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
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;
}
}
2025-12-16 11:05:37 +08:00
2025-12-05 10:10:53 +08:00
>image {
2025-12-15 13:36:09 +08:00
width: 7.5vw;
2025-12-05 10:10:53 +08:00
height: 7.5vw;
2025-12-15 17:09:12 +08:00
margin: 0vw auto 0.25vw;
2025-12-05 10:10:53 +08:00
}
}
2025-12-16 11:05:37 +08:00
.itembox {
2025-12-05 10:10:53 +08:00
width: 100%;
2025-12-15 13:36:09 +08:00
height: calc(100vh - 22vw);
2025-12-16 11:05:37 +08:00
padding: 1vw 0.5vw 1vw;
2025-12-05 10:10:53 +08:00
background: #fff;
2025-12-16 11:05:37 +08:00
.box {
2025-12-05 10:10:53 +08:00
width: 100%;
2025-12-15 13:36:09 +08:00
display: flex;
flex-wrap: wrap;
// display: grid;
// grid-template-columns: 1fr 1fr;
2025-12-05 10:10:53 +08:00
}
2025-12-16 11:05:37 +08:00
.fler {
2025-12-15 13:36:09 +08:00
width: 31.5vw;
2025-12-05 10:10:53 +08:00
height: 13vw;
margin-bottom: 0.9vw;
2025-12-08 09:29:30 +08:00
margin-left: 0.5vw;
2025-12-16 11:05:37 +08:00
.carditem {
2025-12-15 13:36:09 +08:00
width: 31vw;
2025-12-05 10:10:53 +08:00
height: 13vw;
background: rgba(245, 246, 248, 1);
border-radius: 1.1vw;
position: relative;
overflow: hidden;
}
}
2025-12-16 11:05:37 +08:00
}
.nextadd {
position: absolute;
right: 0;
top: -2vw;
width: 6vw;
height: 17vw;
display: inline-flex;
justify-content: center;
align-items: center;
>view {
width: 4.5vw;
height: 1.9vw;
background: #E3EEF7;
border-radius: 0.9vw;
border: 1px solid rgba(3, 133, 250, 0.34);
font-weight: 400;
font-size: 1.1vw;
color: #1083F8;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 0vw;
right: 0vw;
}
image {
width: 3vw;
height: 3vw;
}
}
.guodu {
transition: .4s;
-webkit-transform-style: preserve-3d;
-webkit-overflow-scrolling: touch;
}
</style>