This commit is contained in:
wangweidong 2025-11-19 11:09:47 +08:00
parent aa52f6bbfa
commit 6cb384e20b
2 changed files with 247 additions and 152 deletions

View File

@ -20,7 +20,7 @@
<!-- 采购增加层级高度方便点击 -->
</view>
</view>
<view class="annotation" :class="'annotation'+(i+1)" v-for="(v,i) in ['付款','采购','拣货','完结','护理单元','监控室']"
<view class="annotation" :class="'annotation'+(i+1)" v-for="(v,i) in ['付款','采购','拣货','完结','护理单元','监控室','请领出库','退货入库']"
:key='i' @click="onlyjump(i)">
<view> </view>
<view class="tp">
@ -59,10 +59,53 @@
},
});
const housedex = ref(-1);
const forthmenuIndex = ref<number>(0);
const lastTap = ref(0)
const DOUBLE_TAP_DELAY = 300;
const setout = ref(null)
const housactive = (index : number) => {
console.log("点击哪个了",index)
if (index > 5) { return }
housedex.value = index;
const now = Date.now()
forthmenuIndex.value = i
if (now - lastTap.value < DOUBLE_TAP_DELAY) {
//
clearTimeout(setout.value)
if (index == 1) {
navurl.value = 'pages/procurement/material'
uni.navigateTo({
url: '/' + navurl.value
})
}
if (index == 2) {
navurl.value = 'pages/Warehouse/picking'
uni.navigateTo({
url: '/' + navurl.value
})
}
if (index == 3) {
navurl.value = 'pages/Warehouse/finish'
uni.navigateTo({
url: '/' + navurl.value
})
}
//
lastTap.value = 0
} else {
setout.value = setTimeout(()=>{
console.log("点击哪个了",index)
if (index === 5) {
uni.navigateTo({
url: "/pages/watch/full"
})
}
},DOUBLE_TAP_DELAY)
//
lastTap.value = now
}
if(housedex.value == index){
if (housedex.value == 0) {
navurl.value = 'pages/Warehouse/paymoney'
@ -70,34 +113,10 @@
url: '/' + navurl.value
})
}
if (housedex.value == 1) {
navurl.value = 'pages/procurement/material'
uni.navigateTo({
url: '/' + navurl.value
})
}
if (housedex.value == 2) {
navurl.value = 'pages/Warehouse/picking'
uni.navigateTo({
url: '/' + navurl.value
})
}
if (housedex.value == 3) {
navurl.value = 'pages/Warehouse/finish'
uni.navigateTo({
url: '/' + navurl.value
})
}
return
}
housedex.value = index;
// console.log("index", index)
// .....
if (index === 5) {
uni.navigateTo({
url: "/pages/watch/full"
})
}
}
onMounted(() => {
housedex.value = 1
@ -512,6 +531,14 @@
top: 24vw;
right: 6vw;
}
.annotation7 {
top: 62vh;
left: 40vw;
}
.annotation8 {
top: 5vh;
left: 28vw;
}
// title
.annotation {

View File

@ -39,7 +39,7 @@
<view style="width: 100%;margin-top: 50rpx;font-size: 30rpx;">
采购单价:
<text style="color: #888888;">
1.50
{{ gaijia }}
</text>
</view>
@ -47,17 +47,17 @@
<view style="font-size: 30rpx;margin-bottom: 10rpx;">
到货单价
</view>
<view class="gray-input">
¥1500.00
<view class="gray-input" style="width: 410rpx;">
¥ {{ gaijia }}
</view>
</view>
<view style="position: absolute;right: 30rpx;bottom: 30rpx;">
<view style="display: flex;">
<view
<view @click="opengaijia=false"
style="width: 160rpx;height: 75rpx;background-color: #ebeced;color: #888888;display: flex;justify-content: center;align-items: center;font-size: 30rpx;border-radius: 40rpx;">
取消
</view>
<view
<view @click="dogaijia"
style="width: 160rpx;height: 75rpx;;color: #0385FA;display: flex;justify-content: center;align-items: center;font-size: 30rpx;border-radius: 40rpx;border: 1rpx solid #0385FA;background: linear-gradient(to bottom,#E9F4FF,#CAE0F9);margin: 0 40rpx;">
确定
</view>
@ -66,50 +66,50 @@
</view>
<view class="jianhuo-jianpan" style="right: -40rpx;bottom: 150rpx;">
<view style="display: flex;width: 480rpx;">
<view class="gray-button-jianpan">
<view class="gray-button-jianpan" @click="press('1')">
1
</view>
<view class="gray-button-jianpan">
<view class="gray-button-jianpan" @click="press('2')">
2
</view>
<view class="gray-button-jianpan">
<view class="gray-button-jianpan" @click="press('3')">
3
</view>
</view>
<view style="display: flex;width: 480rpx;">
<view class="gray-button-jianpan">
<view class="gray-button-jianpan" @click="press('4')">
4
</view>
<view class="gray-button-jianpan">
<view class="gray-button-jianpan" @click="press('5')">
5
</view>
<view class="gray-button-jianpan">
<view class="gray-button-jianpan" @click="press('6')">
6
</view>
</view>
<view style="display: flex;width: 480rpx;">
<view class="gray-button-jianpan">
<view class="gray-button-jianpan" @click="press('7')">
7
</view>
<view class="gray-button-jianpan">
<view class="gray-button-jianpan" @click="press('8')">
8
</view>
<view class="gray-button-jianpan">
<view class="gray-button-jianpan" @click="press('9')">
9
</view>
</view>
<view style="display: flex;width: 480rpx;">
<view class="gray-button-jianpan">
<view class="gray-button-jianpan" @click="press('AC')">
AC
</view>
<view class="gray-button-jianpan">
<view class="gray-button-jianpan" @click="press('0')">
0
</view>
<view class="gray-button-jianpan">
<view class="gray-button-jianpan" @click="press('.')">
.
</view>
</view>
@ -234,7 +234,7 @@
<image style="width: 100%;height: 100%;" :src="item?item:'/static/zhanwei.png'" mode="aspectFill"
@click="previewImage(item,index,albumlist)" />
</view>
<view style="width: 40%;height: 150rpx;margin-right: 4%;margin-top: 3%;">
<view style="width: 40%;height: 150rpx;margin-right: 4%;margin-top: 3%;" v-if="albumlist.length<4" @click="uplod">
<view style="
width: 100%;
height: 100%;
@ -244,8 +244,7 @@
align-items: center;
background-color:#fafdff ;
border: 1rpx solid #c4ebff;
border-radius: 20rpx;" v-if="albumlist.length<4" @click="uplod">
border-radius: 20rpx;">
<image style="width: 50rpx;height: 50rpx;margin-bottom: 5rpx;"
src="/static/index/warehouse/procurement/picking/addphoto.png" />
<view style="color: #78B1EB;font-size: 25rpx;">
@ -263,7 +262,8 @@
</view>
</view>
<view style="display: flex;margin-top: 30rpx;margin-left: 20rpx;">
<view class="gray-button" @click="jjnum(-1)" @longpress="handleTouchStart(-1)" @touchend="handleTouchEnd">
<view class="gray-button" @click="jjnum(-1)" @longpress="handleTouchStart(-1)"
@touchend="handleTouchEnd">
-
</view>
<view class="gray-input" style="width:12vw;">
@ -379,7 +379,6 @@
</view>
</view>
<view class="photowall-other-one" v-if="topbuttontarget==1">
<view
style="width: 100%;height: 70%;display: flex;flex-direction: column;justify-content: center;align-items: center;background-color:#fafdff ;border: 1rpx solid #78B1EB;border-radius: 30rpx;">
<image style="width: 70rpx;height: 70rpx;margin-bottom: 5rpx;"
@ -579,7 +578,7 @@
</view>
<view class="pls-card-middle-one">
<view class="middle-title">
</view>
<view class="middle-heng-father">
<view class="middle-heng"
@ -643,10 +642,10 @@
随行单
</view>
</view>
<view :class="lefttarget==1?`contain-right-button`: `contain-right-button-bad`"
style="border-color: #D9DADC;box-shadow: 0 1rpx 3rpx #D9DADC;">
<view :class="!Number(plsbuy[lefttarget]?.status)?`contain-right-button`: `contain-right-button-bad`"
style="border-color: #D9DADC;box-shadow: 0 1rpx 3rpx #D9DADC;" @click="bebad">
<image class="buttont-img"
:src="`/static/index/warehouse/procurement/picking/bebad${lefttarget==1?``:`target`}.png`" />
:src="`/static/index/warehouse/procurement/picking/bebad${!Number(plsbuy[lefttarget]?.status)?``:`target`}.png`" />
<view class="button-font">
作废
</view>
@ -1072,32 +1071,77 @@
</view>
</view>
<view class="mengban" v-if="open>0" @click="open = 0"> </view>
<view class="mengban" v-if="open==1"> </view>
<equiment :open="open==1" @del="del()" @back="open = 0" :content="'是否删除此图片?'"></equiment>
<equiment :open="open==2" @del="sctp(1)" @back="open = 0" :content="'是否销账此物料?'"></equiment>
</view>
</template>
<script setup lang="ts">
import { ref, onMounted, reactive, onBeforeUnmount, computed, nextTick, defineProps, onUnmounted } from 'vue';
import { pickingInfo,queryInvoicingList, getCgdMaterialTreeData, queryNuInfoByNuId, updateKfstatus, queryCgdList, queryCgdInfoList, queryWlInfoByWlId, voidedCgdMain, getCgrLis, getGysList, upload } from './api/lunpan.js'
import { queryInvoicingList, getCgdMaterialTreeData, queryNuInfoByNuId, updateKfstatus, queryCgdList, queryCgdInfoList, queryWlInfoByWlId, voidedCgdMain, getCgrLis, getGysList, upload, editPrice, pickingInfo } from './api/lunpan.js'
import { onShow, onLoad, onHide, onPageScroll } from "@dcloudio/uni-app"
import calendar from '@/component/public/calendar.vue'
import superpicker from '@/component/public/superpicker.vue'
import equiment from './components/equiment.vue';
const open = ref(0);
const typechange = ref(0);
const stringjh = ref(0)
const stringjh = ref("")
const serverUrl = ref("");
const opengaijia = ref(false);
const openjianhuo = ref(false);
const opendata = ref(false);
const gaijia = ref("");
//
const dogaijia = () => {
// console.log("????",showvalue.value.id,gaijia.value)
editPrice({ id: showvalue.value.id, arrivalPrice: gaijia.value }).then((res) => {
// console.log("", showvalue.value.id,gaijia.value)
// console.log("res", res)
if (res.code == 200) {
showvalue.value.arrivalPrice = gaijia.value;
opengaijia.value = false;
}
})
}
//
function press(k : string) {
if (k === 'AC') {
gaijia.value = ''
return
}
//
if (k === '.') {
if (!gaijia.value.includes('.')) {
gaijia.value = gaijia.value === '' ? '0.' : gaijia.value + '.'
}
return
}
//
if (/^\d$/.test(k)) {
//
if (gaijia.value.includes('.')) {
const [i, d] = gaijia.value.split('.')
if ((d || '').length < 2) gaijia.value += k
return
}
// 4
let intPart = gaijia.value
if (intPart === '0') intPart = '' // 01
if (intPart.length < 4) gaijia.value = intPart + k
}
}
//
const gysclick = (res : any) => {
console.log("///", res);
opengys.value = false;
}
const openjianhuoclick = () => {
if (showvalue.value.jianhuobtn == false) {
return
@ -1109,9 +1153,9 @@
donghuaopo.value = true;
}, 100)
}
const opengaijiaclick = () => {
opengaijia.value = true;
gaijia.value = (showvalue.value.arrivalPrice ? showvalue.value.arrivalPrice : showvalue.value.procurementPrice).toString()
donghuaopo.value = false;
setTimeout(() => {
donghuaopo.value = true;
@ -1247,6 +1291,7 @@
const opencgr = ref(false);
const opengys = ref(false);
const cgrlist = ref([]);
const gyslist = ref([]);
@ -1256,6 +1301,7 @@
})
getGysList().then((res : any) => {
gyslist.value = res.result;
console.log("isright", res)
})
}
@ -1319,10 +1365,12 @@
queryCgdList(plzinfo).then((res : any) => {
plsbuy.value.push(...res.result.records)
alltotal.value = res.result.total
console.log("请购单数据呢???", res)
if (res.result.records.length) {
form.cgdId = plsbuy.value[0].id
queryInvo();
queryInvo(0);
}
if (res.result.records.length < plzinfo.pageSize) {
plzinfo.canpull = false;
}
@ -1360,7 +1408,15 @@
form.cgdId = plsbuy.value[index].id
form.pageNo = 1
form.canpull = true;
queryInvo()
// console.log("!!!!",form)
queryCgdInfoList(form).then(res => {
InvoicingList.value = []
// console.log("", res.result.records)
InvoicingList.value.push(...res.result.records);
if (form.pageNo) {
clickmiddle(0);
}
})
}
const showvalue = ref({
materialImg: ""
@ -1408,10 +1464,10 @@
}
const InvoicingList = ref([])
const queryInvo = () => {
queryCgdInfoList(form).then(res => {
InvoicingList.value=res.result.records;
clickmiddle(0);
const queryInvo = (index:number) => {
queryCgdInfoList(form).then(res => {
InvoicingList.value=res.result.records;
clickmiddle(index);
})
}
const search = () => {
@ -1423,7 +1479,7 @@
alltotal.value = res.result.total
if (res.result.records.length) {
form.cgdId = plsbuy.value[0].id
queryInvo();
queryInvo(0);
}
if (res.result.records.length < plzinfo.pageSize) {
plzinfo.canpull = false;
@ -1436,21 +1492,21 @@
}
const moreindex = ref(-1);
const zuofeiindex = ref(-1);
const openmore = (index : number) => {
zuofeiindex.value = index;
if (plsbuy.value[index].cgdType == '9') {
setTimeout(() => {
uni.showToast({
title: '该采购单已作废',
icon: 'error', //
duration: 2000
})
}, 300)
// const openmore = (index : number) => {
// zuofeiindex.value = index;
// if (plsbuy.value[index].cgdType == '9') {
// setTimeout(() => {
// uni.showToast({
// title: '',
// icon: 'error', //
// duration: 2000
// })
// }, 300)
} else {
moreindex.value = index;
}
}
// } else {
// moreindex.value = index;
// }
// }
const shareShow = ref(false);
const deletedownisopacity = ref(false)
const share = () => {
@ -1481,13 +1537,21 @@
const badshow = ref(false);
const donghuacs = ref(false)
const bebad = () => {
badshow.value = true;
moreindex.value = -1;
donghuacs.value = false;
setTimeout(() => donghuacs.value = true, 50)
// console.log("ceshi",Number(plsbuy.value[lefttarget.value]?.status))
// console.log("right?",plsbuy.value[lefttarget.value])
if (!Number(plsbuy.value[lefttarget.value]?.status) && plsbuy.value.length) {
badshow.value = true;
moreindex.value = -1;
donghuacs.value = false;
setTimeout(() => donghuacs.value = true, 50)
}
// return
}
const zuofei = () => {
voidedCgdMain({ id: plsbuy.value[zuofeiindex.value].id }).then((res : any) => {
voidedCgdMain({ id: plsbuy.value[lefttarget.value].id }).then((res : any) => {
// console.log("res", res)
if (res.success) {
uni.showToast({
title: res.message,
@ -1509,6 +1573,7 @@
donghuaopo.value = false;
setTimeout(() => {
donghuaopo.value = true;
console.log("zzz", donghuaopo.value)
}, 100)
}
//
@ -1518,17 +1583,17 @@
count: 1, //9
sizeType: ['compressed'], //
sourceType: ['camera'], //
crop:{
quality:60
crop: {
quality: 60
},
success: (e) => {
let ar = JSON.stringify(e.tempFilePaths)
uni.compressImage({
src: JSON.parse(ar)[0],
quality: 60,
success: res => {
albumlist.value.push(res.tempFilePath)
}
src: JSON.parse(ar)[0],
quality: 60,
success: res => {
albumlist.value.push(res.tempFilePath)
}
})
}
});
@ -1547,7 +1612,6 @@
deldex.value = -1;
open.value = 0;
}
//
const clickflag = ref(false);
const clknum = (item : any) => {
// showvalue.value.maxnum = showvalue.value.purchaseQuantity : showvalue.value.wrksl
@ -1563,7 +1627,7 @@
return
}
if(clickflag.value==true){
if (clickflag.value == true) {
showvalue.value.num = item;
clickflag.value = false;
stringjh.value = toFixed4ByPadStart(showvalue.value.num)
@ -1581,100 +1645,102 @@
}
}
//
const digitCountByString=(n)=> {
const digitCountByString = (n) => {
const s = Math.abs(n).toString();
return s.length;
}
//
const toFixed4ByPadStart = (n) => {
const intPart = Math.floor(Math.abs(n));
return String(intPart).padStart(4, '0');
}
//
const InteroutId = ref(null)
const handleTouchStart = (e:number)=> {
const handleTouchStart = (e : number) => {
Interval(e)
}
const handleTouchEnd=()=> {
clearInterval(InteroutId.value);
//
const handleTouchEnd = () => {
clearInterval(InteroutId.value);
//
}
const Interval = (e:number)=>{
const Interval = (e : number) => {
InteroutId.value = setInterval(() => {
jjnum(e);
}, 120);
jjnum(e);
}, 120);
}
const jjnum = (e:number)=>{
let m = showvalue.value.maxnum;
if(m<=showvalue.value.num&&e==1){showvalue.value.num = m; return}
if(showvalue.value.num<=1&&e==-1){showvalue.value.num =1; return}
showvalue.value.num+=e;
const jjnum = (e : number) => {
let m = showvalue.value.maxnum;
if (m <= showvalue.value.num && e == 1) { showvalue.value.num = m; return }
if (showvalue.value.num <= 1 && e == -1) { showvalue.value.num = 1; return }
showvalue.value.num += e;
stringjh.value = toFixed4ByPadStart(showvalue.value.num)
}
//
const fag=(e)=>{
const fag = (e) => {
let str = '';
addupimg.value.forEach(item=>{
str+=item+','
addupimg.value.forEach(item => {
str += item + ','
})
let obj = {
jhId:showvalue.value.id,
jhNum:showvalue.value.num,
jhType:xdex.value,
jhPic:str==''?null:str,
cgdId:showvalue.value.cgdId
jhId: showvalue.value.id,
jhNum: showvalue.value.num,
jhType: xdex.value,
jhPic: str == '' ? null : str,
cgdId: showvalue.value.cgdId
}
pickingInfo(obj).then(res=>{
pickingInfo(obj).then(res => {
uni.showToast({
icon:'none',
icon: 'none',
title: res.message
})
albumlist.value = [];
addupimg.value = [];
openjianhuo.value = false;
open.value = 0;
form.cgdId = plsbuy.value[lefttarget.value].id
queryInvo()
form.cgdId = plsbuy.value[lefttarget.value].id;
queryInvo(middletarget.value)
})
}
const xdex = ref(-1)
const addupimg = ref([])
const sctp = (e:number)=>{
if(albumlist.value.length==0){
const sctp = (e : number) => {
if (albumlist.value.length == 0) {
fag(e)
return
}
albumlist.value.forEach(item=>{
uni.uploadFile({
url: uni.getStorageSync('serverUrl')+'/sys/common/upload',
filePath:item,
name: 'file',
formData:{
biz:'jhPic'
albumlist.value.forEach(item => {
uni.uploadFile({
url: uni.getStorageSync('serverUrl') + '/sys/common/upload',
filePath: item,
name: 'file',
formData: {
biz: 'jhPic'
},
header:{
'X-Access-Token':uni.getStorageSync('token')
header: {
'X-Access-Token': uni.getStorageSync('token')
},
success: res => {
const data = JSON.parse(res.data)
addupimg.value.push(data.message)
if(addupimg.value.length == albumlist.value.length){
fag(e)
}
},
fail: () => {
uni.showToast({ title: '上传失败', icon: 'none' })
}
})
success: res => {
const data = JSON.parse(res.data)
addupimg.value.push(data.message)
if (addupimg.value.length == albumlist.value.length) {
fag(e)
}
},
fail: () => {
uni.showToast({ title: '上传失败', icon: 'none' })
}
})
})
}
const config=(e)=>{
const config = (e) => {
xdex.value = e;
if(e==1){
if (e == 1) {
open.value = 2;
}else{
} else {
sctp(0)
}
}
@ -2087,6 +2153,7 @@
color: #888888;
text-align: center;
font-size: 25rpx;
overflow: hidden;
}
.middle-heng-father {
@ -3007,10 +3074,11 @@
// width: 100rpx;
padding: 0 30rpx;
letter-spacing: 10rpx;
height: 100rpx;
border: 1rpx solid #CBCFD0;
display: flex;
justify-content: center;
justify-content: flex-end;
align-items: center;
padding-left: 40rpx;
margin-right: 10rpx;