This commit is contained in:
Teng 2025-11-11 17:29:23 +08:00
commit 3c0c254e41
26 changed files with 2379 additions and 5 deletions

View File

@ -181,6 +181,9 @@
"navigationStyle": "custom"
}
},
{
"path" : "pages/procurement/material"
}
// {

View File

@ -62,6 +62,21 @@
const housactive = (index : number) => {
if (index > 5) { return }
if(housedex.value == index){
if (housedex.value == 1) {
navurl.value = 'pages/procurement/material'
uni.navigateTo({
url: '/' + navurl.value
})
}
if (housedex.value == 2) {
navurl.value = 'pages/Warehouse/purchaseorder'
uni.navigateTo({
url: '/' + navurl.value
})
}
return
}
housedex.value = index;
console.log("index", index)
// .....

View File

@ -55,8 +55,14 @@
<view>
{{v.materialName}}
</view>
<view>采购单位 {{v.materialUnits}}</view>
<view>规格型号: {{v.specificationModel}}</view>
<view>
采购单位 {{v.materialUnits}}
</view>
<view>
规格型号: {{v.specificationModel}}
</view>
<view>
<view class="carditem" :class="{'hl':v.tagType==1,'yl':v.tagType==2,'bj':v.tagType>2}">
<image src="/static/index/warehouse/procurement/hl.png" mode="aspectFill"

View File

@ -0,0 +1,149 @@
// 引入 request 文件
import request from '@/request/guanli.js'
// 查询仓库对应物料
export const queryInvoicingList = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/queryInvoicingList`,
method: 'get',
data: params,
})
}
// 获取物料分类树(请购列表使用)
export const getMaterialTreeData = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/getMaterialTreeData?nuId=`+params.nuId,
method: 'get',
data: params,
})
}
// (业务)获取物料分类树(购物车使用)
export const getGwcMaterialTreeData = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/getGwcMaterialTreeData?nuId=`+params.nuId,
method: 'get',
data: params
})
}
// (业务)获取物料分类树(采购单使用)
export const getCgdMaterialTreeData = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/getCgdMaterialTreeData?nuId=`+params.nuId,
method: 'get',
data: params,
})
}
export const queryNuInfoByNuId = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/queryNuInfoByNuId`,
method: 'get',
data: params,
})
}
// 修改库房启用停用
export const updateKfstatus = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/updateKfstatus`,
method: 'post',
data: params,
})
}
//获得采购单信息
export const queryCgdList = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/queryCgdList`,
method: 'get',
data: params,
})
}
// 查询采购项目
export const queryCgdInfoList = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/queryCgdInfoList`,
method: 'get',
data: params,
})
}
// 查询采购项目的详情
export const queryWlInfoByWlId = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/queryWlInfoByWlId`,
method: 'get',
data: params,
})
}
export const addShoppingCartList = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/addShoppingCartList`,
method: 'post',
data: params,
})
}
export const queryShoppingCartList = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/queryShoppingCartList`,
method: 'get',
data: params,
})
}
export const generatedPurchaseOrder = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/generatedPurchaseOrder`,
method: 'post',
data: params,
})
}
export const generatedPurchaseViewOrder = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/generatedPurchaseViewOrder`,
method: 'post',
data: params,
})
}
export const deleteQgInfoById = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/deleteQgInfoById?id=`+params,
method: 'DELETE'
})
}
export const emptiedQgInfo = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/emptiedQgInfo`,
method: 'DELETE'
})
}
// 作废
export const voidedCgdMain = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/voidedCgdMain`,
method: 'post',
data: params,
})
}
//修改库房物料是否启用
export const updateWarehouserEnabled = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/updateWarehouserEnabled`,
method: 'post',
data: params,
})
}
//(业务)获取物料分类树可采购的物料数量(仓库列表使用)
export const getTreeDataWlnum = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/getTreeDataWlnum`,
method: 'get',
data: params,
})
}

View File

@ -0,0 +1,351 @@
<template>
<view>
<view class="qbkyj" v-if="show">
<view class="titletop">全部库存预警</view>
<scroll-view scroll-y="true" class="crdcroll" scroll-with-animation :scroll-top="scrolltop"
@scrolltolower="scrolltolower">
<view class="fler">
<view class="carditem" 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.medicationName">{{v.medicationName}}</view>
</view>
</view>
<view class="msitem guodu" :style="v.zk?'margin-left:2.5vw':''">
<view>
<view>{{v.materialName}}</view><text>{{v.materialNo}}</text>
</view>
<view>
<text> 规格型号: {{v.specificationModel}}</text>
</view>
<view>
<text v-if="v.multiUnitType=='1'">采购单价: {{v.oneUnitPrice}} </text>
<text v-if="v.multiUnitType=='1'">采购单位: {{ v.oneUnit}}</text>
<text v-if="v.multiUnitType=='2'">采购单价: {{v.twoUnitPrice}} </text>
<text v-if="v.multiUnitType=='2'">采购单位: {{ v.twoUnit}}</text>
<text v-if="v.multiUnitType=='3'">采购单价: {{v.referenceUnitPrice}} </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="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.zk?'':'zkf'">
<view>出入库</view>
<view @click="addcar(v)">加购物车</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>
</view>
</template>
<script setup lang="ts">
import { ref, onMounted, reactive, onBeforeUnmount, computed, nextTick, defineProps ,defineComponent} from 'vue';
import { queryInvoicingList,queryWlInfoByWlId,addShoppingCartList,queryShoppingCartList } from '../api/lunpan.js'
const form = reactive({
nuId: uni.getStorageSync('nuId'),
pageNo: 1,
pageSize: 10,
categoryId: '',
typeId: '',
medicationId: '',
wlParamInfo: '',
isWaring: 1
})
const props = defineProps({
InvoicingList: {
type: Array,
required: true
},
status:{
type:String
},
show: {
type: Boolean,
default:false,
required: true,
},
})
const emit = defineEmits(['addcartory','tolower'])
const serverUrl = ref('')
onMounted(()=>{
serverUrl.value = uni.getStorageSync('serverUrl') + '/sys/common/static/';
})
const setout1 = ref(true)
const scrolltolower = () => {
emit('tolower')
}
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;
props.InvoicingList.forEach((item,k)=>{
if(k==i){
item.zk = !item.zk;
}else{
item.zk = false;
}
})
}
const addcar = (v:any)=>{
emit('addcartory',caigouobj.value)
}
</script>
<style scoped lang="less">
.carditem {
width: 47vw;
height: 14.5vw;
background: rgba(245, 246, 248, 1);
border-radius: 1.6vw;
position: relative;
margin-bottom: 1.1vw;
display: flex;
overflow: hidden;
justify-content: flex-start;
.zkf{
right:-10vw !important;
}
.zkadd{
width: 10vw;
height: 100%;
display: flex;
justify-content: flex-end;
position: absolute;
top: 0;
right: 0;
view{
width: 5vw;
height: 100%;
font-weight: 400;
font-size: 1.3vw;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
&:nth-child(2){
background: #1083F8;
color: #fff;
padding: 1.1vw;
}
&:nth-child(1){
background: #C2C4C9;
color: #555555;
}
}
}
.add{
width: 6vw;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
position: relative;
>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;
text-align: center;
line-height: 1.75vw;
position: absolute;
top: 0.8vw;
right: 0.8vw;
}
image{
width: 3.2vw;
height: 3.2vw;
}
}
.msitem{
width: 25vw;
height: 100%;
padding: 1vw;
>view{
margin-top: 0.5vw;
&:nth-child(4){
width: 100%;
height: 3.4vw;
display: flex;
justify-content: space-between;
>view{
width: 33.3%;
height: 100%;
display: flex;
flex-direction: column;
position: relative;
align-items: center;
&:nth-child(1){
width: 30%;
text-align: left;
}
&:nth-child(2){
width: 40%;
text-align: center;
}
&:nth-child(3){
width: 30%;
text-align: 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.7vw;
color: #555555;
}
&:nth-child(2){
font-weight: 400;
font-size: 1.1vw;
color: #999999;
}
}
}
}
&:nth-child(2),&:nth-child(3){
display: flex;
justify-content: space-between;
text{
font-weight: 400;
font-size: 1.4vw;
color: #777777;
margin-top: 0.35vw;
}
}
&:nth-child(1){
display: flex;
justify-content: space-between;
align-items: center;
height: 2vw;
>view{
width: 19vw;
height: 2vw;
font-weight: bold;
font-size: 1.6vw;
color: #222222;
text-overflow:ellipsis;
overflow: hidden;
white-space: nowrap;
}
text{
width: 6vw;
font-weight: 300;
font-size: 1.4vw;
color: #222222;
}
}
}
}
.spleft{
margin-left: -15vw !important;
}
.speitem{
width: 15vw;
height: 100%;
display: flex;
flex-direction: column;
.cardp{
width: 12.5vw;
height: 4vw;
display: flex;
flex-wrap: wrap;
margin: 0 auto;
align-items: center;
view{
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;
}
}
>image{
width: 9vw;
height: 8vw;
margin: 1vw auto 0;
}
}
}
.crdcroll {
width: 100%;
height: calc(85vh - 6.5vw);
.fler {
display: grid;
grid-template-columns: 1fr;
}
}
.qbkyj{
width: 51vw;
height: 85vh;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 0.7vw 0rpx rgba(182,186,196,0.29);
border-radius: 1.6vw;
position: fixed;
top: 8vh;
left: 24.5vw;
z-index: 103;
padding: 2vw;
}
.titletop{
width: 100%;
height: 2.5vw;
font-weight: bold;
font-size: 1.8vw;
color: #333333;
line-height: 2.5vw;
}
.guodu {
transition: .4s;
-webkit-transform-style: preserve-3d;
-webkit-overflow-scrolling: touch;
}
</style>

View File

@ -0,0 +1,42 @@
<template>
<view>
<view class="shadow guodu" :class="opacity?'heig':''" ></view>
</view>
</template>
<script>
export default {
props: {
opacity: {
type: Boolean,
default: false, //
}
},
data() {
return {
};
}
}
</script>
<style lang="less">
.shadow {
width: 100%;
height: 0;
position: absolute;
left: 0;
bottom: 0vw;
border-radius: 50%;
filter: blur(15rpx);
background: linear-gradient(to top, RGBA(239, 240, 244, 1), RGBA(239, 240, 244, .1)); /* 根据需要调整 */
}
.guodu{
transition: .4s;
-webkit-transform-style: preserve-3d;
-webkit-overflow-scrolling: touch;
}
.heig{
height: 16vw !important;
}
</style>

View File

@ -0,0 +1,403 @@
<template>
<view class="plsbuy-contain" v-if="show">
<view class="gys">
<view class="tlt">供应商</view>
<view class="gssel" @click="gysflag = true">
<view>
{{gysarr[gysidnum]?.name}}
</view>
<text @click.stop="gysflag = !gysflag">调整</text>
</view>
<view class="tanchu" v-if="gysflag">
<scroll-view scroll-y="true" class="gysscrol">
<view v-for="(v,i) in gysarr" :key='i' :class="gysidnum==i?'acts':''" @click="gysid(i)">
<text>{{v.name}}</text>
<image src="/static/index/warehouse/procurement/d.png" mode="aspectFill"></image>
</view>
</scroll-view>
</view>
</view>
<view class="calculator-father">
<view v-for="(item,index) in calculatorArray" :key="index">
<view :class="blueNumber == index ? `calculator-kuai-target` : ``" class="calculator-kuai"
@click="clickKuai(item,index)">
{{item}}
</view>
</view>
</view>
<view class="qinggou-font">
采购数量
</view>
<view class="stringShow-father">
<view class="jj" @click="jjnum(-1)" @longpress="handleTouchStart(-1)" @touchend="handleTouchEnd">
-
</view>
<view class="stringShow-kuai">
<view v-for="(item,index) in stringShow" :key="index" >
{{item}}
</view>
</view>
<view class="jj" @click="jjnum(1)" @longpress="handleTouchStart(1)" @touchend="handleTouchEnd">
+
</view>
</view>
<view class="plsbuy-bottom">
<view class="quxiao" @click="colse">
取消
</view>
<view class="plsbuy-bottom-blue" @click="closeIt">
确定
</view>
</view>
</view>
</template>
<script setup lang="ts">
import {
ref,
onMounted,
onBeforeUnmount,
computed,
nextTick,
watch
} from 'vue';
const emit = defineEmits(['right','colse','jjnum'])
const blueNumber = ref(-1);
const gysflag = ref(false)
const gysarr = ref([])
const gysidnum = ref(0)
const props = defineProps({
doOnce: {
type: Number,
required: true,
},
translateNumber: {
type: Number,
required: true,
},
show: {
type: Boolean,
default:false,
required: true,
},
caigouobj:{
type:Object,
required: true,
}
});
watch(
() => props.doOnce,
() => {
relNumber.value = props.translateNumber
stringShow.value = toFixed4ByPadStart(relNumber.value)
}
)
watch(
()=>props.show,
()=>{
if(props.show){
console.log(props.caigouobj)
let n = [];
let id = [];
gysarr.value = [];
n = props.caigouobj.suppliers_dictText.split(/[, ]+/);
id = props.caigouobj.suppliers.split(/[, ]+/);
n.forEach((item,i)=>{
gysarr.value.push({'name':item,'id':id[i]})
})
}
})
const gysid = (e:number)=>{
gysidnum.value = e;
gysflag.value = false;
}
const calculatorArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, "AC", 0, "CE"];
const stringShow = ref("0000");
const relNumber = ref(0);
// const isZero = ref(false);
const clickKuai = (item : any, index : number) => {
blueNumber.value = index;
setTimeout(() => {
blueNumber.value = -1
}, 300)
if (item == "AC") {
relNumber.value = 0;
stringShow.value = "0000"
return
}
if (item == "CE") {
relNumber.value = Math.trunc(relNumber.value / 10)
stringShow.value = toFixed4ByPadStart(relNumber.value)
return
}
if (digitCountByString(relNumber.value) > 3) {
} else {
if (!relNumber.value) {
relNumber.value = item
} else {
relNumber.value = relNumber.value * 10 + item;
}
stringShow.value = toFixed4ByPadStart(relNumber.value)
}
}
const InteroutId = ref(null)
const handleTouchStart = (e:number)=> {
Interval(e)
}
const handleTouchEnd=()=> {
clearInterval(InteroutId.value);
//
}
const Interval = (e:number)=>{
InteroutId.value = setInterval(() => {
jjnum(e);
}, 120);
}
const jjnum = (e:number)=>{
emit('jjnum',e)
}
const closeIt = () => {
emit('right', relNumber.value,gysarr.value[gysidnum.value])
}
const colse = ()=>{
emit('colse')
}
//
function digitCountByString(n) {
//
const s = Math.abs(n).toString();
//
// return s.replace('.', '').length;
return s.length;
}
// NumberString
function toFixed4ByPadStart(n) {
// 1.
const intPart = Math.floor(Math.abs(n));
// 2. padStart 4 '0'
return String(intPart).padStart(4, '0');
}
</script>
<style lang="less" scoped>
.gys{
width: 100%;
height: 8vw;
position: relative;
>.tanchu{
width: 25vw;
height: 7vw;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 0.5vw 0rpx rgba(174,175,176,0.35);
border-radius: 1.1vw;
padding: 0 1.4vw;
position: absolute;
right: 7.2vw;
top: 7vw;
.gysscrol{
width: 100%;
height: 7vw;
.acts{
color: #0385FA !important;
image{
display: block;
}
}
view{
display: flex;
justify-content: space-between;
align-items: center;
font-weight: 400;
font-size: 1vw;
color: #666666;
margin-bottom: 0.9vw;
&:nth-child(1){
margin-top: 0.9vw;
}
image{
width: 1vw !important;
height: 0.7vw !important;
display: none;
}
}
}
}
.gssel{
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 1vw;
text{
width: 7.1vw;
height: 3.3vw;
background: linear-gradient(-45deg, rgba(223, 244, 252, 0.43), rgba(204, 228, 249, 0.43));
border-radius: 1.65vw;
border: 1px solid #1083F8;
font-weight: 400;
font-size: 1.5vw;
color: #1083F8;
display: flex;
justify-content: center;
align-items: center;
}
>view{
width: 22vw;
height: 3.3vw;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-weight: 400;
font-size: 1.6vw;
color: #555555;
line-height: 3.3vw;
}
}
.tlt{
font-weight: bold;
font-size: 1.8vw;
color: #333333;
}
}
.plsbuy-contain {
display: flex;
align-items: center;
flex-direction: column;
width: 36vw;
height: 90vh;
background: rgba(250, 251, 252, 1);
overflow: hidden;
box-shadow: 0rpx 0rpx 1.6vw 0rpx rgba(136,141,153,0.28);
border-radius: 2.2vw;
top: 5vw;
left: 32vw;
position: fixed;
z-index: 200;
padding: 2.8vw;
}
.plsbuy-bottom {
width: 90%;
margin-top: 4.5vw;
height: 70rpx;
display: flex;
justify-content: flex-end;
font-size: 35rpx;
view{
display: flex;
justify-content: center;
align-items: center;
width: 9vw;
height: 3.8vw;
color: rgba(92, 121, 146, 1);
border-radius:1.6vw;
font-size: 1.8vw;
border: 1px solid #A2B4CF;
margin-left: 1vw;
}
.quxiao{
background: #FFFFFF;
}
.plsbuy-bottom-blue {
background: linear-gradient(0deg, #CAE0F9, #E9F4FF);
border: 1px solid rgba(3,133,250,0.34);
background: linear-gradient(-61deg, #EAF5FF, #CBE7FF);
}
}
.calculator-father {
width: 24vw;
height: 57%;
margin :0 auto 0;
flex-wrap: wrap;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
.calculator-kuai {
display: flex;
justify-content: center;
align-items: center;
background: url('/static/index/procurement/bt.png') no-repeat;
background-size: 100% 100%;
border-radius: 25rpx;
font-size: 42rpx;
font-weight: 500;
margin: 15rpx 20rpx 0 20rpx;
width: 6.1vw;
height: 6.1vw;
}
.calculator-kuai:active{
background: linear-gradient(to bottom, #00C9FF, #0076FF);
color: #fff;
font-size: 45rpx;
font-weight: 500;
}
}
.stringShow-father {
width: 100%;
height: 70rpx;
margin-top: 20rpx;
display: flex;
align-items: center;
.jj{
width: 5vw;
height: 5vw;
margin: 0 1vw;
display: flex;
justify-content: center;
align-items: center;
background: url('/static/index/procurement/bt.png') no-repeat;
background-size: 100% 100%;
border-radius: 25rpx;
font-size: 42rpx;
}
.jj:active{
background: linear-gradient(to bottom, #00C9FF, #0076FF);
color: #fff;
display: flex;
justify-content: center;
align-items: center;
background-color: #DCDCEE;
border-radius: 25rpx;
font-size: 45rpx;
font-weight: 500;
}
.stringShow-kuai {
display: flex;
align-items: center;
width: 18.5vw;
height: 5vw;
background: #F3F5F9;
border-radius: 1vw;
border: 1px solid #CBCFD0;
justify-content: space-around;
box-shadow: 0rpx 0.1vw 0.3vw 0rpx rgba(140,143,153,0.17) inset;
view{
display: flex;
justify-content: center;
align-items: center;
font-size: 42rpx;
font-weight: 500;
width:3.5vw;
height: 5vw;
}
}
}
.qinggou-font {
font-size: 27rpx;
font-weight: 500;
margin: 1.4vw auto;
}
</style>

View File

@ -0,0 +1,249 @@
<template>
<view>
<view class="ifclass" v-if="show">
<view class="titletop">物料分类</view>
<view class="toptype">
<view v-for="v in ['一','二','三']">{{v+'级分类'}}</view>
</view>
<view class="scroltype">
<scroll-view scroll-y="true" scroll-with-animation :scroll-top="scroll.scrolltop1"
class="scroll-Y scrl1">
<view :class="scroll.act1==i?'act':''" v-for="(v,i) in TreeData" @click="typescroll(1,i,v)">
<image :src="serverUrl + v.appCheckIconPath" mode="aspectFill" v-if="scroll.act1==i">
</image>
<image :src="serverUrl + v.appIconPath" mode="aspectFill" v-else></image>
<text>
{{v.title}}
</text>
</view>
</scroll-view>
<scroll-view scroll-y="true" scroll-with-animation :scroll-top="scroll.scrolltop2"
class="scroll-Y scrl2">
<view :class="scroll.act2==i?'act':''" v-for="(v,i) in TreeData[scroll.act1]?.children"
@click="typescroll(2,i,v)">
{{v.title}}
</view>
</scroll-view>
<scroll-view scroll-y="true" scroll-with-animation :scroll-top="scroll.scrolltop3"
class="scroll-Y scrl3">
<view :class="scroll.act3==i?'act':''"
v-for="(v,i) in TreeData[scroll.act1]?.children[scroll.act2]?.children"
@click="typescroll(3,i,v)">
{{v.title}}
</view>
</scroll-view>
</view>
<view class="btnbotm">
<view class="bt" @click="typescroll(1,-1,{})" >重置</view>
<view class="bt qd" @click="config">确定 <text v-if="num>0">{{num>99?'99+':num}}件物料</text></view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, onMounted, reactive, onBeforeUnmount, computed, nextTick, defineProps } from 'vue';
import { getMaterialTreeData , getTreeDataWlnum} from '../api/lunpan.js'
import { onShow, onLoad, onHide, onPageScroll } from "@dcloudio/uni-app"
const scroll = reactive({ scrolltop1: 0, scrolltop2: 0, scrolltop3: 0, act1: -1, act2: -1, act3: -1 });
const TreeData = ref([]);
const serverUrl = ref('');
const emit = defineEmits(['confirm'])
const typescroll = (e : number, i : number, v : object) => {
if (e == 1) {
scroll.act2 = -1;
scroll.act3 = -1;
scroll.scrolltop2 = 0;
scroll.scrolltop3 = 0;
if (scroll.act1 == i) {
scroll.act1 = -1;
getTreelnum()
return
}
}
if (e == 2) {
scroll.act3 = -1;
scroll.scrolltop3 = 0;
}
if (e == 3) {
}
scroll['act' + e] = i;
scroll['scrolltop' + e] = (i - 2) * 50;
getTreelnum()
}
onMounted(()=>{
serverUrl.value = uni.getStorageSync('serverUrl') + '/sys/common/static/';
getMaterial();
})
const num = ref(0)
const getTreelnum = ()=>{
let obj= {
nuId:uni.getStorageSync('nuId'),
categoryId:scroll.act1>-1?TreeData.value[scroll.act1].categoryId:'',
typeId:scroll.act2>-1?TreeData.value[scroll.act1].children[scroll.act2].typeId:'',
medicationId:scroll.act3>-1?TreeData.value[scroll.act1].children[scroll.act2].children[scroll.act3].medicationId:'',
}
getTreeDataWlnum(obj).then(res=>{
num.value = res.result.totalSize;
})
}
const getMaterial = () => {
getMaterialTreeData({'nuId':uni.getStorageSync('nuId')}).then(res => {
TreeData.value = res.result;
getTreelnum()
})
}
const config =()=>{
let obj= {
categoryId:scroll.act1>-1?TreeData.value[scroll.act1].categoryId:'',
typeId:scroll.act2>-1?TreeData.value[scroll.act1].children[scroll.act2].typeId:'',
medicationId:scroll.act3>-1?TreeData.value[scroll.act1].children[scroll.act2].children[scroll.act3].medicationId:'',
}
emit('confirm',obj)
}
const props = defineProps({
show: {
type: Boolean,
default:false,
required: true,
},
})
</script>
<style scoped lang="less">
.ifclass{
width: 36vw;
height: 85vh;
position: fixed;
z-index: 120;
background:rgba(255, 255, 255, 0.98);
box-shadow: 0rpx 0rpx 1.3vw 0rpx rgba(163,167,182,0.16);
border-radius: 1.6vw;
top: 10vh;
left: 32vw;
padding: 2.5vw 3vw;
.btnbotm{
width: 100%;
height: 4vw;
margin-top: 3vw;
display: flex;
justify-content: flex-end;
align-items: end;
.bt{
min-width: 8vw;
height: 3.8vw;
background: #EDEDEF;
border-radius: 1.6vw;
padding: 0 2vw;
margin-left: 1vw;
border: 1px solid #EDEDEF;
font-size: 1.8vw;
font-weight: 400;
color: #888888;
white-space: nowrap;
display: flex;
justify-content: center;
align-items: center;
}
.qd{
background: linear-gradient(0deg, #CAE0F9, #E9F4FF);
border: 1px solid rgba(3,133,250,0.34);
color: #0385FA;
text{
font-size: 1.4vw;
}
}
}
.scroltype {
width: 100%;
height: calc(85vh - 18vw);
display: flex;
justify-content: space-around;
.scrl1{
width: 9vw;
view {
width: 8.8vw;
}
}
.scrl2,.scrl3{
width: 8vw;
view {
width: 7.7vw;
}
}
.scroll-Y {
width: 8.5vw;
height: calc(85vh - 18vw);
view {
width: 100%;
height: 3.8vw;
background: #F5F5F8;;
border-radius: 1.9vw;
font-weight: 400;
font-size: 1.3vw;
color: #212327;
display: flex;
justify-content: center;
align-items: center;
padding: 0 0.4vw;
margin-bottom: .8vw;
text-align: center;
text {
white-space: nowrap;
}
>image {
width: 2vw;
height: 2vw;
}
}
.act {
background: #EAF5FF !important;
font-weight: 600;
color: #0385FA !important;
}
}
}
}
.toptype {
width: 100%;
height: 2vw;
display: flex;
justify-content: space-around;
margin: 1.4vw 0 .4vw 0;
.act {
background: rgba(255, 255, 255, 1) !important;
font-weight: 600;
color: #0385FA !important;
}
>view {
width: 7vw;
height: 1.9vw;
border-radius: 1vw;
display: flex;
justify-content: center;
align-items: center;
background: rgba(255, 255, 255, .5);
border:1px solid rgba(255, 255, 255, .5);
font-weight: 400;
font-size: 1.2vw;
color: #333333;
padding: 0;
}
}
.titletop{
width: 100%;
height: 2.5vw;
font-weight: bold;
font-size: 1.8vw;
color: #333333;
line-height: 2.5vw;
}
</style>

View File

@ -0,0 +1,972 @@
<template>
<view>
<view class="serchs">
<view class="ipt">
<input type="text" placeholder="物料名称/物料编码/物料简拼" v-model="form.wlParamInfo" />
<image src="/static/index/procurement/x.png" mode="aspectFill" v-if="form.wlParamInfo"
@click="search(0)"></image>
</view>
<view @click="search" class="scr">
检索
</view>
<view class="shx" @click="ification=true">
<image src="/static/index/procurement/sx.png" mode="aspectFill"></image>
筛选
</view>
</view>
<view class="kcyj">
<view class="kjlt">
库存预警
</view>
<scroll-view scroll-x="true" class="kcscrol guodu" :style="qb?'width:46.4vw':''"
scroll-with-animation :scroll-top="scrolltop" @scrolltolower="scrolltolower(1)">
<view class="yjbox" v-for="(v,i) in Material" :key="i">
<image :src="v.materialImg?serverUrl+v.materialImg:'/static/index/procurement/k.png'" mode="aspectFill"></image>
<view>{{v.materialName}}</view>
<text class="ytj" v-if="v.isAdd==1">已添加</text>
</view>
</scroll-view>
<view class="kjlt more guodu" :style="qb?'width:11.2vw':''">
<view @click="qb=!qb" class="righ0">
{{!qb?'更多':'收起'}}
<image src="/static/index/procurement/zjt.png" mode="aspectFill"></image>
</view>
<view class="guodu" :class="qb?'':'righ0'" @click="Invenshow = true">查看全部</view>
<view class="guodu" :class="qb?'':'righ0'">添加全部</view>
</view>
<view class="kaprght">
<view class="ksfw">
<view class="lcar">
<image :src="'/static/index/procurement/k.png'" mode="aspectFill"></image>
<view class="nm">纸尿裤-拉拉裤纸拉拉裤纸拉拉裤纸拉拉裤纸</view>
<view class="jx">
<image src="/static/index/procurement/l0.png" mode="aspectFill"></image>
<text>待进行</text>
</view>
</view>
<view class="rcar">
<view class="tm">10:00 - 10:10</view>
<view class="wul">物料采购</view>
<view class="zhxng">
<view>
<image src="/static/index/procurement/xz.png" mode="aspectFill"></image>
<text>协助执行</text>
</view>
<view>
<image src="/static/index/procurement/ap.png" mode="aspectFill"></image>
<text>王金福 / 李贵田</text>
</view>
</view>
<view class="shjs">
<view class="iacts">开始服务</view>
<view>服务结束</view>
</view>
</view>
</view>
</view>
</view>
<view class="listcard">
<scroll-view scroll-y="true" class="crdcroll" scroll-with-animation :scroll-top="scrolltop"
@scrolltolower="scrolltolower(2)">
<view class="fler">
<view class="carditem" 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.medicationName">{{v.medicationName}}</view>
</view>
</view>
<view class="msitem guodu" :style="v.zk?'margin-left:2.5vw':''">
<view>
<view>{{v.materialName}}</view><text>{{v.materialNo}}</text>
</view>
<view>
<text> 规格型号: {{v.specificationModel}}</text>
</view>
<view>
<text v-if="v.multiUnitType=='1'">采购单价: {{v.oneUnitPrice}} </text>
<text v-if="v.multiUnitType=='1'">采购单位: {{ v.oneUnit}}</text>
<text v-if="v.multiUnitType=='2'">采购单价: {{v.twoUnitPrice}} </text>
<text v-if="v.multiUnitType=='2'">采购单位: {{ v.twoUnit}}</text>
<text v-if="v.multiUnitType=='3'">采购单价: {{v.referenceUnitPrice}} </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="clkzk(v,index)">
<view v-if="v.isAdd==1">已添加</view>
<image class="guodu" :src="!v.zk?'/static/index/procurement/+.png':'/static/index/procurement/-.png'" mode="aspectFill"></image>
</view>
<view class="zkadd guodu" :class="v.zk?'':'zkf'">
<view>出入库</view>
<view @click="addcar(v,i)">加购物车</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>
<view class="fiedright">
<view>
<image src="/static/index/procurement/gc.png" mode="aspectFill"></image>
<text v-if="carnum>0">{{carnum>99?'99':carnum}}</text>
</view>
<view>
<image src="/static/index/procurement/cg.png" mode="aspectFill"></image>
</view>
</view>
<view class="mengban" v-if="addflag" @click="qk"></view>
<calculator :show="addflag" @jjnum="jjnum" :caigouobj="caigouobj"
:translateNumber="caigouobj?.Limitnum" :doOnce="caigouobj?.Limitnum
" @colse="qk" @right="right"></calculator>
<view class="mengban" v-if="ification" @click="qk"></view>
<classification @confirm="confirm" :show="ification"></classification>
<view class="mengban" v-if="Invenshow" @click="Invenshow = false"></view>
<Inventory @addcartory="addcartory" :show="Invenshow" :InvoicingList="Material" :status="statustory" @tolower="scrolltolower(1)"></Inventory>
</view>
</template>
<script setup lang="ts">
import { ref, onMounted, reactive, onBeforeUnmount, computed, nextTick, defineProps ,defineComponent} from 'vue';
import { queryInvoicingList,queryWlInfoByWlId,addShoppingCartList,queryShoppingCartList } from './api/lunpan.js'
import { onShow, onLoad, onHide, onPageScroll } from "@dcloudio/uni-app"
import calculator from './components/calculator.vue'
import classification from './components/classification.vue'
import Inventory from './components/Inventory.vue'
const qb = ref(false)
const addflag = ref(false)
const ification = ref(false)
const Invenshow = ref(false)
const InvoicingList = ref([]);
const caigouobj = ref({})
const status = ref('loading')
const statustory = ref('loading')
const scrolltop = ref(0)
const serverUrl = ref('')
const form = reactive({
nuId: uni.getStorageSync('nuId'),
pageNo: 1,
pageSize: 10,
categoryId: '',
typeId: '',
medicationId: '',
wlParamInfo: '',
isWaring: 0
})
const warn = reactive({
nuId: uni.getStorageSync('nuId'),
pageNo: 1,
pageSize: 10,
categoryId: '',
typeId: '',
medicationId: '',
wlParamInfo: '',
isWaring: 1
})
onLoad(() => {
serverUrl.value = uni.getStorageSync('serverUrl') + '/sys/common/static/';
queryInvo();
})
onShow(()=>{
shoppcar();
getWaringMaterial()
})
const Material = ref([])
const getWaringMaterial=()=>{
queryInvoicingList(warn).then(res => {
console.log(res.result)
res.result.records.forEach(item=>{
item.zk = false;
})
Material.value.push(...res.result.records);
statustory.value = (res.result.total == Material.value.length ? 'nomore' : 'loadmore')
setout1.value = (res.result.total == Material.value.length ? false : true)
})
}
const carnum = ref(0)
const shoppcar=()=>{
let c = {
nuId: form.nuId,
pageNo: 1,
pageSize: 10
}
queryShoppingCartList(c).then(resr=>{
console.log(resr.result.total)
carnum.value = resr.result.total
})
}
const setout1 = ref(true)
const setout2 = ref(true)
let times = null;
const scrolltolower = (t:number) => {
if(t==1){
if (setout1.value==false) { return }
setout1.value = false;
statustory.value = 'loading'
warn.pageNo++;
getWaringMaterial()
}else{
if (setout2.value==false) { return }
status.value = 'loading'
setout2.value = false;
form.pageNo++;
queryInvo()
}
// times = setTimeout(() => {
// setout.value = true
// }, 1000)
}
const qk = () =>{
ification.value = false;
addflag.value = false;
}
const confirm =(e:any)=>{
form.categoryId = e.categoryId;
form.typeId = e.typeId;
form.medicationId = e.medicationId;
form.pageNo=1;
InvoicingList.value = [];
queryInvo();
qk()
}
const search = (x : number) => {
if (x === 0) { form.wlParamInfo = '' }
form.pageNo = 1;
InvoicingList.value = [];
queryInvo();
}
const queryInvo = () => {
queryInvoicingList(form).then(res => {
res.result.records.forEach(item=>{
item.zk = false;
})
InvoicingList.value.push(...res.result.records);
status.value = (res.result.total == InvoicingList.value.length ? 'nomore' : 'loadmore')
setout2.value = (res.result.total == InvoicingList.value.length ? false : true)
})
}
const clkzk =(v:any,i:number)=>{
caigouobj.value = v;
caigouobj.value.Limitnum = Number(caigouobj.value?.upperLimit)-Number(caigouobj.value.kcsl);
InvoicingList.value.forEach((item,k)=>{
if(k==i){
item.zk = !item.zk;
}else{
item.zk = false;
}
})
}
const addcartory =(e:any)=>{
console.log(e)
caigouobj.value = e;
addflag.value = true;
}
const addcar = (v:any,i:number)=>{
addflag.value = true;
}
const jjnum = (e:number) =>{
let n = Number(caigouobj.value.upperLimit)-Number(caigouobj.value.kcsl)
if(n==caigouobj.value.Limitnum&&e==1){return}
if(caigouobj.value.Limitnum==1&&e==-1){return}
caigouobj.value.Limitnum+=e;
}
const right = (n:number,nm:any) => {
let d = Number(caigouobj.value.upperLimit)-Number(caigouobj.value.kcsl)
if(d>=n){
caigouobj.value.Limitnum = n;
}else{
caigouobj.value.Limitnum = d;
}
if(n<1){
caigouobj.value.Limitnum = 1;
}
connfig(nm)
}
const timers = ref(true)
const connfig = (nm:any) =>{
if(timers.value==false){return}
if(caigouobj.value.izEnabled=='1'){
uni.showToast({
icon:'none',
title:'该物料已关闭,无法采购~'
})
return
}
timers.value=false;
let dt = {
nuId:form.nuId,
purchaseQuantity:caigouobj.value.Limitnum,
suppliersId:nm.id,
suppliersName:nm.name,
wlId:caigouobj.value.wlId,
kcsl:caigouobj.value.kcsl
}
addShoppingCartList([dt]).then(res=>{
uni.showToast({
icon:res.success?'success':'none',
title:res.message
})
setTimeout(()=>{
timers.value=true;
if(res.success){
addflag.value = false;
shoppcar();
if(caigouobj.value.index){
Material.value[caigouobj.value.index].isAdd = 1
}
}
},700)
})
}
</script>
<style scoped lang="less">
.fiedright{
width: 5vw;
height: 12vw;
position: fixed;
z-index: 200;
right: 2vw;
bottom: 6vw;
display: flex;
flex-direction: column;
justify-content: space-between;
view{
width: 5vw;
height: 5vw;
background: rgba(255, 255, 255, 0.86);
border-radius: 50%;
border: 1px solid #D9DADC;
display: flex;
justify-content: center;
align-items: center;
position: relative;
text{
min-width: 1.8vw;
height: 1.8vw;
border-radius: 0.8vw;
border: 2px solid #E81D1D;
display: flex;
align-items: center;
justify-content: center;
padding: 0 0.5vw;
font-weight: 400;
font-size: 1.3vw;
color: #E81D1D;
position: absolute;
top: -0.8vw;
right:-0.8vw;
}
image{
width: 3.3vw;
height: 3.3vw;
}
}
}
.listcard {
width: 100%;
height: 70.3vh;
margin-top: 1vw;
.carditem {
width: 47vw;
height: 14.5vw;
background: rgba(255, 255, 255, 0.5);
border-radius: 1.6vw;
position: relative;
margin-bottom: 1.1vw;
display: flex;
overflow: hidden;
justify-content: flex-start;
.zkf{
right:-10vw !important;
}
.zkadd{
width: 10vw;
height: 100%;
display: flex;
justify-content: flex-end;
position: absolute;
top: 0;
right: 0;
view{
width: 5vw;
height: 100%;
font-weight: 400;
font-size: 1.3vw;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
&:nth-child(2){
background: #1083F8;
color: #fff;
padding: 1.1vw;
}
&:nth-child(1){
background: #C2C4C9;
color: #555555;
}
}
}
.add{
width: 6vw;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
>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;
text-align: center;
line-height: 1.75vw;
position: absolute;
top: 0.8vw;
right: 0.8vw;
}
image{
width: 3.2vw;
height: 3.2vw;
}
}
.msitem{
width: 25vw;
height: 100%;
padding: 1vw;
>view{
margin-top: 0.5vw;
&:nth-child(4){
width: 100%;
height: 3.4vw;
display: flex;
justify-content: space-between;
>view{
width: 33.3%;
height: 100%;
display: flex;
flex-direction: column;
position: relative;
align-items: center;
&:nth-child(1){
width: 30%;
text-align: left;
}
&:nth-child(2){
width: 40%;
text-align: center;
}
&:nth-child(3){
width: 30%;
text-align: 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.7vw;
color: #555555;
}
&:nth-child(2){
font-weight: 400;
font-size: 1.1vw;
color: #999999;
}
}
}
}
&:nth-child(2),&:nth-child(3){
display: flex;
justify-content: space-between;
text{
font-weight: 400;
font-size: 1.4vw;
color: #777777;
margin-top: 0.35vw;
}
}
&:nth-child(1){
display: flex;
justify-content: space-between;
align-items: center;
height: 2vw;
>view{
width: 19vw;
height: 2vw;
font-weight: bold;
font-size: 1.6vw;
color: #222222;
text-overflow:ellipsis;
overflow: hidden;
white-space: nowrap;
}
text{
width: 6vw;
font-weight: 300;
font-size: 1.4vw;
color: #222222;
}
}
}
}
.spleft{
margin-left: -15vw !important;
}
.speitem{
width: 15vw;
height: 100%;
display: flex;
flex-direction: column;
.cardp{
width: 12.5vw;
height: 4vw;
display: flex;
flex-wrap: wrap;
margin: 0 auto;
align-items: center;
view{
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;
}
}
>image{
width: 9vw;
height: 8vw;
margin: 1vw auto 0;
}
}
}
.crdcroll {
width: 100%;
height: 100%;
.fler {
display: grid;
grid-template-columns: 1fr 1fr;
}
}
}
.kcyj {
width: 100%;
height: 10vw;
display: flex;
margin-top: 1vw;
.kaprght {
width: 32vw;
height: 10vw;
margin-left: 0.6vw;
position: relative;
.ksfw {
width: 100%;
height: 14.5vw;
background: rgba(255, 255, 255, 0.6);
border-radius: 1vw;
border: 1px solid #D9DADC;
padding: 0 1vw;
position: absolute;
bottom: 0;
left: 0;
overflow: hidden;
display: flex;
.lcar {
width: 12.7vw;
position: relative;
image {
width: 10vw;
height: 10vw;
margin: 1vw auto 0;
display: block;
}
.nm {
width: 100%;
height: 1.4vw;
font-weight: 400;
font-size: 1.3vw;
color: #212327;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
padding: 0 1vw;
}
>.jx {
width: 4.6vw;
height: 1.9vw;
position: absolute;
top: 0.6vw;
right: 1vw;
font-weight: 400;
font-size: 1.1vw;
display: flex;
justify-content: center;
align-items: center;
line-height: 1.9vw;
>image {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 1;
}
>text {
position: relative;
z-index: 2;
color: #FFFFFF;
margin-top: 2vw;
}
}
}
.rcar {
width: 19vw;
}
.shjs {
width: 100%;
margin-top: 0.8vw;
display: flex;
justify-content: space-around;
view {
width: 7.2vw;
height: 2.5vw;
background: #E4E9F4;
border-radius: 1.25vw;
font-weight: 400;
font-size: 1.1vw;
color: #333333;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #E4E9F4;
}
.iacts {
background: rgba(168, 212, 255, .75);
border: 1px solid #A8D4FF;
color: #249BFA;
}
}
.zhxng {
width: 100%;
height: 2.8vw;
margin-top: 0.4vw;
display: flex;
padding: 1.1vw 0 1.1vw 0;
border-bottom: 2px solid #E5E5E5;
view {
display: flex;
align-items: center;
white-space: nowrap;
image {
width: 1.6vw;
height: 1.6vw;
margin-right: 0.3vw;
}
text {
font-weight: 400;
font-size: 1vw;
color: #555555;
margin-right: 0.5vw;
white-space: nowrap;
}
}
}
.wul {
width: 100%;
height: 1.5vw;
font-weight: bold;
font-size: 1.5vw;
color: #555555;
margin: 1vw auto 0;
}
.tm {
width: 100%;
height: 1.8vw;
font-size: 2.2vw;
font-weight: bolder;
color: #555555;
margin-top: 2vw;
}
}
}
.kjlt {
width: 3.2vw;
height: 10vw;
background: rgba(255, 255, 255, 0.5);
border-radius: 1.1vw;
writing-mode: vertical-rl;
align-items: center;
display: flex;
justify-content: center;
letter-spacing: 3px;
font-size: 1.4vw;
}
.more {
margin-left: 0.6vw;
position: relative;
background: RGBA(239, 240, 244, 1);
.righ0 {
right: 0 !important;
}
view {
writing-mode: vertical-rl;
align-items: center;
display: flex;
justify-content: center;
letter-spacing: 3px;
width: 3.2vw;
height: 10vw;
position: absolute;
top: 0;
border-radius: 1.1vw;
font-size: 1.4vw;
&:nth-child(1) {
letter-spacing: 6px;
padding-top: 2vw;
z-index: 5;
background: rgba(255, 255, 255, 1);
image {
width: 1.6vw;
height: 1.6vw;
margin-top: 10px;
}
}
&:nth-child(2) {
background: rgba(85, 166, 249, 1);
color: #FFFFFF;
right: 4.5vw;
z-index: 3;
}
&:nth-child(3) {
color: #888888;
background: #fff;
right: 8.5vw;
z-index: 2;
}
}
}
.zkw {
width: 46.4vw !important;
}
.kcscrol {
width: 54.4vw;
height: 10vw;
white-space: nowrap;
margin-left: 0.6vw;
.yjbox {
display: inline-block;
width: 14vw;
height: 10vw;
background: rgba(255, 255, 255, 0.5);
border-radius: 1.1vw;
margin-right: 0.6vw;
position: relative;
.ytj {
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;
text-align: center;
line-height: 1.75vw;
position: absolute;
top: 0.8vw;
right: 0.8vw;
}
image {
width: 7vw;
height: 7vw;
margin: 0.5vw auto 0.5vw;
display: block;
border-radius: 1vw;
}
>view {
width: 100%;
height: 1.4vw;
font-weight: 400;
font-size: 1.3vw;
color: #212327;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
padding: 0 1vw;
text-align: center;
}
}
}
}
.serchs {
width: 46.5vw;
height: 3.3vw;
border-radius: 1.6vw;
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 0.7vw;
.ipt {
display: flex;
align-items: center;
image {
width: 2.2vw;
height: 2.2vw;
margin-left: 0.5vw;
}
input {
width: 27vw;
height: 3.3vw;
font-size: 1.1vw;
padding-left: 1.6vw;
background: #E2E4E9;
border-radius: 1.65vw;
}
}
.scr {
border-radius: 1.65vw;
font-weight: 400;
font-size: 1.5vw;
color: #1083F8;
display: flex;
justify-content: center;
align-items: center;
width: 8vw;
height: 3.3vw;
background: linear-gradient(-45deg, rgba(223, 244, 252, 1), rgba(204, 228, 249, 0.43));
border: 1px solid #1083F8;
}
.shx {
width: 8.2vw;
height: 3.3vw;
background: #FFFFFF;
border-radius: 1.65vw;
border: 1px solid #D9DADC;
font-weight: 400;
font-size: 1.4vw;
color: #222;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 0.5rpx 5rpx 5rpx #dadee1;
image {
width: 1.5vw;
height: 1.3vw;
margin: 0 0.5vw;
}
}
}
.guodu {
transition: .4s;
-webkit-transform-style: preserve-3d;
-webkit-overflow-scrolling: touch;
}
.mengban {
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: 100;
background: RGBA(239, 240, 244, 0.55);
}
</style>
<style>
page {
background: RGBA(239, 240, 244, 1);
padding: 2vw;
box-sizing: border-box;
}
</style>

View File

@ -0,0 +1,180 @@
<template>
<view class="next-slide" :class="{'next-slide-disabled': disabled}">
<view class="next-slide-left" :style="'position: relative;left:'+left+'rpx'" @touchstart="ontouchstart"
@touchmove="ontouchmove" @touchend="ontouchend">
<slot></slot>
</view>
<view class="next-slide-right">
<view
class="next-btn-item"
v-for="(item,index) in btnGroup"
:key="index"
:style="getStyle(item)"
@click.stop="btnClick(item)">
{{item.name}}
</view>
</view>
</view>
</template>
<script>
const defBtnStyle = {
width: '100rpx',
bgColor: '#f9ae3d',
color: '#FFFFFF',
fontSize: '28rpx',
fontWeight: 300
};
export default {
name: 'NextSwipeAction',
props: {
btnGroup: {
type: Array,
default: () => {
return [{
name: '修改',
style: {
bgColor: '#f9ae3d'
}
}, {
name: '删除',
style: {
bgColor: '#ff4d4f'
}
}]
}
},
//
index: {
type: Number,
require: true,
default: 0
},
//
disabled: {
type: Boolean,
default: false
},
//
btnClickAutoReset: {
type: Boolean,
default: true
}
},
data() {
return {
x: 0,
left: 0,
operation: 0,
height: 0,
screenWidth: 0
};
},
mounted() {
this.$nextTick(res => {
const systemInfo = uni.getSystemInfoSync()
this.screenWidth = systemInfo.screenWidth
this.getBtnWidth()
this.getListHeight()
})
},
methods: {
getStyle(item) {
const style = item.style || {};
const styleStr = 'width:'+ (style.width || defBtnStyle.width) +
';height:100%;background-color:' + (style.bgColor || defBtnStyle.bgColor) +
';color:' + (style.color || defBtnStyle.color) +
';font-size:' + (style.fontSize || defBtnStyle.fontSize) +
'font-weight:' + (style.fontWeight || defBtnStyle.fontWeight);
return styleStr
},
btnClick(item) {
const it = Object.assign({}, item);
delete it.style;
this.$emit('btnClick', {
index: this.index,
item: it
})
if(this.btnClickAutoReset) {
this.reset()
}
},
//
reset() {
this.left = 0
},
getBtnWidth() {
const element = uni.createSelectorQuery().in(this).select(".next-slide-right");
element.boundingClientRect(rect => {
this.operation = this.px2rpx(rect.width, this.screenWidth)
}).exec()
},
getListHeight() {
const element = uni.createSelectorQuery().in(this).select(".next-slide-left");
element.boundingClientRect(rect => {
console.log(rect)
this.height = this.px2rpx(rect.height, this.screenWidth)
}).exec()
},
px2rpx(px, screenWidth) {
return px / (screenWidth / 750)
},
ontouchstart(e) {
if(this.disabled) return
this.x = this.px2rpx(e.touches[0].clientX, this.screenWidth)
},
ontouchmove(e) {
if(this.disabled) return
let clientX = this.x - this.px2rpx(e.touches[0].clientX, this.screenWidth)
if (clientX <= 0) this.left = 0
else if (this.operation <= clientX) this.left = this.operation * -1
else this.left = clientX * -1
},
ontouchend(e) {
if(this.disabled) return
let clientX = this.x - this.px2rpx(e.changedTouches[0].clientX, this.screenWidth)
this.left = clientX > this.operation / 2 ? this.operation * -1 : 0
},
}
}
</script>
<style scoped>
.next-slide {
width: 100%;
position: relative;
overflow: hidden;
}
.next-slide-disabled {
background-color: #333333;
opacity: 0.6;
}
.next-slide-left {
width: 100%;
overflow: hidden;
background-color: #FFFFFF;
transition: left 0.2s ease-in-out;
z-index: 999;
}
.next-slide-right {
position: absolute;
top: 0rpx;
right: 0;
z-index: 99;
display: flex;
align-items: center;
justify-content: flex-end;
height: 14.5vw;
}
.next-btn-item {
display: flex;
align-items: center;
justify-content: center;
width: 5vw;
padding: 1vw;
height: 100%;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -574,7 +574,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
)
]);
}
const camera = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__file", "D:/hldy_app_mini/pages/camera.nvue"]]);
const camera = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__file", "D:/项目/hldy_app_mini/pages/camera.nvue"]]);
export {
camera as default
};

View File

@ -577,7 +577,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
)
]);
}
const fullcamera = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__file", "D:/hldy_app_mini/pages/fullcamera.nvue"]]);
const fullcamera = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__file", "D:/项目/hldy_app_mini/pages/fullcamera.nvue"]]);
export {
fullcamera as default
};

File diff suppressed because one or more lines are too long