From 592e271a58d6e3582d2270471cb357689feb1757 Mon Sep 17 00:00:00 2001 From: ljx120 <10717296+ljx120@user.noreply.gitee.com> Date: Thu, 9 Jan 2025 17:31:55 +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 | 22 ++-- pages/distribution/detailSpot.vue | 115 ++++++++++--------- pages/distribution/distribution.vue | 18 ++- pages/documentary/documentary.vue | 170 +++++++++++++++++++++------- pages/maintenance/p-details.vue | 51 +++++---- pages/spot/list.vue | 4 + pages/spot/spot.vue | 2 +- pages/whiteEmbryo/w-scanCode.vue | 2 - 8 files changed, 251 insertions(+), 133 deletions(-) diff --git a/pages/distribution/detailCus.vue b/pages/distribution/detailCus.vue index cc5d36d..3c5919b 100644 --- a/pages/distribution/detailCus.vue +++ b/pages/distribution/detailCus.vue @@ -11,6 +11,11 @@ const formItem = ref({ jcps: 0, jcms: 0 } as any) const list = ref() + // 定义 props + defineProps<{ + item ?: string; + }>(); + onLoad(async (option : any) => { if (option && option.item) { try { @@ -58,7 +63,7 @@ os.push(item) } }) - postAction('/cos', { sid: form.value.orderItems.id, fabric: form.value.orderItems.fabric, os: os, zt: typeData.value }).then((res : any) => { + postAction('/cos', { sid: form.value.orderItems.id, fabric: form.value.orderItems.fabric, os: os, zt: typeData.value,rc:formItem.value.rc}).then((res : any) => { if (res.code === 200) { showToast('提交成功!') uni.redirectTo({ @@ -206,23 +211,18 @@ {{itemSecond.code}}
{{itemSecond.ms}}米 - + + 扫一扫 - - - - - - + + - import { onLoad } from '@dcloudio/uni-app'; + import { onLoad, onShow } from '@dcloudio/uni-app'; import { ref } from 'vue'; import { formatDate } from '../../utils/date'; import { getAction, postAction } from '../../common/http'; -import { showToast } from 'vant'; + import { showToast } from 'vant'; const form = ref({} as any) const showDialog = ref(false) @@ -11,16 +11,22 @@ import { showToast } from 'vant'; const formItem = ref({ jcps: 0, jcms: 0 } as any) const list = ref() + // 定义 props + defineProps<{ + item ?: string; + }>(); + onLoad(async (option : any) => { if (option && option.item) { try { form.value = JSON.parse(option.item); - console.log(form.value); } catch (error) { console.error('Failed to parse item JSON:', error); // 可以选择在这里显示错误消息给用户 } } + }) + onShow(() => { getAction('/factory').then((res : any) => { if (res.code === 200) { list.value = res.data.map((l : any) => ({ text: l.name, value: l.name })) @@ -33,43 +39,43 @@ import { showToast } from 'vant'; } const onSubmit = () => { - let os=[] - form.value.fabric.forEach((l:any)=>{ - if(l.bhms1){ - if(l.bhms){ - l.bhms=l.bhms.concat(l.bhms1) - }else{ - l.bhms=JSON.parse(JSON.stringify(l.bhms1)) + let os = [] + form.value.fabric.forEach((l : any) => { + if (l.bhms1) { + if (l.bhms) { + l.bhms = l.bhms.concat(l.bhms1) + } else { + l.bhms = JSON.parse(JSON.stringify(l.bhms1)) } - l.phrq=formItem.value.phrq - l.rc=formItem.value.rc - let item={ - ms:0, - ps:0, - ml:l.name, - bh:[], + l.phrq = formItem.value.phrq + l.rc = formItem.value.rc + let item = { + ms: 0, + ps: 0, + ml: l.name, + bh: [], } - l.bhms1.forEach((m:any)=>{ - item.ms+=m.ms*1 + l.bhms1.forEach((m : any) => { + item.ms += m.ms * 1 item.ps++ item.bh.push(m.code) }) - item.ms=Number(item.ms.toFixed(1)) + item.ms = Number(item.ms.toFixed(1)) os.push(item) } }) - postAction('/ios',{orderId:form.value.id,fabric:form.value.fabric,os:os,zt:typeData.value}).then((res:any)=>{ - if(res.code===200){ + postAction('/ios', { orderId: form.value.id, fabric: form.value.fabric, os: os, zt: typeData.value, rc: formItem.value.rc }).then((res : any) => { + if (res.code === 200) { showToast('提交成功!') uni.redirectTo({ - url:'/pages/distribution/distribution' + url: '/pages/distribution/distribution' }) } }) } - const typeData=ref() - const beforeSubmit = (type:any) =>{ - typeData.value=type + const typeData = ref() + const beforeSubmit = (type : any) => { + typeData.value = type } //扫一扫 @@ -82,24 +88,27 @@ import { showToast } from 'vant'; bhms.value = [] } const conScanCode = () => { - if(form.value.fabric[indexType.value].bhms1){ - form.value.fabric[indexType.value].bhms1=form.value.fabric[indexType.value].bhms1.concat(bhms.value) - }else{ + if (form.value.fabric[indexType.value].bhms1) { + form.value.fabric[indexType.value].bhms1 = form.value.fabric[indexType.value].bhms1.concat(bhms.value) + } else { form.value.fabric[indexType.value].bhms1 = JSON.parse(JSON.stringify(bhms.value)) } showDialog.value = false let jcms = 0 - formItem.value.jcps=0 + formItem.value.jcps = 0 form.value.fabric.forEach((l : any) => { - l.bhms1.forEach((k : any) => { - jcms += k.ms * 1 - formItem.value.jcps++ - }) + if (l.bhms1) { + l.bhms1.forEach((k : any) => { + jcms += k.ms * 1 + formItem.value.jcps++ + }) + } }) formItem.value.jcms = jcms.toFixed(1) } function scanCode() { + showDialog.value = false h5ScanCode.value = true; uni.scanCode({ success: (res) => { @@ -190,7 +199,7 @@ import { showToast } from 'vant'; 谁定 面料编号/米数 - + - + + + + - + readonly :rules="[{ required: true, message: '请填写' }]" @click="choosePic()" /> + @@ -237,7 +242,8 @@ import { showToast } from 'vant'; 部分配货 - + 已配全 @@ -260,10 +266,10 @@ import { showToast } from 'vant'; @@ -310,6 +324,8 @@ {{item.zt}} +

已配货{{item.ypps}}匹

+

待配货{{item.wpps}}匹

@@ -372,8 +388,8 @@ .grid-item { border: 1px solid #f2f2f2; display: flex; + flex-direction: column; align-items: center; - text-align: center; justify-content: center; .grid-container1 { diff --git a/pages/documentary/documentary.vue b/pages/documentary/documentary.vue index ad11572..ead1fed 100644 --- a/pages/documentary/documentary.vue +++ b/pages/documentary/documentary.vue @@ -1,17 +1,14 @@ + + + + + + - - - @@ -125,14 +132,14 @@ - + - + diff --git a/pages/spot/list.vue b/pages/spot/list.vue index 030bf4c..7e1bf47 100644 --- a/pages/spot/list.vue +++ b/pages/spot/list.vue @@ -3,6 +3,7 @@ import { onMounted, ref, watch } from 'vue'; import { getAction } from '../../common/http'; import { formatDate } from '../../utils/date'; + import { onShow } from '@dcloudio/uni-app'; const form = ref({} as any) const list = ref([] as any[]) @@ -63,6 +64,9 @@ nameList.value = res.data.map((l : any) => ({ value: l, text: l })) } }) + }) + onShow(()=>{ + list.value = [] init() }) diff --git a/pages/spot/spot.vue b/pages/spot/spot.vue index b65da83..ce0b41b 100644 --- a/pages/spot/spot.vue +++ b/pages/spot/spot.vue @@ -266,7 +266,7 @@ label-width="6.5em" /> - + diff --git a/pages/whiteEmbryo/w-scanCode.vue b/pages/whiteEmbryo/w-scanCode.vue index 1c3ad38..4990980 100644 --- a/pages/whiteEmbryo/w-scanCode.vue +++ b/pages/whiteEmbryo/w-scanCode.vue @@ -138,8 +138,6 @@ const onClickRight=()=>{ h5ScanCode.value = false; }, }); - // TODO - } function handleClose() { h5ScanCode.value = false;