代码合并改错

This commit is contained in:
Teng 2025-11-19 11:03:10 +08:00
parent 0c9797f90f
commit 3c869a961f
1 changed files with 119 additions and 92 deletions

View File

@ -2,7 +2,7 @@
<view class="contain"> <view class="contain">
<view v-show="moreindex!=-1 || topbuttontarget!=-1 || openjianhuo || opengaijia || opendata || opencgr " <view v-show="moreindex!=-1 || topbuttontarget!=-1 || openjianhuo || opengaijia || opendata || opencgr "
class="mengban" class="mengban"
@click="moreindex=-1; topbuttontarget=-1;openjianhuo=false;opengaijia=false;opendata=false;opencgr=false"> @click="moreindex=-1; topbuttontarget=-1;openjianhuo=false;opengaijia=false;opendata=false;opencgr=false;clickflag=false">
</view> </view>
<!-- 给模糊搜索用的 --> <!-- 给模糊搜索用的 -->
<view v-show="filteredCgrListsecond.length&&gysvalue" class="mengban" @click="closefilteredCgrListsecond"> <view v-show="filteredCgrListsecond.length&&gysvalue" class="mengban" @click="closefilteredCgrListsecond">
@ -234,7 +234,7 @@
<image style="width: 100%;height: 100%;" :src="item?item:'/static/zhanwei.png'" mode="aspectFill" <image style="width: 100%;height: 100%;" :src="item?item:'/static/zhanwei.png'" mode="aspectFill"
@click="previewImage(item,index,albumlist)" /> @click="previewImage(item,index,albumlist)" />
</view> </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=" <view style="
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -244,8 +244,7 @@
align-items: center; align-items: center;
background-color:#fafdff ; background-color:#fafdff ;
border: 1rpx solid #c4ebff; 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;" <image style="width: 50rpx;height: 50rpx;margin-bottom: 5rpx;"
src="/static/index/warehouse/procurement/picking/addphoto.png" /> src="/static/index/warehouse/procurement/picking/addphoto.png" />
<view style="color: #78B1EB;font-size: 25rpx;"> <view style="color: #78B1EB;font-size: 25rpx;">
@ -263,27 +262,29 @@
</view> </view>
</view> </view>
<view style="display: flex;margin-top: 30rpx;margin-left: 20rpx;"> <view style="display: flex;margin-top: 30rpx;margin-left: 20rpx;">
<view class="gray-button"> <view class="gray-button" @click="jjnum(-1)" @longpress="handleTouchStart(-1)"
@touchend="handleTouchEnd">
- -
</view> </view>
<view class="gray-input"> <view class="gray-input" style="width:12vw;">
{{showvalue.num}} <text v-for="(v,i) in stringjh" :key="i">{{v}}</text>
</view> </view>
<view class="gray-button"> <!-- <text></text>{{showvalue.num}} -->
<view class="gray-button" @click="jjnum(1)" @longpress="handleTouchStart(1)" @touchend="handleTouchEnd">
+ +
</view> </view>
</view> </view>
<view class="jianhuobutton"> <view class="jianhuobutton">
<view style="display: flex;"> <view style="display: flex;">
<view @click="openjianhuo = false" <view @click="openjianhuo = false;clickflag = 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;"> 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 <view @click="config(1)"
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 20rpx;"> 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 20rpx;">
销账 销账
</view> </view>
<view <view @click="config(0)"
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);"> 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);">
入库 入库
</view> </view>
@ -577,7 +578,7 @@
</view> </view>
<view class="pls-card-middle-one"> <view class="pls-card-middle-one">
<view class="middle-title"> <view class="middle-title">
</view> </view>
<view class="middle-heng-father"> <view class="middle-heng-father">
<view class="middle-heng" <view class="middle-heng"
@ -1077,13 +1078,14 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, reactive, onBeforeUnmount, computed, nextTick, defineProps, onUnmounted } from 'vue'; import { ref, onMounted, reactive, onBeforeUnmount, computed, nextTick, defineProps, onUnmounted } from 'vue';
import { queryInvoicingList, getCgdMaterialTreeData, queryNuInfoByNuId, updateKfstatus, queryCgdList, queryCgdInfoList, queryWlInfoByWlId, voidedCgdMain, getCgrLis, getGysList, upload, editPrice } 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 { onShow, onLoad, onHide, onPageScroll } from "@dcloudio/uni-app"
import calendar from '@/component/public/calendar.vue' import calendar from '@/component/public/calendar.vue'
import superpicker from '@/component/public/superpicker.vue' import superpicker from '@/component/public/superpicker.vue'
import equiment from './components/equiment.vue'; import equiment from './components/equiment.vue';
const open = ref(0); const open = ref(0);
const typechange = ref(0); const typechange = ref(0);
const stringjh = ref("")
const serverUrl = ref(""); const serverUrl = ref("");
const opengaijia = ref(false); const opengaijia = ref(false);
const openjianhuo = ref(false); const openjianhuo = ref(false);
@ -1139,18 +1141,18 @@
console.log("///", res); console.log("///", res);
opengys.value = false; opengys.value = false;
} }
const openjianhuoclick = () => { const openjianhuoclick = () => {
if (showvalue.value.jianhuobtn == false) { if (showvalue.value.jianhuobtn == false) {
return return
} }
openjianhuo.value = true; openjianhuo.value = true;
clickflag.value = true;
donghuaopo.value = false; donghuaopo.value = false;
setTimeout(() => { setTimeout(() => {
donghuaopo.value = true; donghuaopo.value = true;
}, 100) }, 100)
} }
const opengaijiaclick = () => { const opengaijiaclick = () => {
opengaijia.value = true; opengaijia.value = true;
gaijia.value = (showvalue.value.arrivalPrice ? showvalue.value.arrivalPrice : showvalue.value.procurementPrice).toString() gaijia.value = (showvalue.value.arrivalPrice ? showvalue.value.arrivalPrice : showvalue.value.procurementPrice).toString()
@ -1366,7 +1368,7 @@
console.log("请购单数据呢???", res) console.log("请购单数据呢???", res)
if (res.result.records.length) { if (res.result.records.length) {
form.cgdId = plsbuy.value[0].id form.cgdId = plsbuy.value[0].id
queryInvo(); queryInvo(0);
} }
if (res.result.records.length < plzinfo.pageSize) { if (res.result.records.length < plzinfo.pageSize) {
@ -1455,22 +1457,17 @@
if (Number(showvalue.value.status) == 0 || (Number(showvalue.value.status) > 0 && Number(showvalue.value.wrksl) > 0)) { if (Number(showvalue.value.status) == 0 || (Number(showvalue.value.status) > 0 && Number(showvalue.value.wrksl) > 0)) {
showvalue.value.maxnum = (showvalue.value.rksl == 0 && showvalue.value.wrksl == 0 && showvalue.value.xzsl == 0) ? showvalue.value.purchaseQuantity : showvalue.value.wrksl showvalue.value.maxnum = (showvalue.value.rksl == 0 && showvalue.value.wrksl == 0 && showvalue.value.xzsl == 0) ? showvalue.value.purchaseQuantity : showvalue.value.wrksl
showvalue.value.num = showvalue.value.maxnum; showvalue.value.num = showvalue.value.maxnum;
stringjh.value = toFixed4ByPadStart(showvalue.value.num);
showvalue.value.jianhuobtn = true; showvalue.value.jianhuobtn = true;
} }
Object.assign(form, mobanform) Object.assign(form, mobanform)
} }
const InvoicingList = ref([]) const InvoicingList = ref([])
const queryInvo = () => { const queryInvo = (index:number) => {
queryCgdInfoList(form).then(res => { queryCgdInfoList(form).then(res => {
// if (res.result.records.length == 1) { InvoicingList.value=res.result.records;
// InvoicingList.value.push(...res.result.records); clickmiddle(index);
// }
// console.log(res.result.records)
InvoicingList.value.push(...res.result.records);
clickmiddle(0);
}) })
} }
const search = () => { const search = () => {
@ -1482,7 +1479,7 @@
alltotal.value = res.result.total alltotal.value = res.result.total
if (res.result.records.length) { if (res.result.records.length) {
form.cgdId = plsbuy.value[0].id form.cgdId = plsbuy.value[0].id
queryInvo(); queryInvo(0);
} }
if (res.result.records.length < plzinfo.pageSize) { if (res.result.records.length < plzinfo.pageSize) {
plzinfo.canpull = false; plzinfo.canpull = false;
@ -1584,17 +1581,20 @@
const uplod = () => { const uplod = () => {
uni.chooseImage({ uni.chooseImage({
count: 1, //9 count: 1, //9
sizeType: ['original', 'compressed'], // sizeType: ['compressed'], //
sourceType: ['camera'], // sourceType: ['camera'], //
crop: {
quality: 60
},
success: (e) => { success: (e) => {
console.log(JSON.stringify(e.tempFilePaths))
let ar = JSON.stringify(e.tempFilePaths) let ar = JSON.stringify(e.tempFilePaths)
albumlist.value.push(JSON.parse(ar)[0]) uni.compressImage({
// upload({file:url}).then(res=>{ src: JSON.parse(ar)[0],
// albumlist.value.push(res.result) quality: 60,
// console.log(albumlist.value) success: res => {
// }) albumlist.value.push(res.tempFilePath)
console.log(albumlist.value) }
})
} }
}); });
} }
@ -1612,18 +1612,42 @@
deldex.value = -1; deldex.value = -1;
open.value = 0; open.value = 0;
} }
// const clickflag = ref(false);
const clknum = (item : any) => { const clknum = (item : any) => {
// showvalue.value.maxnum = showvalue.value.purchaseQuantity : showvalue.value.wrksl
// showvalue.value.num
if (item == "AC") { if (item == "AC") {
showvalue.value.num = 0;
stringjh.value = toFixed4ByPadStart(showvalue.value.num);
return
}
if (item == "AE") {
showvalue.value.num = Math.trunc(showvalue.value.num / 10)
stringjh.value = toFixed4ByPadStart(showvalue.value.num);
return return
} }
if (item == "CE") { if (clickflag.value == true) {
showvalue.value.num = item;
clickflag.value = false;
stringjh.value = toFixed4ByPadStart(showvalue.value.num)
return return
} }
if (digitCountByString(showvalue.value.num) > 3) {
} else {
if (!showvalue.value.num) {
showvalue.value.num = item
} else {
showvalue.value.num = showvalue.value.num * 10 + item;
}
// cy()
stringjh.value = toFixed4ByPadStart(showvalue.value.num)
}
}
//
const digitCountByString = (n) => {
const s = Math.abs(n).toString();
return s.length;
} }
// //
const toFixed4ByPadStart = (n) => { const toFixed4ByPadStart = (n) => {
@ -1632,88 +1656,91 @@
} }
// //
const InteroutId = ref(null) const InteroutId = ref(null)
const handleTouchStart = (e:number)=> { const handleTouchStart = (e : number) => {
Interval(e) Interval(e)
} }
const handleTouchEnd=()=> { const handleTouchEnd = () => {
clearInterval(InteroutId.value); clearInterval(InteroutId.value);
// //
} }
const Interval = (e:number)=>{ const Interval = (e : number) => {
InteroutId.value = setInterval(() => { InteroutId.value = setInterval(() => {
jjnum(e); jjnum(e);
}, 120); }, 120);
} }
const jjnum = (e:number)=>{ const jjnum = (e : number) => {
let m = showvalue.value.maxnum; let m = showvalue.value.maxnum;
if(m<=showvalue.value.num&&e==1){showvalue.value.num = m; return} if (m <= showvalue.value.num && e == 1) { showvalue.value.num = m; return }
if(showvalue.value.num<=1&&e==-1){showvalue.value.num =1; return} if (showvalue.value.num <= 1 && e == -1) { showvalue.value.num = 1; return }
showvalue.value.num+=e; showvalue.value.num += e;
stringjh.value = toFixed4ByPadStart(showvalue.value.num) stringjh.value = toFixed4ByPadStart(showvalue.value.num)
} }
// //
const fag=(e)=>{ const fag = (e) => {
let str = ''; let str = '';
addupimg.value.forEach(item=>{ addupimg.value.forEach(item => {
str+=item+',' str += item + ','
}) })
let obj = { let obj = {
jhId:showvalue.value.id, jhId: showvalue.value.id,
jhNum:showvalue.value.num, jhNum: showvalue.value.num,
jhType:xdex.value, jhType: xdex.value,
jhPic:str==''?null:str, jhPic: str == '' ? null : str,
cgdId:showvalue.value.cgdId cgdId: showvalue.value.cgdId
} }
pickingInfo(obj).then(res=>{ pickingInfo(obj).then(res => {
uni.showToast({ uni.showToast({
icon:'none', icon: 'none',
title: res.message title: res.message
}) })
albumlist.value = [];
addupimg.value = []; addupimg.value = [];
openjianhuo.value = false; openjianhuo.value = false;
queryInvo() open.value = 0;
form.cgdId = plsbuy.value[lefttarget.value].id;
queryInvo(middletarget.value)
}) })
} }
const xdex = ref(-1) const xdex = ref(-1)
const addupimg = ref([]) const addupimg = ref([])
const sctp = (e:number)=>{ const sctp = (e : number) => {
if(albumlist.value.length==0){ if (albumlist.value.length == 0) {
fag(e) fag(e)
return return
} }
albumlist.value.forEach(item=>{ albumlist.value.forEach(item => {
uni.uploadFile({ uni.uploadFile({
url: uni.getStorageSync('serverUrl')+'/sys/common/upload', url: uni.getStorageSync('serverUrl') + '/sys/common/upload',
filePath:item, filePath: item,
name: 'file', name: 'file',
formData:{ formData: {
biz:'jhPic' biz: 'jhPic'
}, },
header:{ header: {
'X-Access-Token':uni.getStorageSync('token') 'X-Access-Token': uni.getStorageSync('token')
}, },
success: res => { success: res => {
const data = JSON.parse(res.data) const data = JSON.parse(res.data)
addupimg.value.push(data.message) addupimg.value.push(data.message)
if(addupimg.value.length == albumlist.value.length){ if (addupimg.value.length == albumlist.value.length) {
fag(e) fag(e)
} }
}, },
fail: () => { fail: () => {
uni.showToast({ title: '上传失败', icon: 'none' }) uni.showToast({ title: '上传失败', icon: 'none' })
} }
}) })
}) })
} }
const config=(e)=>{ const config = (e) => {
xdex.value = e; xdex.value = e;
if(e==1){ if (e == 1) {
open.value = 2; open.value = 2;
}else{ } else {
sctp(0) sctp(0)
} }
} }