From bb911f78da650d54e6b6b5b67f61f18bca39df28 Mon Sep 17 00:00:00 2001
From: ljx120 <10717296+ljx120@user.noreply.gitee.com>
Date: Fri, 10 Jan 2025 16:32:41 +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 | 90 ++++++++++++++++++++---------
pages/distribution/detailSpot.vue | 6 +-
pages/distribution/distribution.vue | 11 +---
3 files changed, 65 insertions(+), 42 deletions(-)
diff --git a/pages/distribution/detailCus.vue b/pages/distribution/detailCus.vue
index 4e209fa..f691486 100644
--- a/pages/distribution/detailCus.vue
+++ b/pages/distribution/detailCus.vue
@@ -9,21 +9,26 @@
const showDialog = ref(false)
const show = ref(false)
const formItem = ref({ jcps: 0, jcms: 0 } as any)
+ const orderItem = ref({craftComment:{}} as any)
const list = ref()
const orderId = ref()
- const fabrics = ref()
+ const fabricId = ref()
+ const tributeList = ref([] as any[])
+ const zt = ref()
// 定义 props
defineProps<{
id ?: string;
- item ?: string;
+ subId ?: string;
+ zt?:string;
}>();
onLoad(async (option : any) => {
- if (option && option.id && option.item) {
+ if (option) {
try {
- orderId.value = option.id;
- fabrics.value = JSON.parse(option.item)
+ orderId.value = option.id
+ fabricId.value = option.subId
+ zt.value=option.zt
} catch (error) {
console.error('Failed to parse item JSON:', error);
// 可以选择在这里显示错误消息给用户
@@ -35,6 +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)
+ }
+ })
+ 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('/factory').then((res : any) => {
@@ -50,24 +65,35 @@
// 提交
const onSubmit = () => {
let val={
- orderId:fabrics.value.orderId,
+ orderId:fabricId.value,
type: '定做单',
factory: formItem.value.rc,
qty:formItem.value.jcps,
len:formItem.value.jcms,
tributeDate:formItem.value.phrq,
data:{
- craft:fabrics.value.craft,
+ craft:orderItem.value.craft,
makeUser:form.value.makeUser,
belongTo:form.value.belongTo,
zt:typeData.value,
sd:form.value.sd,
- mls:[{
- name:fabrics.value.name,
- xxs:bhms.value,
- }]
+ mls:[]
}
}
+ 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){
+ xxs.push(m)
+ }
+ })
+ val.data.mls.push({name:orderItem.value.fabric[l].name,xxs:xxs})
+ })
+
postAction('/tribute',val).then((res:any)=>{
if(res.code===200){
showToast('提交成功!')
@@ -84,8 +110,10 @@
//扫一扫
const h5ScanCode = ref(false);
const bhms = ref([] as any[])
+ const indexType = ref()
//点击扫一扫
- const upScanCode = () => {
+ const upScanCode = (index:any) => {
+ indexType.value=index
scanCode()
}
const conScanCode = () => {
@@ -122,7 +150,7 @@
code: res,
ms: res1.data.len,
syps: res1.data.len,
- index:fabrics.value.id,
+ index:indexType.value,
})
showDialog.value = true
}
@@ -185,13 +213,13 @@
label-width="5em" readonly />
-
-
-
@@ -200,17 +228,24 @@
米数
面料编号/米数
-
- {{fabrics.name}}
- {{fabrics.qty}}
- {{fabrics.len}}
+
+ {{item.name}}
+ {{item.qty}}
+ {{item.len}}
-
- {{item.code}}
{{item.ms}}米
-
+
+
+ {{itemSecond.code}}
{{itemSecond.ms}}米
+
-
-
+
+
+ {{itemSecond.code}}
{{itemSecond.ms}}米
+
+
+
+
+
扫一扫
@@ -220,7 +255,7 @@
@close="handleClose">
-
+
-
-
+
部分配货
diff --git a/pages/distribution/detailSpot.vue b/pages/distribution/detailSpot.vue
index 1320871..22f58ea 100644
--- a/pages/distribution/detailSpot.vue
+++ b/pages/distribution/detailSpot.vue
@@ -203,15 +203,11 @@
{{item.quantity}}
门店
-
{{itemSecond.code}}
{{itemSecond.ms}}米
-
+
扫一扫
diff --git a/pages/distribution/distribution.vue b/pages/distribution/distribution.vue
index c8a1c6c..3eeae40 100644
--- a/pages/distribution/distribution.vue
+++ b/pages/distribution/distribution.vue
@@ -108,12 +108,9 @@
}
//详情
- const toDetile = (item : any, item2 : any, index2 : any) => {
+ const toDetile = (item : any) => {
if (item.type === '定做单') {
- item2.craftCmt = item.craftCmt
- item2.id = index2
- item2.orderId = item.subId
- let url = './detailCus' + '?' + 'id=' + item.orderId + '&item=' + JSON.stringify(item2)
+ let url = './detailCus' + '?' + 'id=' + item.orderId + '&subId=' + item.subId+'&zt' + item.zt
uni.navigateTo({
url: url,
})
@@ -175,8 +172,6 @@
{{item.zt}}
- 已配货{{item.ypps}}匹
- 待配货{{item.wpps}}匹
@@ -200,8 +195,6 @@
{{item.zt}}
- 已配货{{item.ypps}}匹
- 待配货{{item.wpps}}匹