From 63a6f9cbded828466844cdba4d09beaebb95e456 Mon Sep 17 00:00:00 2001 From: ljx120 <10717296+ljx120@user.noreply.gitee.com> Date: Fri, 10 Jan 2025 17:20:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=9F=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/distribution/detailCus.vue | 107 +++++++++++++-------------- pages/distribution/detailSpot.vue | 110 ++++++++++++++++++---------- pages/distribution/distribution.vue | 4 +- pages/documentary/documentary.vue | 93 +++++++++++++++-------- 4 files changed, 190 insertions(+), 124 deletions(-) diff --git a/pages/distribution/detailCus.vue b/pages/distribution/detailCus.vue index f691486..9a07e84 100644 --- a/pages/distribution/detailCus.vue +++ b/pages/distribution/detailCus.vue @@ -9,7 +9,7 @@ const showDialog = ref(false) const show = ref(false) const formItem = ref({ jcps: 0, jcms: 0 } as any) - const orderItem = ref({craftComment:{}} as any) + const orderItem = ref({ craftComment: {} } as any) const list = ref() const orderId = ref() const fabricId = ref() @@ -20,7 +20,7 @@ defineProps<{ id ?: string; subId ?: string; - zt?:string; + zt ?: string; }>(); onLoad(async (option : any) => { @@ -28,7 +28,7 @@ try { orderId.value = option.id fabricId.value = option.subId - zt.value=option.zt + zt.value = option.zt } catch (error) { console.error('Failed to parse item JSON:', error); // 可以选择在这里显示错误消息给用户 @@ -40,14 +40,16 @@ getAction('/customOrder/' + orderId.value).then((res : any) => { if (res.code === 200) { form.value = res.data.customOrder - orderItem.value = res.data.orderItems.find((l:any)=>l.id==fabricId.value) + orderItem.value = res.data.orderItems.find((l : any) => l.id == fabricId.value) } }) - getAction('/tribute/'+fabricId.value).then((res:any)=>{ - if(res.code===200){ - res.data.data.mls.forEach((l:any)=>{ - l.xxs.forEach((m:any)=>{ - tributeList.value.push(m) + getAction('/tribute/' + fabricId.value).then((res : any) => { + if (res.code === 200) { + res.data.forEach((k : any) => { + k.data.mls.forEach((l : any) => { + l.xxs.forEach((m : any) => { + tributeList.value.push(m) + }) }) }) } @@ -62,40 +64,40 @@ const onClickLeft = () => { window.history.back() } -// 提交 + // 提交 const onSubmit = () => { - let val={ - orderId:fabricId.value, + let val = { + orderId: fabricId.value, type: '定做单', factory: formItem.value.rc, - qty:formItem.value.jcps, - len:formItem.value.jcms, - tributeDate:formItem.value.phrq, - data:{ - craft:orderItem.value.craft, - makeUser:form.value.makeUser, - belongTo:form.value.belongTo, - zt:typeData.value, - sd:form.value.sd, - mls:[] + qty: formItem.value.jcps, + len: formItem.value.jcms, + tributeDate: formItem.value.phrq, + data: { + craft: orderItem.value.craft, + makeUser: form.value.makeUser, + belongTo: form.value.belongTo, + zt: typeData.value, + sd: form.value.sd, + mls: [] } } - let set=new Set() - bhms.value.forEach((l:any)=>{ + let set = new Set() + bhms.value.forEach((l : any) => { set.add(l.index) }) - set.forEach((l:any)=>{ - let xxs=[] - bhms.value.forEach((m:any)=>{ - if(m.index == l){ + set.forEach((l : any) => { + let xxs = [] + bhms.value.forEach((m : any) => { + if (m.index == l) { xxs.push(m) } }) - val.data.mls.push({name:orderItem.value.fabric[l].name,xxs:xxs}) + val.data.mls.push({ name: orderItem.value.fabric[l].name,sh:orderItem.value.color, xxs: xxs }) }) - - postAction('/tribute',val).then((res:any)=>{ - if(res.code===200){ + + postAction('/tribute', val).then((res : any) => { + if (res.code === 200) { showToast('提交成功!') uni.redirectTo({ url: '/pages/distribution/distribution' @@ -112,19 +114,19 @@ const bhms = ref([] as any[]) const indexType = ref() //点击扫一扫 - const upScanCode = (index:any) => { - indexType.value=index + const upScanCode = (index : any) => { + indexType.value = index scanCode() } const conScanCode = () => { showDialog.value = false - formItem.value.jcps=0 - formItem.value.jcms=0 - bhms.value.forEach((l:any)=>{ + formItem.value.jcps = 0 + formItem.value.jcms = 0 + bhms.value.forEach((l : any) => { formItem.value.jcps++ - formItem.value.jcms+=l.ms*1 + formItem.value.jcms += l.ms * 1 }) - formItem.value.jcms=(formItem.value.jcms).toFixed(1) + formItem.value.jcms = (formItem.value.jcms).toFixed(1) } function scanCode() { @@ -147,10 +149,10 @@ getAction('/rawFabric/qrcode', { barcode: res }, { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' }).then((res1 : any) => { if (res1.code === 200) { bhms.value.push({ - code: res, - ms: res1.data.len, + code: res, + ms: res1.data.len, syps: res1.data.len, - index:indexType.value, + index: indexType.value, }) showDialog.value = true } @@ -205,20 +207,19 @@ - - - - + + + + - - + diff --git a/pages/distribution/detailSpot.vue b/pages/distribution/detailSpot.vue index 22f58ea..3f3e3d3 100644 --- a/pages/distribution/detailSpot.vue +++ b/pages/distribution/detailSpot.vue @@ -1,6 +1,6 @@