This commit is contained in:
wangweidong 2025-12-02 13:33:11 +08:00
parent 3e4b60aef7
commit 541c53ab4e
6 changed files with 128 additions and 49 deletions

View File

@ -33,5 +33,19 @@ export const wlzd = (params) => {
data: params,
})
}
export const queryGwcInfo = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/qld/queryGwcInfo`,
method: 'get',
data: params,
})
}
export const addGwc = (params) => {
return request({
url: `${uni.getStorageSync('serverUrl')}/api/pad/invoicing/qld/addGwc`,
method: 'post',
data: params,
})
}

View File

@ -5,13 +5,14 @@
请领物料
</view>
<scroll-view scroll-x="true" class="kcscrol guodu"
scroll-with-animation :scroll-top="scrolltop" @scrolltolower="scrolltolower(1)">
scroll-with-animation :scroll-top="scrollleft" @scrolltolower="scrolltolower(1)">
<view class="yjbox" v-for="(v,i) in Material" :key="i" @click="clickaddcar(v,i)">
<image :src="v.materialImg?serverUrl+v.materialImg:'/static/index/procurement/k.png'"
<image :src="v.materialInfo.materialImg?serverUrl+v.materialInfo.materialImg:'/static/index/procurement/k.png'"
mode="aspectFill"></image>
<view>{{v.materialName}}</view>
<view>{{v.materialInfo.materialName}}</view>
<text class="ytj" v-if="v.isAdd==1">已添加</text>
</view>
<defaultr cont="暂无数据" v-if="Material.length==0&&timeout" style="position: absolute;width: 10vw;height: 10vw;"></defaultr>
</scroll-view>
<view class="kjlt more guodu" :style="qb?'width:11.2vw':'' ">
<view @click="qb=!qb;moredex=0" class="righ0">
@ -30,17 +31,27 @@
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, computed, nextTick, defineProps, watch, reactive } from 'vue';
import defaultr from './default.vue'
const props = defineProps({
show: {
type: Boolean,
default:false,
required: true,
},
Material:{
type:Array,
required: true,
}
});
const scrollleft = ref(0)
watch(()=>props.Material,
()=>{
console.log(props.Material)
if(props.Material.length>5){
scrollleft.value = 100*props.Material.length
}
})
const timeout = ref(false)
onMounted(()=>{
setTimeout(()=>{
timeout.value = true
},500)
})
</script>
<style scoped lang="less">
@ -129,7 +140,7 @@
.yjbox {
display: inline-block;
width: 14vw;
width: 12vw;
height: 10vw;
background: rgba(255, 255, 255, 0.5);
border-radius: 1.1vw;

View File

@ -320,6 +320,7 @@
position: absolute;
left: 0;
top: 0;
z-index: 11;
image{
width: 100%;
height: 100%;

View File

@ -0,0 +1,44 @@
<template>
<view>
<view class="que" :style="style">
<image src="/static/index/procurement/que.png" mode="aspectFill"></image>
<view>{{cont}}</view>
</view>
</view>
</template>
<script>
export default {
props:{
cont:'',
style:{}
}
}
</script>
<style scoped lang="less">
.que{
width: 16vw;
height: 16vw;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
image{
width: 100%;
height: 100%;
}
view{
width: 100%;
text-align: center;
position: absolute;
bottom: 0.5vw;
left: 0;
font-weight: 300;
font-size: 1.4vw;
color: #555555;
}
}
</style>

View File

@ -32,7 +32,7 @@
</view>
</view>
<view class="qinggou-font">
数量 <text style="color: red;" v-if="sx==true">超过库存上限</text>
数量
</view>
<view class="stringShow-father">
<view class="jj" @click="jjnum(-1)" @longpress="handleTouchStart(-1)" @touchend="handleTouchEnd">
@ -44,7 +44,7 @@
</view>
</view>
<view class="jj" :style="sx==true?'background:#f8f8f8':''" @click="jjnum(1)" @longpress="handleTouchStart(1)" @touchend="handleTouchEnd">
<view class="jj" @click="jjnum(1)" @longpress="handleTouchStart(1)" @touchend="handleTouchEnd">
+
</view>
</view>
@ -85,52 +85,42 @@
}
})
const serverUrl = ref(uni.getStorageSync('serverUrl') + '/sys/common/static/')
const emit = defineEmits([ 'fill' ,'qingling'])
const emit = defineEmits([ 'fill' ,'right'])
const showbox = ref(false)
watch(()=>props.show,
()=>{
console.log(props.objtake)
if(props.show==true){
relNumber.value = 1;
stringShow.value = toFixed4ByPadStart(relNumber.value)
setTimeout(()=>{
showbox.value = true
},50)
}else{
showbox.value = false
showbox.value = false;
isZero.value = false;
}
})
const sx = ref(false)
const cy=()=>{
let num = Number(props.caigouobj.upperLimit)-Number(props.caigouobj.kcsl);
let bl = relNumber.value*type.value.num
if(bl>num){
sx.value = true
}else{
sx.value = false
}
console.log(sx.value,num,bl)
}
const calculatorArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, "AC", 0, "AE"];
const stringShow = ref("0000");
const relNumber = ref(0);
const relNumber = ref(1);
const isZero = ref(false);
const clickKuai = (item : any, index : number) => {
if (item == "AC") {
relNumber.value = 0;
stringShow.value = "0000";
cy()
return
}
if (item == "AE") {
relNumber.value = Math.trunc(relNumber.value / 10)
stringShow.value = toFixed4ByPadStart(relNumber.value);
cy()
return
}
if(isZero.value == false){
isZero.value = true;
relNumber.value = item;
stringShow.value = toFixed4ByPadStart(relNumber.value);
cy()
return
}
if (digitCountByString(relNumber.value) > 3) {
@ -141,7 +131,6 @@
} else {
relNumber.value = relNumber.value * 10 + item;
}
cy()
stringShow.value = toFixed4ByPadStart(relNumber.value)
}
}
@ -159,28 +148,15 @@
}, 120);
}
const jjnum = (e:number)=>{
let num = Number(props.caigouobj.upperLimit)-Number(props.caigouobj.kcsl);
let m = Math.floor(num/type.value.num)
if(m<=relNumber.value&&e==1){relNumber.value = m; return}
let num = 9999;
if(relNumber.value>=num&&e==1){relNumber.value = num; return}
if(relNumber.value<=1&&e==-1){relNumber.value = 1; return}
relNumber.value+=e;
stringShow.value = toFixed4ByPadStart(relNumber.value)
cy()
// emit('jjnum',e)
}
const closeIt = () => {
if(relNumber.value<1){
uni.showToast({
title:'采购数量不能为0',
icon:'none'
})
return
}
emit('right', relNumber.value,gysarr.value[gysidnum.value],type.value)
}
const colse = ()=>{
emit('colse')
emit('right', relNumber.value,props.objtake )
}
function digitCountByString(n) {
const s = Math.abs(n).toString();

View File

@ -43,9 +43,9 @@
</view>
</view>
</view>
<addwl></addwl>
<addwl :Material="addMaterial"></addwl>
<carditem :InvoicingList="listarr" @scrolltolower="scrolltolower" :status="status" @comfig="comfig"></carditem>
<takeing :show="takeshow" :objtake="objtake" @fill="takeshow = false"></takeing>
<takeing :show="takeshow" :objtake="objtake" @fill="takeshow = false" @right="right"></takeing>
<cgdclass @confirm="confirm" :show="ification" :typenum="0" ref="classication" @fill="ification = false"></cgdclass>
<medetails :show="detaishow" @fill="detaishow = false" @confirm="confirm" :objtake="objtake"></medetails>
</view>
@ -53,7 +53,7 @@
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, computed, nextTick, defineProps, watch, reactive } from 'vue';
import { queryInvoicingList,wlzd } from '../api/api.js'
import { queryInvoicingList,wlzd,queryGwcInfo,addGwc } from '../api/api.js'
import addwl from '../common/addwl.vue';
import carditem from '../common/carditem.vue';
import takeing from '../common/takeing.vue';
@ -76,7 +76,19 @@
const classication = ref<InstanceType<typeof ChildComponent>>()
onMounted(()=>{
config()
wuliao()
})
const addMaterial = ref([])
const wuliao = () =>{
let obj = {
nuId:form.nuId,
elderId:form.elderId
}
queryGwcInfo(obj).then(res=>{
console.log(res)
addMaterial.value = res.result
})
}
const listarr = ref([])
const status = ref('loadmore')
const config = ()=>{
@ -88,7 +100,7 @@
})
listarr.value.push(...res.result.records)
status.value = (res.result.total == listarr.value.length ? 'nomore' : 'loadmore')
console.log(res,status.value,listarr.value.length)
console.log( status.value )
})
}
const scrolltolower = ( ) => {
@ -140,6 +152,27 @@
break;
}
}
const right = (e,v) =>{
let obj = {
kfId:v.id,
wlId:v.wlId,
qlNum:e,
nuId:form.nuId,
elderId:form.elderId
}
addGwc(obj).then(res=>{
console.log(res)
if(res.success){
takeshow.value = false;
wuliao();
}else{
uni.showToast({
icon:'none',
title:res.message
})
}
})
}
const confirm = (e)=>{
form.categoryId = e.categoryId;
form.typeId = e.typeId;