This commit is contained in:
parent
3e4b60aef7
commit
541c53ab4e
|
|
@ -33,5 +33,19 @@ export const wlzd = (params) => {
|
||||||
data: 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,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,14 @@
|
||||||
请领物料
|
请领物料
|
||||||
</view>
|
</view>
|
||||||
<scroll-view scroll-x="true" class="kcscrol guodu"
|
<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)">
|
<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>
|
mode="aspectFill"></image>
|
||||||
<view>{{v.materialName}}</view>
|
<view>{{v.materialInfo.materialName}}</view>
|
||||||
<text class="ytj" v-if="v.isAdd==1">已添加</text>
|
<text class="ytj" v-if="v.isAdd==1">已添加</text>
|
||||||
</view>
|
</view>
|
||||||
|
<defaultr cont="暂无数据" v-if="Material.length==0&&timeout" style="position: absolute;width: 10vw;height: 10vw;"></defaultr>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<view class="kjlt more guodu" :style="qb?'width:11.2vw':'' ">
|
<view class="kjlt more guodu" :style="qb?'width:11.2vw':'' ">
|
||||||
<view @click="qb=!qb;moredex=0" class="righ0">
|
<view @click="qb=!qb;moredex=0" class="righ0">
|
||||||
|
|
@ -30,17 +31,27 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, onBeforeUnmount, computed, nextTick, defineProps, watch, reactive } from 'vue';
|
import { ref, onMounted, onBeforeUnmount, computed, nextTick, defineProps, watch, reactive } from 'vue';
|
||||||
|
import defaultr from './default.vue'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
show: {
|
|
||||||
type: Boolean,
|
|
||||||
default:false,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
Material:{
|
Material:{
|
||||||
type:Array,
|
type:Array,
|
||||||
required: true,
|
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>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
|
|
@ -129,7 +140,7 @@
|
||||||
|
|
||||||
.yjbox {
|
.yjbox {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 14vw;
|
width: 12vw;
|
||||||
height: 10vw;
|
height: 10vw;
|
||||||
background: rgba(255, 255, 255, 0.5);
|
background: rgba(255, 255, 255, 0.5);
|
||||||
border-radius: 1.1vw;
|
border-radius: 1.1vw;
|
||||||
|
|
|
||||||
|
|
@ -320,6 +320,7 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
z-index: 11;
|
||||||
image{
|
image{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="qinggou-font">
|
<view class="qinggou-font">
|
||||||
数量 <text style="color: red;" v-if="sx==true">超过库存上限!</text>
|
数量
|
||||||
</view>
|
</view>
|
||||||
<view class="stringShow-father">
|
<view class="stringShow-father">
|
||||||
<view class="jj" @click="jjnum(-1)" @longpress="handleTouchStart(-1)" @touchend="handleTouchEnd">
|
<view class="jj" @click="jjnum(-1)" @longpress="handleTouchStart(-1)" @touchend="handleTouchEnd">
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</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>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -85,52 +85,42 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const serverUrl = ref(uni.getStorageSync('serverUrl') + '/sys/common/static/')
|
const serverUrl = ref(uni.getStorageSync('serverUrl') + '/sys/common/static/')
|
||||||
const emit = defineEmits([ 'fill' ,'qingling'])
|
const emit = defineEmits([ 'fill' ,'right'])
|
||||||
const showbox = ref(false)
|
const showbox = ref(false)
|
||||||
watch(()=>props.show,
|
watch(()=>props.show,
|
||||||
()=>{
|
()=>{
|
||||||
console.log(props.objtake)
|
|
||||||
if(props.show==true){
|
if(props.show==true){
|
||||||
|
relNumber.value = 1;
|
||||||
|
stringShow.value = toFixed4ByPadStart(relNumber.value)
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
showbox.value = true
|
showbox.value = true
|
||||||
},50)
|
},50)
|
||||||
}else{
|
}else{
|
||||||
showbox.value = false
|
showbox.value = false;
|
||||||
|
isZero.value = false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const sx = ref(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 calculatorArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, "AC", 0, "AE"];
|
||||||
const stringShow = ref("0000");
|
const stringShow = ref("0000");
|
||||||
const relNumber = ref(0);
|
const relNumber = ref(1);
|
||||||
const isZero = ref(false);
|
const isZero = ref(false);
|
||||||
const clickKuai = (item : any, index : number) => {
|
const clickKuai = (item : any, index : number) => {
|
||||||
if (item == "AC") {
|
if (item == "AC") {
|
||||||
relNumber.value = 0;
|
relNumber.value = 0;
|
||||||
stringShow.value = "0000";
|
stringShow.value = "0000";
|
||||||
cy()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (item == "AE") {
|
if (item == "AE") {
|
||||||
relNumber.value = Math.trunc(relNumber.value / 10)
|
relNumber.value = Math.trunc(relNumber.value / 10)
|
||||||
stringShow.value = toFixed4ByPadStart(relNumber.value);
|
stringShow.value = toFixed4ByPadStart(relNumber.value);
|
||||||
cy()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(isZero.value == false){
|
if(isZero.value == false){
|
||||||
isZero.value = true;
|
isZero.value = true;
|
||||||
relNumber.value = item;
|
relNumber.value = item;
|
||||||
stringShow.value = toFixed4ByPadStart(relNumber.value);
|
stringShow.value = toFixed4ByPadStart(relNumber.value);
|
||||||
cy()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (digitCountByString(relNumber.value) > 3) {
|
if (digitCountByString(relNumber.value) > 3) {
|
||||||
|
|
@ -141,7 +131,6 @@
|
||||||
} else {
|
} else {
|
||||||
relNumber.value = relNumber.value * 10 + item;
|
relNumber.value = relNumber.value * 10 + item;
|
||||||
}
|
}
|
||||||
cy()
|
|
||||||
stringShow.value = toFixed4ByPadStart(relNumber.value)
|
stringShow.value = toFixed4ByPadStart(relNumber.value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -159,28 +148,15 @@
|
||||||
}, 120);
|
}, 120);
|
||||||
}
|
}
|
||||||
const jjnum = (e:number)=>{
|
const jjnum = (e:number)=>{
|
||||||
let num = Number(props.caigouobj.upperLimit)-Number(props.caigouobj.kcsl);
|
let num = 9999;
|
||||||
let m = Math.floor(num/type.value.num)
|
if(relNumber.value>=num&&e==1){relNumber.value = num; return}
|
||||||
if(m<=relNumber.value&&e==1){relNumber.value = m; return}
|
|
||||||
if(relNumber.value<=1&&e==-1){relNumber.value = 1; return}
|
if(relNumber.value<=1&&e==-1){relNumber.value = 1; return}
|
||||||
relNumber.value+=e;
|
relNumber.value+=e;
|
||||||
stringShow.value = toFixed4ByPadStart(relNumber.value)
|
stringShow.value = toFixed4ByPadStart(relNumber.value)
|
||||||
cy()
|
|
||||||
// emit('jjnum',e)
|
// emit('jjnum',e)
|
||||||
}
|
}
|
||||||
const closeIt = () => {
|
const closeIt = () => {
|
||||||
if(relNumber.value<1){
|
emit('right', relNumber.value,props.objtake )
|
||||||
uni.showToast({
|
|
||||||
title:'采购数量不能为0!',
|
|
||||||
icon:'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
emit('right', relNumber.value,gysarr.value[gysidnum.value],type.value)
|
|
||||||
}
|
|
||||||
const colse = ()=>{
|
|
||||||
emit('colse')
|
|
||||||
}
|
}
|
||||||
function digitCountByString(n) {
|
function digitCountByString(n) {
|
||||||
const s = Math.abs(n).toString();
|
const s = Math.abs(n).toString();
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,9 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<addwl></addwl>
|
<addwl :Material="addMaterial"></addwl>
|
||||||
<carditem :InvoicingList="listarr" @scrolltolower="scrolltolower" :status="status" @comfig="comfig"></carditem>
|
<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>
|
<cgdclass @confirm="confirm" :show="ification" :typenum="0" ref="classication" @fill="ification = false"></cgdclass>
|
||||||
<medetails :show="detaishow" @fill="detaishow = false" @confirm="confirm" :objtake="objtake"></medetails>
|
<medetails :show="detaishow" @fill="detaishow = false" @confirm="confirm" :objtake="objtake"></medetails>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, onBeforeUnmount, computed, nextTick, defineProps, watch, reactive } from 'vue';
|
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 addwl from '../common/addwl.vue';
|
||||||
import carditem from '../common/carditem.vue';
|
import carditem from '../common/carditem.vue';
|
||||||
import takeing from '../common/takeing.vue';
|
import takeing from '../common/takeing.vue';
|
||||||
|
|
@ -76,7 +76,19 @@
|
||||||
const classication = ref<InstanceType<typeof ChildComponent>>()
|
const classication = ref<InstanceType<typeof ChildComponent>>()
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
config()
|
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 listarr = ref([])
|
||||||
const status = ref('loadmore')
|
const status = ref('loadmore')
|
||||||
const config = ()=>{
|
const config = ()=>{
|
||||||
|
|
@ -88,7 +100,7 @@
|
||||||
})
|
})
|
||||||
listarr.value.push(...res.result.records)
|
listarr.value.push(...res.result.records)
|
||||||
status.value = (res.result.total == listarr.value.length ? 'nomore' : 'loadmore')
|
status.value = (res.result.total == listarr.value.length ? 'nomore' : 'loadmore')
|
||||||
console.log(res,status.value,listarr.value.length)
|
console.log( status.value )
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const scrolltolower = ( ) => {
|
const scrolltolower = ( ) => {
|
||||||
|
|
@ -140,6 +152,27 @@
|
||||||
break;
|
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)=>{
|
const confirm = (e)=>{
|
||||||
form.categoryId = e.categoryId;
|
form.categoryId = e.categoryId;
|
||||||
form.typeId = e.typeId;
|
form.typeId = e.typeId;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue