diff --git a/pages.json b/pages.json index 8c2827e..871f40e 100644 --- a/pages.json +++ b/pages.json @@ -159,18 +159,10 @@ "path" : "pages/Warehouse/warehome" }, { - "path" : "pages/procurement/authorization", - "style" : - { - "navigationBarTitleText" : "" - } + "path" : "pages/procurement/authorization" }, { - "path" : "pages/procurement/addtory", - "style" : - { - "navigationBarTitleText" : "" - } + "path" : "pages/procurement/addtory" } ], "globalStyle": { diff --git a/pages/procurement/addtory.vue b/pages/procurement/addtory.vue index ea8acf7..095ef08 100644 --- a/pages/procurement/addtory.vue +++ b/pages/procurement/addtory.vue @@ -27,22 +27,28 @@ - + - + 取消盘点 - 提交盘点单 + 提交盘点单 + + diff --git a/pages/procurement/common/toryitem.vue b/pages/procurement/common/toryitem.vue index 572adae..9cb6b6a 100644 --- a/pages/procurement/common/toryitem.vue +++ b/pages/procurement/common/toryitem.vue @@ -3,7 +3,7 @@ - + 物料单位: {{v?.materialUnits}} - - 规格型号: - {{v?.specificationModel}} + + 规格型号:{{v?.specificationModel}} @@ -44,31 +43,31 @@ - {{v?.pdType==2?'-':''}}{{v?.cesl!=null?v?.cesl:'--'}} + {{v?.pdType==2&&v?.cesl>0?'-':''}}{{v?.cesl!=null?v?.cesl:'--'}} 差额 - + - + - + 备注 - 1 + 1 拍照 - 5 + {{v?.picPatharr?.length}} - + 确定 @@ -79,31 +78,33 @@ - + - 取消 - 确定 + {{pddType=='1'?'取消':'关闭'}} + 确定 拍照: - - - - + + + + - + - 点击拍照上传 + 点击拍照上传 + - 取消 - 确定 + {{pddType=='1'?'取消':'关闭'}} + 确定 @@ -116,7 +117,7 @@ - + @@ -128,42 +129,37 @@ import defaultr from '../components/default.vue' const open = ref(0) const scrolltop = ref(0) - const list = ref([]); const serverUrl = ref(uni.getStorageSync('serverUrl') + '/sys/common/static/') + const emit = defineEmits([ 'scrolltolower' , 'tabitem' ,'right' ]) const props = defineProps({ pddlist: { type: Array }, status: { type: String - } + }, + pddType:{ + type:String + } }) const listflag = ref(false) - onMounted(() => { - nextTick(()=>{ - props.pddlist.forEach(item=>{ - item.zk = false; - item.yczk=false; - item.bz=false; - item.model=''; - item.pz=false; - item.ce = ''; - }) - }) - + onMounted(() => { setTimeout(()=>{ listflag.value = true; - },1000) - // for (let i = 0; i < 20; i++) { - // list.value.push({ zk: false, yczk: false, bz: false, model: '', pz: false }) - // } + },1000) }) + const valitem = ref({}); + const valindex = ref(-1); const zhankai = (v, i) => { let s = Math.ceil((i + 1) / 3); - console.log(s) + if(valindex.value !=i && valindex.value > -1 &&uni.getStorageSync('valitem')){ + emit('tabitem',valindex.value,uni.getStorageSync('valitem')) + } + valindex.value = i; scrolltop.value = top.value; v.zk = !v.zk; if (v.zk) { + uni.setStorageSync('valitem', v); setTimeout(() => { v.yczk = v.zk; }, 200) @@ -202,12 +198,94 @@ console.log(e) } const config = (e,i) =>{ - // 没点确认情况下把pdsl,cesl ,pdType 归 null 需要加字段 + if(e.content==''||e.content==null){ + uni.showToast({ + icon:'error', + title:"请填写备注!" + }) + return + } + emit('right',e,i) } - const emit = defineEmits([ 'scrolltolower' ]) const scrolltolower = () => { emit('scrolltolower') } + // 上传 + const albumlist = ref([]) + const uplod = (v,i) => { + uni.chooseImage({ + count: 1, //默认9 + sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有 + sourceType: ['camera'], //从相册选择 + success: (e) => { + let ar = JSON.stringify(e.tempFilePaths) + uni.compressImage({ + src: JSON.parse(ar)[0], + quality: 60, + success: res => { + sxdupld(res.tempFilePath,v) + // v.picPatharr.push(res.tempFilePath); + // console.log(v.picPatharr) + } + }) + } + }); + } + const sxdupld = (e,v) => { + let now = new Date(); + let year = now.getFullYear(); + let month = now.getMonth() + 1; + uni.uploadFile({ + url: uni.getStorageSync('serverUrl') + '/sys/common/upload', + filePath: e, + name: 'file', + formData: { + biz: year + '/' + month + '/pddPic' + }, + header: { + 'X-Access-Token': uni.getStorageSync('token') + }, + success: res => { + const data = JSON.parse(res.data); + console.log(v) + v.picPatharr.push(data.message); + shuzhi(v) + }, + fail: () => { + uni.showToast({ title: '上传失败', icon: 'none' }) + } + }) + } + const previewImage = (arr,p,i) => { + let u = [] + arr.picPatharr.forEach(e => { + u.push(serverUrl.value + e) + }) + uni.previewImage({ + current: i, + urls: u, + showmenu: false, + longPressActions: { + itemList: [], + } + }) + } + const shuzhi = (v)=>{ + v.picPath = ''; + v.picPatharr.forEach((e,i)=>{ + v.picPath+= e+',' + }) + } + const picv = ref({}); + const pici = ref(0); + const del=(v,o)=>{ + picv.value = v; + pici.value = o; + } + const del1=()=>{ + picv.value.picPatharr.splice(pici.value,1); + open.value = 0 + }