代码合并改错
This commit is contained in:
parent
0c9797f90f
commit
3c869a961f
|
|
@ -2,7 +2,7 @@
|
|||
<view class="contain">
|
||||
<view v-show="moreindex!=-1 || topbuttontarget!=-1 || openjianhuo || opengaijia || opendata || opencgr "
|
||||
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 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"
|
||||
@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,27 +262,29 @@
|
|||
</view>
|
||||
</view>
|
||||
<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 class="gray-input">
|
||||
{{showvalue.num}}
|
||||
<view class="gray-input" style="width:12vw;">
|
||||
<text v-for="(v,i) in stringjh" :key="i">{{v}}</text>
|
||||
</view>
|
||||
<view class="gray-button">
|
||||
<!-- <text></text>{{showvalue.num}} -->
|
||||
<view class="gray-button" @click="jjnum(1)" @longpress="handleTouchStart(1)" @touchend="handleTouchEnd">
|
||||
+
|
||||
</view>
|
||||
</view>
|
||||
<view class="jianhuobutton">
|
||||
<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;">
|
||||
关闭
|
||||
</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;">
|
||||
销账
|
||||
</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);">
|
||||
入库
|
||||
</view>
|
||||
|
|
@ -577,7 +578,7 @@
|
|||
</view>
|
||||
<view class="pls-card-middle-one">
|
||||
<view class="middle-title">
|
||||
|
||||
|
||||
</view>
|
||||
<view class="middle-heng-father">
|
||||
<view class="middle-heng"
|
||||
|
|
@ -1077,13 +1078,14 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
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 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("")
|
||||
const serverUrl = ref("");
|
||||
const opengaijia = ref(false);
|
||||
const openjianhuo = ref(false);
|
||||
|
|
@ -1139,18 +1141,18 @@
|
|||
console.log("///", res);
|
||||
opengys.value = false;
|
||||
}
|
||||
|
||||
|
||||
const openjianhuoclick = () => {
|
||||
if (showvalue.value.jianhuobtn == false) {
|
||||
return
|
||||
}
|
||||
openjianhuo.value = true;
|
||||
clickflag.value = true;
|
||||
donghuaopo.value = false;
|
||||
setTimeout(() => {
|
||||
donghuaopo.value = true;
|
||||
}, 100)
|
||||
}
|
||||
|
||||
const opengaijiaclick = () => {
|
||||
opengaijia.value = true;
|
||||
gaijia.value = (showvalue.value.arrivalPrice ? showvalue.value.arrivalPrice : showvalue.value.procurementPrice).toString()
|
||||
|
|
@ -1366,7 +1368,7 @@
|
|||
console.log("请购单数据呢???", res)
|
||||
if (res.result.records.length) {
|
||||
form.cgdId = plsbuy.value[0].id
|
||||
queryInvo();
|
||||
queryInvo(0);
|
||||
}
|
||||
|
||||
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)) {
|
||||
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;
|
||||
stringjh.value = toFixed4ByPadStart(showvalue.value.num);
|
||||
showvalue.value.jianhuobtn = true;
|
||||
}
|
||||
Object.assign(form, mobanform)
|
||||
|
||||
}
|
||||
const InvoicingList = ref([])
|
||||
const queryInvo = () => {
|
||||
queryCgdInfoList(form).then(res => {
|
||||
// if (res.result.records.length == 1) {
|
||||
// InvoicingList.value.push(...res.result.records);
|
||||
|
||||
// }
|
||||
// console.log(res.result.records)
|
||||
InvoicingList.value.push(...res.result.records);
|
||||
|
||||
clickmiddle(0);
|
||||
const queryInvo = (index:number) => {
|
||||
queryCgdInfoList(form).then(res => {
|
||||
InvoicingList.value=res.result.records;
|
||||
clickmiddle(index);
|
||||
})
|
||||
}
|
||||
const search = () => {
|
||||
|
|
@ -1482,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;
|
||||
|
|
@ -1584,17 +1581,20 @@
|
|||
const uplod = () => {
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['camera'], //从相册选择
|
||||
crop: {
|
||||
quality: 60
|
||||
},
|
||||
success: (e) => {
|
||||
console.log(JSON.stringify(e.tempFilePaths))
|
||||
let ar = JSON.stringify(e.tempFilePaths)
|
||||
albumlist.value.push(JSON.parse(ar)[0])
|
||||
// upload({file:url}).then(res=>{
|
||||
// albumlist.value.push(res.result)
|
||||
// console.log(albumlist.value)
|
||||
// })
|
||||
console.log(albumlist.value)
|
||||
uni.compressImage({
|
||||
src: JSON.parse(ar)[0],
|
||||
quality: 60,
|
||||
success: res => {
|
||||
albumlist.value.push(res.tempFilePath)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -1612,18 +1612,42 @@
|
|||
deldex.value = -1;
|
||||
open.value = 0;
|
||||
}
|
||||
//
|
||||
const clickflag = ref(false);
|
||||
const clknum = (item : any) => {
|
||||
// showvalue.value.maxnum = showvalue.value.purchaseQuantity : showvalue.value.wrksl
|
||||
// showvalue.value.num
|
||||
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
|
||||
}
|
||||
if (item == "CE") {
|
||||
|
||||
|
||||
if (clickflag.value == true) {
|
||||
showvalue.value.num = item;
|
||||
clickflag.value = false;
|
||||
stringjh.value = toFixed4ByPadStart(showvalue.value.num)
|
||||
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) => {
|
||||
|
|
@ -1632,88 +1656,91 @@
|
|||
}
|
||||
// 加减
|
||||
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;
|
||||
queryInvo()
|
||||
open.value = 0;
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue