跟单
This commit is contained in:
parent
592e271a58
commit
099464e429
@ -379,10 +379,10 @@
|
|||||||
@click="choosePic('craftFlow',index)" />
|
@click="choosePic('craftFlow',index)" />
|
||||||
<view v-for="(itemSecond,indexSecond) in item.fabric" :key="index">
|
<view v-for="(itemSecond,indexSecond) in item.fabric" :key="index">
|
||||||
<view class="a-c">
|
<view class="a-c">
|
||||||
<van-icon name="add" color="red" size="25" v-if="index===0"
|
<van-icon name="add" color="red" size="25" v-if="indexSecond===0"
|
||||||
@click="item.fabric.push({})" />
|
@click="item.fabric.push({})" />
|
||||||
<van-icon name="clear" color="red" size="25" v-if="index!=0"
|
<van-icon name="clear" color="red" size="25" v-if="indexSecond!=0"
|
||||||
@click="item.fabric.splice(index,1)" />
|
@click="item.fabric.splice(indexSecond,1)" />
|
||||||
<van-field v-model="itemSecond.name" name="面料名称" label="面料名称" colon readonly
|
<van-field v-model="itemSecond.name" name="面料名称" label="面料名称" colon readonly
|
||||||
label-width="5em" @click="selectChoose(index,indexSecond)" class="bor"
|
label-width="5em" @click="selectChoose(index,indexSecond)" class="bor"
|
||||||
:rules="[{ required: true, message: '请填写' }]" />
|
:rules="[{ required: true, message: '请填写' }]" />
|
||||||
|
@ -1,30 +1,42 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
import { ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { getAction, postAction } from '../../common/http';
|
import { getAction, postAction } from '../../common/http';
|
||||||
import { showToast } from 'vant';
|
|
||||||
import { formatDate } from '../../utils/date';
|
import { formatDate } from '../../utils/date';
|
||||||
|
import { showToast } from 'vant';
|
||||||
|
|
||||||
const form = ref({} as any)
|
const form = ref({} as any)
|
||||||
const showDialog = ref(false)
|
const showDialog = ref(false)
|
||||||
const show = ref(false)
|
const show = ref(false)
|
||||||
const formItem = ref({ jcps: 0, jcms: 0 } as any)
|
const formItem = ref({ jcps: 0, jcms: 0 } as any)
|
||||||
const list = ref()
|
const list = ref()
|
||||||
|
const orderId = ref()
|
||||||
|
const fabrics = ref()
|
||||||
|
|
||||||
// 定义 props
|
// 定义 props
|
||||||
defineProps<{
|
defineProps<{
|
||||||
|
id ?: string;
|
||||||
item ?: string;
|
item ?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
onLoad(async (option : any) => {
|
onLoad(async (option : any) => {
|
||||||
if (option && option.item) {
|
if (option && option.id && option.item) {
|
||||||
try {
|
try {
|
||||||
form.value = JSON.parse(option.item);
|
orderId.value = option.id;
|
||||||
|
fabrics.value = JSON.parse(option.item)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to parse item JSON:', error);
|
console.error('Failed to parse item JSON:', error);
|
||||||
// 可以选择在这里显示错误消息给用户
|
// 可以选择在这里显示错误消息给用户
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getAction('/customOrder/' + orderId.value).then((res : any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
form.value = res.data.customOrder
|
||||||
|
}
|
||||||
|
})
|
||||||
getAction('/factory').then((res : any) => {
|
getAction('/factory').then((res : any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
list.value = res.data.map((l : any) => ({ text: l.name, value: l.name }))
|
list.value = res.data.map((l : any) => ({ text: l.name, value: l.name }))
|
||||||
@ -32,39 +44,32 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const onClickLeft = () => {
|
const onClickLeft = () => {
|
||||||
window.history.back()
|
window.history.back()
|
||||||
}
|
}
|
||||||
|
// 提交
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
let os = []
|
let val={
|
||||||
form.value.orderItems.fabric.forEach((l : any) => {
|
orderId:fabrics.value.orderId,
|
||||||
if (l.bhms1) {
|
type: '定做单',
|
||||||
if (l.bhms) {
|
factory: formItem.value.rc,
|
||||||
l.bhms = l.bhms.concat(l.bhms1)
|
qty:formItem.value.jcps,
|
||||||
} else {
|
len:formItem.value.jcms,
|
||||||
l.bhms = JSON.parse(JSON.stringify(l.bhms1))
|
tributeDate:formItem.value.phrq,
|
||||||
}
|
data:{
|
||||||
l.phrq = formItem.value.phrq
|
craft:fabrics.value.craft,
|
||||||
l.rc = formItem.value.rc
|
makeUser:form.value.makeUser,
|
||||||
let item = {
|
belongTo:form.value.belongTo,
|
||||||
ms: 0,
|
zt:typeData.value,
|
||||||
ps: 0,
|
sd:form.value.sd,
|
||||||
ml: l.name,
|
mls:[{
|
||||||
bh: [],
|
name:fabrics.value.name,
|
||||||
}
|
xxs:bhms.value,
|
||||||
l.bhms1.forEach((m : any) => {
|
}]
|
||||||
item.ms += m.ms * 1
|
|
||||||
item.ps++
|
|
||||||
item.bh.push(m.code)
|
|
||||||
})
|
|
||||||
item.ms = Number(item.ms.toFixed(1))
|
|
||||||
os.push(item)
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
postAction('/cos', { sid: form.value.orderItems.id, fabric: form.value.orderItems.fabric, os: os, zt: typeData.value,rc:formItem.value.rc}).then((res : any) => {
|
postAction('/tribute',val).then((res:any)=>{
|
||||||
if (res.code === 200) {
|
if(res.code===200){
|
||||||
showToast('提交成功!')
|
showToast('提交成功!')
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/distribution/distribution'
|
url: '/pages/distribution/distribution'
|
||||||
@ -79,31 +84,23 @@
|
|||||||
//扫一扫
|
//扫一扫
|
||||||
const h5ScanCode = ref(false);
|
const h5ScanCode = ref(false);
|
||||||
const bhms = ref([] as any[])
|
const bhms = ref([] as any[])
|
||||||
const indexType = ref()
|
//点击扫一扫
|
||||||
const upScanCode = (index : any) => {
|
const upScanCode = () => {
|
||||||
scanCode()
|
scanCode()
|
||||||
indexType.value = index
|
|
||||||
bhms.value = []
|
|
||||||
}
|
}
|
||||||
const conScanCode = () => {
|
const conScanCode = () => {
|
||||||
if (form.value.orderItems.fabric[indexType.value].bhms1) {
|
|
||||||
form.value.orderItems.fabric[indexType.value].bhms1 = form.value.orderItems.fabric[indexType.value].bhms1.concat(bhms.value)
|
|
||||||
} else {
|
|
||||||
form.value.orderItems.fabric[indexType.value].bhms1 = JSON.parse(JSON.stringify(bhms.value))
|
|
||||||
}
|
|
||||||
showDialog.value = false
|
showDialog.value = false
|
||||||
let jcms = 0
|
formItem.value.jcps=0
|
||||||
formItem.value.jcps = 0
|
formItem.value.jcms=0
|
||||||
form.value.orderItems.fabric.forEach((l : any) => {
|
bhms.value.forEach((l:any)=>{
|
||||||
l.bhms1.forEach((k : any) => {
|
formItem.value.jcps++
|
||||||
jcms += k.ms * 1
|
formItem.value.jcms+=l.ms*1
|
||||||
formItem.value.jcps++
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
formItem.value.jcms = jcms.toFixed(1)
|
formItem.value.jcms=(formItem.value.jcms).toFixed(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
function scanCode() {
|
function scanCode() {
|
||||||
|
showDialog.value = false
|
||||||
h5ScanCode.value = true;
|
h5ScanCode.value = true;
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
@ -121,7 +118,12 @@
|
|||||||
h5ScanCode.value = false;
|
h5ScanCode.value = false;
|
||||||
getAction('/rawFabric/qrcode', { barcode: res }, { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' }).then((res1 : any) => {
|
getAction('/rawFabric/qrcode', { barcode: res }, { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' }).then((res1 : any) => {
|
||||||
if (res1.code === 200) {
|
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:fabrics.value.id,
|
||||||
|
})
|
||||||
showDialog.value = true
|
showDialog.value = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -175,21 +177,21 @@
|
|||||||
<view class="content">
|
<view class="content">
|
||||||
<van-form @submit="onSubmit">
|
<van-form @submit="onSubmit">
|
||||||
<van-cell-group inset>
|
<van-cell-group inset>
|
||||||
<van-field v-model="form.customOrder.id" name="订单编号" label="订单编号" colon class="bor-n"
|
<van-field v-model="form.id" name="订单编号" label="订单编号" colon class="bor-n"
|
||||||
label-width="5em" readonly />
|
label-width="5em" readonly />
|
||||||
<van-field v-model="form.customOrder.makeTime" name="做单日期" label="做单日期" colon class="bor-n"
|
<van-field v-model="form.makeTime" name="做单日期" label="做单日期" colon class="bor-n"
|
||||||
label-width="5em" readonly />
|
label-width="5em" readonly />
|
||||||
<van-field v-model="form.customOrder.belongTo" name="订单归属" label="订单归属" colon class="bor-n"
|
<van-field v-model="form.belongTo" name="订单归属" label="订单归属" colon class="bor-n"
|
||||||
label-width="5em" readonly />
|
label-width="5em" readonly />
|
||||||
<van-field v-model="form.customOrder.sd" name="谁定" label="谁定" colon class="bor-n" readonly
|
<van-field v-model="form.sd" name="谁定" label="谁定" colon class="bor-n" readonly
|
||||||
label-width="5em" />
|
label-width="5em" />
|
||||||
<van-field v-model="form.orderItems.craft" name="工艺" label="工艺" colon label-width="5em" readonly
|
<van-field v-model="fabrics.craft" name="工艺" label="工艺" colon label-width="5em" readonly
|
||||||
class="bor-n" />
|
class="bor-n" />
|
||||||
<van-field v-model="form.orderItems.craftComment.name" name="工艺要求" label="工艺要求" colon
|
<van-field v-model="fabrics.craftCmt.name" name="工艺要求" label="工艺要求" colon label-width="5em" readonly
|
||||||
label-width="5em" readonly class="bor-n" />
|
class="bor-n" />
|
||||||
<van-field v-model="form.customOrder.interComment" name="内部备注" label="内部备注" colon label-width="5em"
|
<van-field v-model="form.interComment" name="内部备注" label="内部备注" colon label-width="5em"
|
||||||
readonly class="bor-n" />
|
readonly class="bor-n" />
|
||||||
<van-field v-model="form.orderItems.color" name="需求颜色" label="需求颜色" colon label-width="5em" readonly
|
<van-field v-model="fabrics.color" name="需求颜色" label="需求颜色" colon label-width="5em" readonly
|
||||||
class="bor-n" />
|
class="bor-n" />
|
||||||
|
|
||||||
<view class="grid-container">
|
<view class="grid-container">
|
||||||
@ -198,33 +200,27 @@
|
|||||||
<view class="grid-item">米数</view>
|
<view class="grid-item">米数</view>
|
||||||
<view class="grid-item">面料编号/米数</view>
|
<view class="grid-item">面料编号/米数</view>
|
||||||
</view>
|
</view>
|
||||||
<template v-for="(item,index) in form.orderItems.fabric" :key="index">
|
<view class="grid-container">
|
||||||
<view class="grid-container">
|
<view class="grid-item">{{fabrics.name}}</view>
|
||||||
<view class="grid-item">{{item.name}}</view>
|
<view class="grid-item">{{fabrics.qty}}</view>
|
||||||
<view class="grid-item">{{item.qty}}</view>
|
<view class="grid-item">{{fabrics.len}}</view>
|
||||||
<view class="grid-item">{{item.len}}</view>
|
<view class="grid-item">
|
||||||
<view class="grid-item">
|
<view v-for="(item,index) in bhms" :key="index" class="box">
|
||||||
<view v-for="(itemSecond,indexSecond) in item.bhms" :key="indexSecond" class="box">
|
{{item.code}}<br>{{item.ms}}米
|
||||||
{{itemSecond.code}}<br>{{itemSecond.ms}}米
|
<van-icon name="cross" color="red" @click="bhms.splice(index,1)" />
|
||||||
</view>
|
</view>
|
||||||
<view v-for="(itemSecond,indexSecond) in item.bhms1" :key="indexSecond" class="box">
|
<view class="a-c">
|
||||||
{{itemSecond.code}}<br>{{itemSecond.ms}}米
|
<van-button type="primary" @click="upScanCode()">
|
||||||
<van-icon name="cross" color="red" @click="item.bhms.splice(indexSecond,1)" />
|
扫一扫
|
||||||
</view>
|
</van-button>
|
||||||
|
|
||||||
<view class="a-c" v-if="form.orderItems.zt!='已配全'&&(item.bhms?item.bhms1?item.bhms.length+item.bhms1.length<item.qty:item.bhms.length<item.qty:item.bhms1?item.bhms1.length<item.qty:true)" >
|
|
||||||
<van-button type="primary" @click="upScanCode(index)">
|
|
||||||
扫一扫
|
|
||||||
</van-button>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</view>
|
||||||
<cshaptx4869-scancode v-if="h5ScanCode" @success="handleSuccess" @fail="handleFail"
|
<cshaptx4869-scancode v-if="h5ScanCode" @success="handleSuccess" @fail="handleFail"
|
||||||
@close="handleClose">
|
@close="handleClose">
|
||||||
</cshaptx4869-scancode>
|
</cshaptx4869-scancode>
|
||||||
|
|
||||||
<view v-if="form.orderItems.zt!='已配全'">
|
<view>
|
||||||
<van-field v-model="formItem.phrq" name="配货日期" label="配货日期" colon class="bor" label-width="5em"
|
<van-field v-model="formItem.phrq" name="配货日期" label="配货日期" colon class="bor" label-width="5em"
|
||||||
readonly :rules="[{ required: true, message: '请填写' }]" @click="chooseDate()" />
|
readonly :rules="[{ required: true, message: '请填写' }]" @click="chooseDate()" />
|
||||||
<van-field v-model="formItem.rc" name="染厂选择" label="染厂选择" colon class="bor" label-width="5em"
|
<van-field v-model="formItem.rc" name="染厂选择" label="染厂选择" colon class="bor" label-width="5em"
|
||||||
@ -236,7 +232,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
<view style="margin: 16px;display: flex;" v-if="form.orderItems.zt!='已配全'">
|
<view style="margin: 16px;display: flex;">
|
||||||
<van-button round block type="primary" native-type="submit" @click="beforeSubmit('部分配货')">
|
<van-button round block type="primary" native-type="submit" @click="beforeSubmit('部分配货')">
|
||||||
部分配货
|
部分配货
|
||||||
</van-button>
|
</van-button>
|
||||||
@ -367,7 +363,8 @@
|
|||||||
border: 1rpx solid #d7d7d7;
|
border: 1rpx solid #d7d7d7;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
.line{
|
|
||||||
|
.line {
|
||||||
border-bottom: 1rpx solid #d7d7d7;
|
border-bottom: 1rpx solid #d7d7d7;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
}
|
}
|
||||||
|
@ -10,16 +10,18 @@
|
|||||||
const show = ref(false)
|
const show = ref(false)
|
||||||
const formItem = ref({ jcps: 0, jcms: 0 } as any)
|
const formItem = ref({ jcps: 0, jcms: 0 } as any)
|
||||||
const list = ref()
|
const list = ref()
|
||||||
|
const orderId = ref()
|
||||||
|
const phjl = ref([] as any[])
|
||||||
|
|
||||||
// 定义 props
|
// 定义 props
|
||||||
defineProps<{
|
defineProps<{
|
||||||
item ?: string;
|
id ?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
onLoad(async (option : any) => {
|
onLoad(async (option : any) => {
|
||||||
if (option && option.item) {
|
if (option && option.id) {
|
||||||
try {
|
try {
|
||||||
form.value = JSON.parse(option.item);
|
orderId.value = option.id;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to parse item JSON:', error);
|
console.error('Failed to parse item JSON:', error);
|
||||||
// 可以选择在这里显示错误消息给用户
|
// 可以选择在这里显示错误消息给用户
|
||||||
@ -27,6 +29,16 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
getAction('/tribute/'+orderId.value).then((res:any)=>{
|
||||||
|
if(res.code===200){
|
||||||
|
phjl.value=res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
getAction('/interOrder/'+orderId.value).then((res : any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
form.value = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
getAction('/factory').then((res : any) => {
|
getAction('/factory').then((res : any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
list.value = res.data.map((l : any) => ({ text: l.name, value: l.name }))
|
list.value = res.data.map((l : any) => ({ text: l.name, value: l.name }))
|
||||||
@ -64,7 +76,8 @@
|
|||||||
os.push(item)
|
os.push(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
postAction('/ios', { orderId: form.value.id, fabric: form.value.fabric, os: os, zt: typeData.value, rc: formItem.value.rc }).then((res : any) => {
|
// zt: typeData.value,
|
||||||
|
postAction('/tribute', { orderId: form.value.id, type: '现货单', factory: formItem.value.rc,qty:'',len:'' ,data:''}).then((res : any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
showToast('提交成功!')
|
showToast('提交成功!')
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
@ -88,23 +101,7 @@
|
|||||||
bhms.value = []
|
bhms.value = []
|
||||||
}
|
}
|
||||||
const conScanCode = () => {
|
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 {
|
|
||||||
form.value.fabric[indexType.value].bhms1 = JSON.parse(JSON.stringify(bhms.value))
|
|
||||||
}
|
|
||||||
showDialog.value = false
|
|
||||||
let jcms = 0
|
|
||||||
formItem.value.jcps = 0
|
|
||||||
form.value.fabric.forEach((l : any) => {
|
|
||||||
if (l.bhms1) {
|
|
||||||
l.bhms1.forEach((k : any) => {
|
|
||||||
jcms += k.ms * 1
|
|
||||||
formItem.value.jcps++
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
formItem.value.jcms = jcms.toFixed(1)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function scanCode() {
|
function scanCode() {
|
||||||
@ -204,11 +201,11 @@
|
|||||||
<view class="grid-container">
|
<view class="grid-container">
|
||||||
<view class="grid-item">{{item.name}}</view>
|
<view class="grid-item">{{item.name}}</view>
|
||||||
<view class="grid-item">{{item.quantity}}</view>
|
<view class="grid-item">{{item.quantity}}</view>
|
||||||
<view class="grid-item">{{item.belongTo}}</view>
|
<view class="grid-item">门店</view>
|
||||||
<view class="grid-item">
|
<view class="grid-item">
|
||||||
<view v-for="(itemSecond,indexSecond) in item.bhms" :key="indexSecond" class="box">
|
<!-- <view v-for="(itemSecond,indexSecond) in phjl" :key="indexSecond" class="box">
|
||||||
{{itemSecond.code}}<br>{{itemSecond.ms}}米
|
{{itemSecond.code}}<br>{{itemSecond.ms}}米
|
||||||
</view>
|
</view> -->
|
||||||
<view v-for="(itemSecond,indexSecond) in item.bhms1" :key="indexSecond" class="box">
|
<view v-for="(itemSecond,indexSecond) in item.bhms1" :key="indexSecond" class="box">
|
||||||
{{itemSecond.code}}<br>{{itemSecond.ms}}米
|
{{itemSecond.code}}<br>{{itemSecond.ms}}米
|
||||||
<van-icon name="cross" color="red" @click="item.bhms1.splice(indexSecond,1)" />
|
<van-icon name="cross" color="red" @click="item.bhms1.splice(indexSecond,1)" />
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
import { onShow } from '@dcloudio/uni-app';
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
import { showToast } from 'vant';
|
import { showToast } from 'vant';
|
||||||
|
|
||||||
const form = ref({ status: '已通过' } as any)
|
const form = ref({} as any)
|
||||||
const list = ref([] as any[])
|
const list = ref([] as any[])
|
||||||
|
const mlList = ref([] as any[])
|
||||||
const statusList = ref([
|
const statusList = ref([
|
||||||
{ status: "部分配货", type: "warning" },
|
{ status: "部分配货", type: "warning" },
|
||||||
{ status: "待配货", type: "primary" },
|
{ status: "待配货", type: "primary" },
|
||||||
@ -56,63 +57,10 @@
|
|||||||
history.back()
|
history.back()
|
||||||
}
|
}
|
||||||
|
|
||||||
const total = ref(0)
|
|
||||||
const currentPage = ref(1)
|
|
||||||
const finished = ref(false)
|
|
||||||
const loading = ref(false);
|
|
||||||
|
|
||||||
//动态获取数据
|
|
||||||
const onLoad = () => {
|
|
||||||
if (list.value.length < total.value) {
|
|
||||||
currentPage.value++
|
|
||||||
init()
|
|
||||||
} else {
|
|
||||||
finished.value = true
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
total.value = 0
|
getAction('/tribute/getUnTribute', form.value).then((res : any) => {
|
||||||
getAction('/customOrder', { page: currentPage.value, size: 10, ...form.value }).then((res : any) => {
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
res.data.record.forEach((l : any) => {
|
list.value = res.data
|
||||||
l.lx = 1
|
|
||||||
if (l.orderItems.length) {
|
|
||||||
list.value.push(l)
|
|
||||||
}
|
|
||||||
l.orderItems.forEach((m : any) => {
|
|
||||||
let item = statusList.value.find((k : any) => k.status == m.zt)
|
|
||||||
m.statusColor = item.type
|
|
||||||
m.ypps=0
|
|
||||||
m.wpps=0
|
|
||||||
m.fabric.forEach((k:any)=>{
|
|
||||||
m.ypps+=k.bhms.length
|
|
||||||
m.wpps+=(k.quantity-k.bhms.length)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
total.value += res.data.total * 1
|
|
||||||
loading.value = false;
|
|
||||||
finished.value = false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
getAction('/interOrder', { page: currentPage.value, size: 10, ...form.value }).then((res : any) => {
|
|
||||||
if (res.code === 200) {
|
|
||||||
res.data.record.forEach((l : any) => {
|
|
||||||
l.lx = 2
|
|
||||||
list.value.push(l)
|
|
||||||
let item = statusList.value.find((m : any) => m.status == l.zt)
|
|
||||||
l.statusColor = item.type
|
|
||||||
l.ypps=0
|
|
||||||
l.wpps=0
|
|
||||||
l.fabric.forEach((m:any)=>{
|
|
||||||
l.ypps+=m.bhms.length
|
|
||||||
l.wpps+=(m.quantity-m.bhms.length)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
total.value += res.data.total * 1
|
|
||||||
loading.value = false;
|
|
||||||
finished.value = false
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -160,96 +108,26 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//详情
|
//详情
|
||||||
const toDetile = (item : any, item2 : any) => {
|
const toDetile = (item : any, item2 : any, index2 : any) => {
|
||||||
if (item.lx === 1) {
|
if (item.type === '定做单') {
|
||||||
let a = { customOrder: item.customOrder, orderItems: item2 }
|
item2.craftCmt = item.craftCmt
|
||||||
let url = './detailCus' + '?' + 'item=' + JSON.stringify(a)
|
item2.id = index2
|
||||||
|
item2.orderId = item.subId
|
||||||
|
let url = './detailCus' + '?' + 'id=' + item.orderId + '&item=' + JSON.stringify(item2)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: url,
|
url: url,
|
||||||
})
|
})
|
||||||
} else if (item.lx === 2) {
|
} else if (item.type === '现货单') {
|
||||||
let url = './detailSpot' + '?' + 'item=' + JSON.stringify(item)
|
let url = './detailSpot' + '?' + 'id=' + item.orderId
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: url,
|
url: url,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
const showColor = (zt : any) => {
|
||||||
|
let item = statusList.value.find((l : any) => l.status === zt)
|
||||||
const pickerList = ref([])//面料数据
|
return item.type
|
||||||
const pickerContainerList = ref([])
|
|
||||||
const showPickerList = ref(false)
|
|
||||||
const searchValue = ref('')//查询的值
|
|
||||||
const searchIndex = ref(0)//查询到的数组
|
|
||||||
const mlList = ref([])
|
|
||||||
//选择面料
|
|
||||||
const selectChoose = () => {
|
|
||||||
showPickerList.value = true
|
|
||||||
}
|
|
||||||
//面料开启
|
|
||||||
const mlmcOpen = () => {
|
|
||||||
pickerList.value = mlList.value
|
|
||||||
pickerContainerList.value = pickerList.value
|
|
||||||
searchValue.value = ''
|
|
||||||
}
|
|
||||||
//面料关闭
|
|
||||||
const pickerCancel = () => {
|
|
||||||
showPickerList.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
//搜索
|
|
||||||
const selectedValue = ref()
|
|
||||||
const getSeachList = () => {
|
|
||||||
searchIndex.value = 0
|
|
||||||
let reg = new RegExp(searchValue.value)
|
|
||||||
let arr = []
|
|
||||||
pickerList.value.forEach(l => {
|
|
||||||
if (reg.test(l.text)) {
|
|
||||||
arr.push(l)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
pickerContainerList.value = arr
|
|
||||||
}
|
|
||||||
//向上选择
|
|
||||||
const upSearch = () => {
|
|
||||||
if (searchIndex.value === 0 && pickerContainerList.value.length) {
|
|
||||||
searchIndex.value = pickerContainerList.value.length - 1
|
|
||||||
selectedValue.value = [pickerContainerList.value[searchIndex.value].text]
|
|
||||||
} else if (pickerContainerList.value.length) {
|
|
||||||
searchIndex.value--
|
|
||||||
selectedValue.value = [pickerContainerList.value[searchIndex.value].text]
|
|
||||||
} else {
|
|
||||||
showToast('没有了!')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//向下选择
|
|
||||||
const downSearch = () => {
|
|
||||||
if (pickerContainerList.value.length) {
|
|
||||||
if (searchIndex.value === pickerContainerList.value.length) {
|
|
||||||
searchIndex.value = 0
|
|
||||||
selectedValue.value = [pickerContainerList.value[searchIndex.value].text]
|
|
||||||
} else {
|
|
||||||
searchIndex.value++
|
|
||||||
selectedValue.value = [pickerContainerList.value[searchIndex.value].text]
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
showToast('没有了!')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//搜索框输入
|
|
||||||
const timer = ref()
|
|
||||||
const searchTo = () => {
|
|
||||||
if (timer.value) {
|
|
||||||
clearTimeout(timer.value)
|
|
||||||
}
|
|
||||||
timer.value = setTimeout(() => {
|
|
||||||
getSeachList()
|
|
||||||
}, 800)
|
|
||||||
}
|
|
||||||
const onConfirm = (val : any) => {
|
|
||||||
form.value.category = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1]
|
|
||||||
pickerCancel()
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -275,61 +153,58 @@
|
|||||||
<view class="grid-item">状态</view>
|
<view class="grid-item">状态</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
|
<view v-for="(item,index) in list" :key="index">
|
||||||
<view v-for="(item,index) in list" :key="index">
|
<template v-if="item.type==='定做单'">
|
||||||
<template v-if="item.lx===1">
|
<view class="grid-container">
|
||||||
<view class="grid-container" v-for="(itemSecond,indexSecond) in item.orderItems"
|
<view class="grid-item">{{item.makeTime}}<br>{{item.fabrics[0].color}}</view>
|
||||||
:key="indexSecond">
|
|
||||||
<view class="grid-item">{{item.customOrder.makeTime}}<br>{{itemSecond.color}}</view>
|
|
||||||
<view class="grid-item">
|
|
||||||
<view class="grid-container1">
|
|
||||||
<view :class="indexThird===(itemSecond.fabric.length-1)?'grid-item2':'grid-item1'"
|
|
||||||
v-for="(itemThird,indexThird) in itemSecond.fabric" :key="indexThird">
|
|
||||||
{{itemThird.name}}<br>{{itemSecond.craft}} {{item.customOrder.sd}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="grid-item">
|
|
||||||
<view class="grid-container1">
|
|
||||||
<view :class="indexThird===(itemSecond.fabric.length-1)?'grid-item2':'grid-item1'"
|
|
||||||
v-for="(itemThird,indexThird) in itemSecond.fabric" :key="indexThird">
|
|
||||||
{{itemThird.qty}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="grid-item" @click="toDetile(item,itemSecond)">
|
|
||||||
<van-button :type="itemSecond.statusColor">{{itemSecond.zt}}</van-button>
|
|
||||||
<p>已配货{{itemSecond.ypps}}匹</p>
|
|
||||||
<p>待配货{{itemSecond.wpps}}匹</p>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<view class="grid-container" v-if="item.lx===2">
|
|
||||||
<view class="grid-item">{{item.makeTime}}<br>{{item.color}}</view>
|
|
||||||
<view class="grid-item">
|
<view class="grid-item">
|
||||||
<view class="grid-container1">
|
<view class="grid-container1">
|
||||||
<view :class="indexSecond===(item.fabric.length-1)?'grid-item2':'grid-item1'"
|
<view :class="indexSecond===(item.fabrics.length-1)?'grid-item2':'grid-item1'"
|
||||||
v-for="(itemSecond,indexSecond) in item.fabric" :key="indexSecond">
|
v-for="(itemSecond,indexSecond) in item.fabrics" :key="indexSecond">
|
||||||
{{itemSecond.name}}<br>{{item.craft}} {{itemSecond.belongTo}}
|
{{itemSecond.name}}<br>{{itemSecond.craft}} {{itemSecond.sd}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="grid-item">
|
<view class="grid-item">
|
||||||
<view class="grid-container1">
|
<view class="grid-container1">
|
||||||
<view :class="indexSecond===(item.fabric.length-1)?'grid-item2':'grid-item1'"
|
<view :class="indexSecond===(item.fabrics.length-1)?'grid-item2':'grid-item1'"
|
||||||
v-for="(itemSecond,indexSecond) in item.fabric" :key="indexSecond">
|
v-for="(itemSecond,indexSecond) in item.fabrics" :key="indexSecond">
|
||||||
{{itemSecond.quantity}}
|
{{itemSecond.qty}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="grid-item" @click="toDetile(item)">
|
<view class="grid-item" @click="toDetile(item)">
|
||||||
<van-button :type="item.statusColor">{{item.zt}}</van-button>
|
<van-button :type="showColor(item.zt)">{{item.zt}}</van-button>
|
||||||
<p>已配货{{item.ypps}}匹</p>
|
<p>已配货{{item.ypps}}匹</p>
|
||||||
<p>待配货{{item.wpps}}匹</p>
|
<p>待配货{{item.wpps}}匹</p>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</template>
|
||||||
|
<view class="grid-container" v-if="item.type==='现货单'">
|
||||||
|
<view class="grid-item">{{item.makeTime}}<br>{{item.fabrics[0].color}}</view>
|
||||||
|
<view class="grid-item">
|
||||||
|
<view class="grid-container1">
|
||||||
|
<view :class="indexSecond===(item.fabrics.length-1)?'grid-item2':'grid-item1'"
|
||||||
|
v-for="(itemSecond,indexSecond) in item.fabrics" :key="indexSecond">
|
||||||
|
{{itemSecond.name}}<br>{{itemSecond.craft}} {{itemSecond.sd}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="grid-item">
|
||||||
|
<view class="grid-container1">
|
||||||
|
<view :class="indexSecond===(item.fabrics.length-1)?'grid-item2':'grid-item1'"
|
||||||
|
v-for="(itemSecond,indexSecond) in item.fabrics" :key="indexSecond">
|
||||||
|
{{itemSecond.qty}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="grid-item" @click="toDetile(item)">
|
||||||
|
<van-button :type="showColor(item.zt)">{{item.zt}}</van-button>
|
||||||
|
<p>已配货{{item.ypps}}匹</p>
|
||||||
|
<p>待配货{{item.wpps}}匹</p>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</van-list>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -341,31 +216,6 @@
|
|||||||
|
|
||||||
<van-calendar v-model:show="show" @confirm="onConfirmDate" :min-date="new Date(2010, 0, 1)"
|
<van-calendar v-model:show="show" @confirm="onConfirmDate" :min-date="new Date(2010, 0, 1)"
|
||||||
:max-date="new Date(2050, 0, 31)" />
|
:max-date="new Date(2050, 0, 31)" />
|
||||||
|
|
||||||
<!-- 面料选择框-->
|
|
||||||
<van-popup v-model:show="showPickerList" position="bottom" @open="mlmcOpen">
|
|
||||||
<view class="select-model">
|
|
||||||
<van-picker :columns="pickerContainerList" @cancel="pickerCancel" v-model="selectedValue"
|
|
||||||
@confirm="onConfirm" />
|
|
||||||
<view>
|
|
||||||
<view class="top-select">
|
|
||||||
<view class="confirm-select">
|
|
||||||
<p>请选择品种</p>
|
|
||||||
</view>
|
|
||||||
<view class="search-box">
|
|
||||||
<view>
|
|
||||||
<van-search placeholder="请输入品种名字" v-model="searchValue" label="面料搜索:" background="#ffffff"
|
|
||||||
@input="searchTo()" :clearable="false" />
|
|
||||||
</view>
|
|
||||||
<view class="flex-btn">
|
|
||||||
<button class="search-btn" @click="upSearch()">↑</button>
|
|
||||||
<button class="search-btn" @click="downSearch()">↓</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</van-popup>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@ -389,6 +239,7 @@
|
|||||||
border: 1px solid #f2f2f2;
|
border: 1px solid #f2f2f2;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
text-align: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user