This commit is contained in:
ljx120 2025-01-10 17:20:05 +08:00
parent bb911f78da
commit 63a6f9cbde
4 changed files with 190 additions and 124 deletions

View File

@ -45,11 +45,13 @@
})
getAction('/tribute/' + fabricId.value).then((res : any) => {
if (res.code === 200) {
res.data.data.mls.forEach((l:any)=>{
res.data.forEach((k : any) => {
k.data.mls.forEach((l : any) => {
l.xxs.forEach((m : any) => {
tributeList.value.push(m)
})
})
})
}
})
getAction('/factory').then((res : any) => {
@ -91,7 +93,7 @@
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) => {
@ -205,20 +207,19 @@
<view class="content">
<van-form @submit="onSubmit">
<van-cell-group inset>
<van-field v-model="form.id" name="订单编号" label="订单编号" colon class="bor-n"
label-width="5em" readonly />
<van-field v-model="form.makeTime" name="做单日期" label="做单日期" colon class="bor-n"
label-width="5em" readonly />
<van-field v-model="form.belongTo" name="订单归属" label="订单归属" colon class="bor-n"
label-width="5em" readonly />
<van-field v-model="form.sd" name="谁定" label="谁定" colon class="bor-n" readonly
label-width="5em" />
<van-field v-model="form.id" name="订单编号" label="订单编号" colon class="bor-n" label-width="5em"
readonly />
<van-field v-model="form.makeTime" name="做单日期" label="做单日期" colon class="bor-n" label-width="5em"
readonly />
<van-field v-model="form.belongTo" name="订单归属" label="订单归属" colon class="bor-n" label-width="5em"
readonly />
<van-field v-model="form.sd" name="谁定" label="谁定" colon class="bor-n" readonly label-width="5em" />
<van-field v-model="orderItem.craft" name="工艺" label="工艺" colon label-width="5em" readonly
class="bor-n" />
<van-field v-model="orderItem.craftComment.name" name="工艺要求" label="工艺要求" colon label-width="5em" readonly
class="bor-n" />
<van-field v-model="form.interComment" name="内部备注" label="内部备注" colon label-width="5em"
<van-field v-model="orderItem.craftComment.name" name="工艺要求" label="工艺要求" colon label-width="5em"
readonly class="bor-n" />
<van-field v-model="form.interComment" name="内部备注" label="内部备注" colon label-width="5em" readonly
class="bor-n" />
<van-field v-model="orderItem.color" name="需求颜色" label="需求颜色" colon label-width="5em" readonly
class="bor-n" />

View File

@ -1,6 +1,6 @@
<script setup lang="ts">
import { onLoad, onShow } from '@dcloudio/uni-app';
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { onMounted, ref } from 'vue';
import { formatDate } from '../../utils/date';
import { getAction, postAction } from '../../common/http';
import { showToast } from 'vant';
@ -11,27 +11,36 @@
const formItem = ref({ jcps: 0, jcms: 0 } as any)
const list = ref()
const orderId = ref()
const phjl = ref([] as any[])
const tributeList = ref([] as any[])
const zt = ref()
// props
defineProps<{
id ?: string;
zt?:string;
}>();
onLoad(async (option : any) => {
if (option && option.id) {
if (option) {
try {
orderId.value = option.id;
orderId.value = option.id
zt.value=option.zt
} catch (error) {
console.error('Failed to parse item JSON:', error);
//
}
}
})
onShow(() => {
onMounted(() => {
getAction('/tribute/'+orderId.value).then((res:any)=>{
if(res.code===200){
phjl.value=res.data
res.data.forEach((k:any)=>{
k.data.mls.forEach((l:any)=>{
l.xxs.forEach((m:any)=>{
tributeList.value.push(m)
})
})
})
}
})
getAction('/interOrder/'+orderId.value).then((res : any) => {
@ -51,33 +60,37 @@
}
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 val = {
orderId: orderId.value,
type: '现货单',
factory: formItem.value.rc,
qty: formItem.value.jcps,
len: formItem.value.jcms,
tributeDate: formItem.value.phrq,
data: {
craft: form.value.craft,
makeUser: form.value.makeUser,
belongTo: '',
zt: typeData.value,
sd: form.value.sd,
mls: []
}
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
item.ps++
item.bh.push(m.code)
let set = new Set()
bhms.value.forEach((l : any) => {
set.add(l.index)
})
item.ms = Number(item.ms.toFixed(1))
os.push(item)
set.forEach((l : any) => {
let xxs = []
bhms.value.forEach((m : any) => {
if (m.index == l) {
xxs.push(m)
}
})
// zt: typeData.value,
postAction('/tribute', { orderId: form.value.id, type: '现货单', factory: formItem.value.rc,qty:'',len:'' ,data:''}).then((res : any) => {
val.data.mls.push({ name: form.value.fabric[l].name,sh:form.value.color, xxs: xxs })
})
postAction('/tribute', val).then((res : any) => {
if (res.code === 200) {
showToast('提交成功!')
uni.redirectTo({
@ -95,13 +108,20 @@
const h5ScanCode = ref(false);
const bhms = ref([] as any[])
const indexType = ref()
//
const upScanCode = (index : any) => {
scanCode()
indexType.value = index
bhms.value = []
}
const conScanCode = () => {
showDialog.value = false
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 = (formItem.value.jcms).toFixed(1)
}
function scanCode() {
@ -123,7 +143,12 @@
h5ScanCode.value = false;
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, syps: res1.data.len })
bhms.value.push({
code: res,
ms: res1.data.len,
syps: res1.data.len,
index: indexType.value,
})
showDialog.value = true
}
})
@ -203,9 +228,16 @@
<view class="grid-item">{{item.quantity}}</view>
<view class="grid-item">门店</view>
<view class="grid-item">
<view v-for="(itemSecond,indexSecond) in item.bhms1" :key="indexSecond" class="box">
<view v-for="(itemSecond,indexSecond) in tributeList" :key="indexSecond">
<view v-if="itemSecond.index==index" class="box">
{{itemSecond.code}}<br>{{itemSecond.ms}}
<van-icon name="cross" color="red" @click="item.bhms1.splice(indexSecond,1)" />
</view>
</view>
<view v-for="(itemSecond,indexSecond) in bhms" :key="indexSecond">
<view v-if="itemSecond.index==index" class="box">
{{itemSecond.code}}<br>{{itemSecond.ms}}
<van-icon name="cross" color="red" @click="bhms.splice(indexSecond,1)" />
</view>
</view>
<view class="a-c">
<van-button type="primary" @click="upScanCode(index)">

View File

@ -110,12 +110,12 @@
//
const toDetile = (item : any) => {
if (item.type === '定做单') {
let url = './detailCus' + '?' + 'id=' + item.orderId + '&subId=' + item.subId+'&zt' + item.zt
let url = './detailCus' + '?' + 'id=' + item.orderId + '&subId=' + item.subId+'&zt=' + item.zt
uni.navigateTo({
url: url,
})
} else if (item.type === '现货单') {
let url = './detailSpot' + '?' + 'id=' + item.orderId
let url = './detailSpot' + '?' + 'id=' + item.orderId+'&zt=' + item.zt
uni.navigateTo({
url: url,
})

View File

@ -318,7 +318,14 @@
<view class="content">
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
<view class="grid-container" v-for="(item,index) in list" :key="index">
<view class="grid-item">{{item.fabricName}}<br>{{item.color}}</view>
<view class="grid-item">
<view class="grid-container1">
<view :class="indexSecond===(item.mls.length-1)?'grid-item2':'grid-item1'"
v-for="(itemSecond,indexSecond) in item.mls" :key="indexSecond">
{{itemSecond.mz}}<br>{{itemSecond.craft}}&nbsp;&nbsp;&nbsp;{{itemSecond.sd}}
</view>
</view>
</view>
<view class="grid-item">
{{item.sd}}/{{item.makeUser}}/{{item.belongTo}}<br>{{item.qty}}/{{item.len}}
</view>
@ -326,8 +333,7 @@
{{item.craft}}<br>{{item.craftComment.name?item.craftComment.name:item.craftComment}}
</view>
<view class="grid-item">
<van-button
:style="{backgroundColor: item.butonColor,color:'#fff'}"
<van-button :style="{backgroundColor: item.butonColor,color:'#fff'}"
@click="toDetile(item)">{{item.status}}</van-button>
</view>
</view>
@ -338,9 +344,12 @@
<van-dialog v-model:show="showDialog">
<view style="margin-top: 10rpx;">
<van-cell-group inset>
<van-field v-model="dataItem.gdy" name="跟单员" label="跟单员" colon readonly label-width="6.5em" class="bor-n" label-align="right"/>
<van-field v-model="dataItem.jcrq" name="进厂日期" label="进厂日期" colon label-width="6.5em" class="bor" readonly @click="chooseDate('jcrq')" label-align="right"/>
<van-field v-model="dataItem.yjccts" name="预计出厂天数" label="预计出厂天数" type="digit" colon label-width="6.5em" class="bor-a" label-align="right"/>
<van-field v-model="dataItem.gdy" name="跟单员" label="跟单员" colon readonly label-width="6.5em"
class="bor-n" label-align="right" />
<van-field v-model="dataItem.jcrq" name="进厂日期" label="进厂日期" colon label-width="6.5em" class="bor"
readonly @click="chooseDate('jcrq')" label-align="right" />
<van-field v-model="dataItem.yjccts" name="预计出厂天数" label="预计出厂天数" type="digit" colon label-width="6.5em"
class="bor-a" label-align="right" />
</van-cell-group>
</view>
<template #footer>
@ -414,6 +423,30 @@
align-items: center;
text-align: center;
justify-content: center;
.grid-container1 {
display: grid;
grid-template-columns: 1fr;
width: 100%;
height: 100%;
.grid-item2 {
display: flex;
align-items: center;
text-align: center;
justify-content: center;
padding: 5rpx;
}
.grid-item1 {
border-bottom: 1px solid #f2f2f2;
display: flex;
align-items: center;
text-align: center;
justify-content: center;
padding: 5rpx;
}
}
}
}