跟单
This commit is contained in:
parent
1cfca59074
commit
a64e943929
12
pages.json
12
pages.json
@ -315,6 +315,18 @@
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/documentary/documentary",
|
||||
"style" :
|
||||
{
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": false,
|
||||
"disableScroll": true,
|
||||
"app-plus": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
@ -30,9 +30,9 @@
|
||||
}
|
||||
})
|
||||
//工艺信息
|
||||
getAction('/fabric/craft/info').then((res : any) => {
|
||||
getAction('/flowBind').then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
craftList.value = res.data.map((l : any) => ({ value: l.name, text: l.name }))
|
||||
craftList.value = res.data
|
||||
}
|
||||
})
|
||||
//面料信息
|
||||
@ -83,14 +83,14 @@
|
||||
}
|
||||
|
||||
const onClickLeft = () => {
|
||||
uni.navigateBack()
|
||||
window.history.back();
|
||||
}
|
||||
|
||||
const onSubmit = () => {
|
||||
postAction('/customOrder',form.value).then((res:any)=>{
|
||||
if(res.code===200){
|
||||
postAction('/customOrder', form.value).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
showToast('提交成功!')
|
||||
uni.navigateBack()
|
||||
window.history.back();
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -124,7 +124,18 @@
|
||||
form.value.customOrder[typeData.value] = val.selectedOptions[0].value
|
||||
} else if (typeData.value === 'extraOptions') {
|
||||
form.value.orderItems[indexData.value][typeData.value][indexData1.value].value = val.selectedValues[0]
|
||||
} else {
|
||||
} else if(typeData.value === 'craftFlow'){
|
||||
let url='/craftFlows/byName?name='+val.selectedValues[0]
|
||||
getAction(url).then((res:any)=>{
|
||||
if(res.code===200){
|
||||
form.value.orderItems[indexData.value].process=JSON.stringify(res.data)
|
||||
form.value.orderItems[indexData.value][typeData.value] = val.selectedValues[0]
|
||||
}else{
|
||||
showToast('请重新选择工艺流程!')
|
||||
form.value.orderItems[indexData.value][typeData.value] = ''
|
||||
}
|
||||
})
|
||||
} else{
|
||||
form.value.customOrder[typeData.value] = val.selectedValues[0]
|
||||
}
|
||||
showPickerCancel()
|
||||
@ -136,13 +147,28 @@
|
||||
//弹窗开启事件
|
||||
const handleOpen = () => {
|
||||
if (typeData.value === 'craft') {
|
||||
popuList.value = craftList.value
|
||||
popuList.value = craftList.value.map((l : any) => ({ value: l.craftName, text: l.craftName }))
|
||||
} else if (typeData.value === 'hasTex') {
|
||||
popuList.value = [{ value: 'true', text: '含税' }, { value: 'false', text: '不含税' }]
|
||||
} else if (typeData.value === 'belongTo') {
|
||||
popuList.value = nameList.value
|
||||
} else if (typeData.value === 'extraOptions') {
|
||||
popuList.value = otherList.value[indexData.value].options.map((l : any) => ({ text: l.name, value: l.name }))
|
||||
}else if (typeData.value === 'craftFlow') {
|
||||
let item={} as any
|
||||
craftList.value.forEach((l:any)=>{
|
||||
if(l.craftName===form.value.orderItems[indexData.value].craft){
|
||||
item=l;
|
||||
}
|
||||
})
|
||||
popuList.value = []
|
||||
if(item.flows){
|
||||
item.flows.forEach((l : any) => {
|
||||
if(l.bind==='通用') {
|
||||
popuList.value.push({ value: l.name, text: l.name} )
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -279,17 +305,17 @@
|
||||
form.value.customOrder.currency = ddje.toFixed(1)
|
||||
}
|
||||
const validator = (val : any) => /^\d+(\.\d)?$|^(\.\d)$/.test(val);
|
||||
|
||||
|
||||
//客户选择
|
||||
const showPopup = ref(false)
|
||||
const customerList = ref([] as any[])
|
||||
const choose = (item:any) =>{
|
||||
showPopup.value = !showPopup.value
|
||||
form.value.customOrder.customerName=item.name
|
||||
form.value.customOrder.customerId=item.id
|
||||
const choose = (item : any) => {
|
||||
showPopup.value = !showPopup.value
|
||||
form.value.customOrder.customerName = item.name
|
||||
form.value.customOrder.customerId = item.id
|
||||
}
|
||||
|
||||
const search = () =>{
|
||||
|
||||
const search = () => {
|
||||
if (timer.value) {
|
||||
clearTimeout(timer.value)
|
||||
}
|
||||
@ -297,12 +323,12 @@
|
||||
getCustom()
|
||||
}, 800)
|
||||
}
|
||||
const getCustom = () =>{
|
||||
const getCustom = () => {
|
||||
showPopup.value = !showPopup.value
|
||||
let url='/getNames?keyword='+form.value.customOrder.customerName
|
||||
getAction(url).then((res:any)=>{
|
||||
if(res.code===200){
|
||||
customerList.value=res.data
|
||||
let url = '/getNames?keyword=' + form.value.customOrder.customerName
|
||||
getAction(url).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
customerList.value = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -315,7 +341,7 @@
|
||||
<van-form @submit="onSubmit">
|
||||
<van-cell-group inset>
|
||||
<van-field v-model="form.customOrder.customerName" name="客户名称" label="客户名称" colon class="bor"
|
||||
label-width="5em" :rules="[{ required: true, message: '请填写' }]" @input="search()"/>
|
||||
label-width="5em" :rules="[{ required: true, message: '请填写' }]" @input="search()" />
|
||||
<transition name="fade">
|
||||
<ul class="searchPop" v-if="showPopup">
|
||||
<template v-for="item in customerList">
|
||||
@ -348,6 +374,9 @@
|
||||
<van-field v-model="item.craft" name="工艺名称" label="工艺名称" colon
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor"
|
||||
@click="choosePic('craft',index)" />
|
||||
<van-field v-model="item.craftFlow" name="工艺流程" label="工艺流程" colon
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor"
|
||||
@click="choosePic('craftFlow',index)" />
|
||||
<view v-for="(itemSecond,indexSecond) in item.fabric" :key="index">
|
||||
<view class="a-c">
|
||||
<van-icon name="add" color="red" size="25" v-if="index===0"
|
||||
@ -622,19 +651,19 @@
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.searchPop {
|
||||
position: absolute;
|
||||
left: 30vw;
|
||||
width: 60vw;
|
||||
background-color: #f7f8fa;
|
||||
max-height: 16vh;
|
||||
overflow-y: scroll;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
li {
|
||||
border-top: 2px solid #fff;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
.searchPop {
|
||||
position: absolute;
|
||||
left: 30vw;
|
||||
width: 60vw;
|
||||
background-color: #f7f8fa;
|
||||
max-height: 16vh;
|
||||
overflow-y: scroll;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
li {
|
||||
border-top: 2px solid #fff;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
</style>
|
@ -84,21 +84,23 @@
|
||||
}
|
||||
|
||||
const onClickLeft = () => {
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
|
||||
const onSubmit = () => {
|
||||
putAction('/customOrder', form.value).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
showToast('提交成功!')
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onLoad((option : any) => {
|
||||
form.value = JSON.parse(option.item)
|
||||
fileList.value = [{ url: form.value.customOrder.checkPic }]
|
||||
if(form.value.customOrder.status==='已通过'){
|
||||
fileList.value = [{ url: form.value.customOrder.checkPic }]
|
||||
}
|
||||
hasTex.value = form.value.customOrder.hasTex ? '含税' : '不含税'
|
||||
})
|
||||
|
||||
@ -322,7 +324,7 @@
|
||||
putAction(url, form.value.customOrder.cancelReason, { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' }).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
showToast('取消成功!')
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -337,7 +339,7 @@
|
||||
putAction(url).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
showToast('操作成功!')
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -357,7 +359,7 @@
|
||||
putAction(url, { pic: pic.value, comment: form.value.customOrder.interComment }).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
showToast('操作成功!')
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -374,7 +376,7 @@
|
||||
putAction(url).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
showToast('操作成功!')
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -390,7 +392,7 @@
|
||||
putAction(url).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
showToast('操作成功!')
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -514,7 +516,7 @@
|
||||
label-width="5em" />
|
||||
<van-field v-model="form.customOrder.interComment" name="内部备注" label="内部备注" colon
|
||||
label-width="5em" />
|
||||
<view v-if="form.customOrder.status==='待排单审核'">
|
||||
<view v-if="form.customOrder.status==='待排单员审核'">
|
||||
<van-field name="uploader" label="排单图" label-width="5em" colon class="bor-n">
|
||||
<template #input>
|
||||
<van-uploader v-model="fileList" multiple :max-count="1" :after-read="afterRead" />
|
||||
|
@ -1,73 +1,247 @@
|
||||
<script setup lang="ts">
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { ref } from 'vue';
|
||||
import { getAction, postAction } from '../../common/http';
|
||||
import { showToast } from 'vant';
|
||||
import { formatDate } from '../../utils/date';
|
||||
|
||||
const form = ref({} as any)
|
||||
const showDialog = ref(false)
|
||||
const show = ref(false)
|
||||
onLoad((option : any) => {
|
||||
form.value = JSON.parse(option.item)
|
||||
console.log(form.value);
|
||||
const formItem = ref({ jcps: 0, jcms: 0 } as any)
|
||||
const list = ref()
|
||||
|
||||
onLoad(async (option : any) => {
|
||||
if (option && option.item) {
|
||||
try {
|
||||
form.value = JSON.parse(option.item);
|
||||
} catch (error) {
|
||||
console.error('Failed to parse item JSON:', error);
|
||||
// 可以选择在这里显示错误消息给用户
|
||||
}
|
||||
}
|
||||
getAction('/factory').then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
list.value = res.data.map((l : any) => ({ text: l.name, value: l.name }))
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
const onClickLeft = () => {
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
|
||||
const onConfirmDate = (val : any) => {
|
||||
console.log(val);
|
||||
}
|
||||
const onSubmit = () => {
|
||||
let os = []
|
||||
form.value.orderItems.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.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 }).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
showToast('提交成功!')
|
||||
uni.redirectTo({
|
||||
url: '/pages/distribution/distribution'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const typeData = ref()
|
||||
const beforeSubmit = (type : any) => {
|
||||
typeData.value = type
|
||||
}
|
||||
//扫一扫
|
||||
const h5ScanCode = ref(false);
|
||||
const bhms = ref([] as any[])
|
||||
const indexType = ref()
|
||||
const upScanCode = (index : any) => {
|
||||
scanCode()
|
||||
indexType.value = index
|
||||
bhms.value = []
|
||||
}
|
||||
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
|
||||
let jcms = 0
|
||||
formItem.value.jcps = 0
|
||||
form.value.orderItems.fabric.forEach((l : any) => {
|
||||
l.bhms1.forEach((k : any) => {
|
||||
jcms += k.ms * 1
|
||||
formItem.value.jcps++
|
||||
})
|
||||
})
|
||||
formItem.value.jcms = jcms.toFixed(1)
|
||||
}
|
||||
|
||||
function scanCode() {
|
||||
h5ScanCode.value = true;
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: res.result,
|
||||
});
|
||||
},
|
||||
faile: (err : any) => {
|
||||
console.log("err", err);
|
||||
},
|
||||
});
|
||||
}
|
||||
function handleSuccess(res : any) {
|
||||
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 })
|
||||
showDialog.value = true
|
||||
}
|
||||
})
|
||||
}
|
||||
function handleFail(err : any) {
|
||||
uni.showModal({
|
||||
title: err.errName,
|
||||
content: err.errMsg,
|
||||
complete: () => {
|
||||
h5ScanCode.value = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
function handleClose() {
|
||||
h5ScanCode.value = false;
|
||||
}
|
||||
|
||||
const chooseDate = () => {
|
||||
show.value = true
|
||||
}
|
||||
//日期选择
|
||||
const onConfirmDate = (val : any) => {
|
||||
formItem.value.phrq = formatDate(val)
|
||||
show.value = false
|
||||
}
|
||||
|
||||
const showPicker = ref(false)
|
||||
const popuList = ref([] as any[])
|
||||
//选择框事件
|
||||
const choosePic = () => {
|
||||
showPicker.value = true
|
||||
}
|
||||
//选择框确认
|
||||
const pickerConfirm = (val : any) => {
|
||||
formItem.value.rc = val.selectedValues[0]
|
||||
showPickerCancel()
|
||||
}
|
||||
//取消
|
||||
const showPickerCancel = () => {
|
||||
showPicker.value = false
|
||||
}
|
||||
//弹窗开启事件
|
||||
const handleOpen = () => {
|
||||
popuList.value = list.value
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="flex">
|
||||
<van-nav-bar title="现货需求单" left-text="返回" left-arrow @click-left="onClickLeft" />
|
||||
<van-nav-bar title="定做单" left-text="返回" left-arrow @click-left="onClickLeft" />
|
||||
<view class="content">
|
||||
<van-form @submit="onSubmit">
|
||||
<van-cell-group inset>
|
||||
<van-field v-model="form.customOrder.id" name="需求单号" label="需求单号" colon class="bor-n" label-width="5em" readonly
|
||||
:rules="[{ required: true, message: '请填写' }]" />
|
||||
<van-field v-model="form.customOrder.makeTime" name="做单日期" label="做单日期" colon class="bor-n" label-width="5em"
|
||||
readonly :rules="[{ required: true, message: '请填写' }]" />
|
||||
<van-field v-model="form.customOrder.belongTo" name="订单归属" label="订单归属" colon class="bor-n" label-width="5em"
|
||||
:rules="[{ required: true, message: '请填写' }]" readonly />
|
||||
<van-field v-model="form.orderItems.color" name="颜色色号" label="颜色色号" colon class="bor" readonly
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" />
|
||||
<van-field v-model="form.craft" name="工艺" label="工艺" colon
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor" />
|
||||
<van-field v-model="form.craft" name="备注" label="备注" colon
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor" />
|
||||
|
||||
<van-field v-model="form.customOrder.id" name="订单编号" label="订单编号" colon class="bor-n"
|
||||
label-width="5em" readonly />
|
||||
<van-field v-model="form.customOrder.makeTime" name="做单日期" label="做单日期" colon class="bor-n"
|
||||
label-width="5em" readonly />
|
||||
<van-field v-model="form.customOrder.belongTo" name="订单归属" label="订单归属" colon class="bor-n"
|
||||
label-width="5em" readonly />
|
||||
<van-field v-model="form.customOrder.sd" name="谁定" label="谁定" colon class="bor-n" readonly
|
||||
label-width="5em" />
|
||||
<van-field v-model="form.orderItems.craft" name="工艺" label="工艺" colon label-width="5em" readonly
|
||||
class="bor-n" />
|
||||
<van-field v-model="form.orderItems.craftComment.name" name="工艺要求" label="工艺要求" colon
|
||||
label-width="5em" readonly class="bor-n" />
|
||||
<van-field v-model="form.customOrder.interComment" name="内部备注" label="内部备注" colon label-width="5em"
|
||||
readonly class="bor-n" />
|
||||
<van-field v-model="form.orderItems.color" name="需求颜色" label="需求颜色" colon label-width="5em" readonly
|
||||
class="bor-n" />
|
||||
|
||||
<view class="grid-container">
|
||||
<view class="grid-item">面料名称</view>
|
||||
<view class="grid-item">匹数</view>
|
||||
<view class="grid-item">谁定</view>
|
||||
<view class="grid-item">面料编号/米数</view>
|
||||
</view>
|
||||
<view class="grid-container" v-for="(item,index) in form.fabric" :key="index">
|
||||
<view class="grid-item">面料名称</view>
|
||||
<view class="grid-item">匹数</view>
|
||||
<view class="grid-item">谁定</view>
|
||||
<view class="grid-item">米数</view>
|
||||
<view class="grid-item">面料编号/米数</view>
|
||||
</view>
|
||||
<template v-for="(item,index) in form.orderItems.fabric" :key="index">
|
||||
<view class="grid-container">
|
||||
<view class="grid-item">{{item.name}}</view>
|
||||
<view class="grid-item">{{item.qty}}</view>
|
||||
<view class="grid-item">{{item.len}}</view>
|
||||
<view class="grid-item">
|
||||
<view v-for="(itemSecond,indexSecond) in item.bhms" :key="indexSecond" class="box">
|
||||
{{itemSecond.code}}<br>{{itemSecond.ms}}米
|
||||
</view>
|
||||
<view v-for="(itemSecond,indexSecond) in item.bhms1" :key="indexSecond" class="box">
|
||||
{{itemSecond.code}}<br>{{itemSecond.ms}}米
|
||||
<van-icon name="cross" color="red" @click="item.bhms.splice(indexSecond,1)" />
|
||||
</view>
|
||||
<view class="a-c" v-if="form.orderItems.zt!='已配全'">
|
||||
<van-button type="primary" @click="upScanCode(index)">
|
||||
扫一扫
|
||||
</van-button>
|
||||
<cshaptx4869-scancode v-if="h5ScanCode" @success="handleSuccess" @fail="handleFail"
|
||||
@close="handleClose">
|
||||
</cshaptx4869-scancode>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.phrq" class="line">
|
||||
<van-field v-model="item.phrq" name="配货日期" label="配货日期" colon class="bor" label-width="5em"
|
||||
readonly/>
|
||||
<van-field v-model="item.rc" name="染厂选择" label="染厂选择" colon class="bor" label-width="5em"
|
||||
readonly/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<van-field v-model="form.id" name="第1次配货日期" label="第1次配货日期" colon class="bor" label-width="5em" readonly
|
||||
:rules="[{ required: true, message: '请填写' }]" />
|
||||
<van-field v-model="form.makeTime" name="染厂选择" label="染厂选择" colon class="bor" label-width="5em"
|
||||
readonly :rules="[{ required: true, message: '请填写' }]" />
|
||||
<van-field v-model="form.makeUser" name="进厂匹数" label="进厂匹数" colon label-width="5em"
|
||||
:rules="[{ required: true, message: '请填写' }]" readonly />
|
||||
<van-field v-model="form.color" name="进厂米数" label="进厂米数" colon class="bor" readonly
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" />
|
||||
<view v-if="form.orderItems.zt!='已配全'">
|
||||
<van-field v-model="formItem.phrq" name="配货日期" label="配货日期" colon class="bor" label-width="5em"
|
||||
readonly :rules="[{ required: true, message: '请填写' }]" @click="chooseDate()" />
|
||||
<van-field v-model="formItem.rc" name="染厂选择" label="染厂选择" colon class="bor" label-width="5em"
|
||||
readonly :rules="[{ required: true, message: '请填写' }]" @click="choosePic" />
|
||||
<van-field v-model="formItem.jcps" name="进厂匹数" label="进厂匹数" colon label-width="5em"
|
||||
class="bor-n" readonly />
|
||||
<van-field v-model="formItem.jcms" name="进厂米数" label="进厂米数" colon class="bor-n" readonly
|
||||
label-width="5em" />
|
||||
</view>
|
||||
|
||||
</van-cell-group>
|
||||
<view style="margin: 16px;display: flex;">
|
||||
<van-button round block type="primary" native-type="submit">
|
||||
<view style="margin: 16px;display: flex;" v-if="form.orderItems.zt!='已配全'">
|
||||
<van-button round block type="primary" native-type="submit" @click="beforeSubmit('部分配货')">
|
||||
部分配货
|
||||
</van-button>
|
||||
<van-button round block type="primary" native-type="submit">
|
||||
<van-button round block type="primary" native-type="submit" @click="beforeSubmit('已配全')"
|
||||
style="margin-left: 15px;">
|
||||
已配全
|
||||
</van-button>
|
||||
</view>
|
||||
@ -77,39 +251,37 @@
|
||||
|
||||
<van-dialog v-model:show="showDialog">
|
||||
<view>
|
||||
<h3 style="text-align: center;margin-top: 10rpx;">扫码成功</h3>
|
||||
<van-cell-group inset>
|
||||
<view v-for="(item,index) in fabric" :key="index">
|
||||
<view class="a-c">
|
||||
<van-icon name="add" color="red" size="25" v-if="index===0"
|
||||
@click="fabric.push({belongTo:'门店'})" />
|
||||
<van-icon name="clear" color="red" size="25" v-if="index!=0" @click="fabric.splice(index,1)" />
|
||||
<van-field v-model="item.name" name="面料名称" label="面料名称" colon readonly label-width="5em"
|
||||
@click="selectChoose(index)" class="bor" />
|
||||
</view>
|
||||
<van-field v-model="item.quantity" name="需求匹数" label="需求匹数" type="number" colon
|
||||
label-width="6.5em" />
|
||||
<!-- <van-field v-model="item.storageQuantity" name="库存匹数" label="库存匹数" colon label-width="6.5em"
|
||||
readonly /> -->
|
||||
<van-field v-model="item.belongTo" name="订单归属人" label="订单归属人" colon label-width="6.5em" />
|
||||
<view v-for="(item,index) in bhms" :key="index">
|
||||
<van-field v-model="item.code" name="面料编号" label="面料编号" colon readonly label-width="5em"
|
||||
class="bor-n" />
|
||||
<van-field v-model="item.syps" name="剩余米数" label="剩余米数" colon label-width="5em" class="bor-n"
|
||||
readonly />
|
||||
<van-field v-model="item.ms" name="排单米数" label="排单米数" colon label-width="5em" />
|
||||
</view>
|
||||
</van-cell-group>
|
||||
</view>
|
||||
<template #footer>
|
||||
<view class="footer-button">
|
||||
<van-button plain size="small" native-type="button" style="width: 25vw;" @click="showDialog=false">
|
||||
取消
|
||||
<van-button plain size="small" native-type="button" style="width: 25vw;" @click="conScanCode">
|
||||
扫描结束
|
||||
</van-button>
|
||||
<van-button size="small" type="success" native-type="submit" style="width: 25vw;"
|
||||
@click="confirmSecond">
|
||||
确认
|
||||
<van-button size="small" type="success" native-type="submit" style="width: 25vw;" @click="scanCode">
|
||||
继续扫码
|
||||
</van-button>
|
||||
</view>
|
||||
</template>
|
||||
</van-dialog>
|
||||
|
||||
|
||||
<van-calendar v-model:show="show" @confirm="onConfirmDate" :min-date="new Date(2010, 0, 1)"
|
||||
:max-date="new Date(2050, 0, 31)" />
|
||||
<!--选择框-->
|
||||
<van-popup v-model:show="showPicker" round position="bottom" @open="handleOpen">
|
||||
<van-picker show-toolbar :columns="popuList" @confirm="pickerConfirm" @cancel="showPickerCancel"
|
||||
ref="pickerRef" />
|
||||
</van-popup>
|
||||
|
||||
<van-calendar v-model:show="show" @confirm="onConfirmDate" :min-date="new Date(2025, 0, 1)" />
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -129,12 +301,15 @@
|
||||
|
||||
.grid-container {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr 1.5fr 1fr;
|
||||
grid-template-columns: 2fr 1fr 1.5fr 2fr;
|
||||
|
||||
.grid-item {
|
||||
border: 1px solid #f2f2f2;
|
||||
text-align: center;
|
||||
padding: 15rpx 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
||||
::v-deep .van-cell {
|
||||
padding: 0 5px;
|
||||
@ -154,23 +329,15 @@
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.a-b {
|
||||
margin: 10rpx;
|
||||
|
||||
::v-deep .van-button--normal {
|
||||
padding: 5px 8px;
|
||||
height: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.a-c {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
::v-deep .van-button--normal {
|
||||
padding: 8rpx;
|
||||
height: 50rpx;
|
||||
width: 7em;
|
||||
width: 4em;
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,7 +346,8 @@
|
||||
border: 1px solid #d7d7d7;
|
||||
}
|
||||
}
|
||||
.bor-n{
|
||||
|
||||
.bor-n {
|
||||
::v-deep .van-field__control {
|
||||
border: none;
|
||||
}
|
||||
@ -193,4 +361,14 @@
|
||||
::v-deep .van-field__label {
|
||||
text-align: end;
|
||||
}
|
||||
|
||||
.box {
|
||||
margin: 5rpx 20rpx;
|
||||
border: 1rpx solid #d7d7d7;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.line{
|
||||
border-bottom: 1rpx solid #d7d7d7;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
</style>
|
@ -2,17 +2,25 @@
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { ref } from 'vue';
|
||||
import { formatDate } from '../../utils/date';
|
||||
import { getAction } from '../../common/http';
|
||||
import { getAction, postAction } from '../../common/http';
|
||||
import { showToast } from 'vant';
|
||||
|
||||
const form = ref({} as any)
|
||||
const showDialog = 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()
|
||||
|
||||
onLoad((option : any) => {
|
||||
form.value = JSON.parse(option.item)
|
||||
console.log(form.value);
|
||||
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);
|
||||
// 可以选择在这里显示错误消息给用户
|
||||
}
|
||||
}
|
||||
getAction('/factory').then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
list.value = res.data.map((l : any) => ({ text: l.name, value: l.name }))
|
||||
@ -21,11 +29,47 @@
|
||||
})
|
||||
|
||||
const onClickLeft = () => {
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
|
||||
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))
|
||||
}
|
||||
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)
|
||||
})
|
||||
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){
|
||||
showToast('提交成功!')
|
||||
uni.redirectTo({
|
||||
url:'/pages/distribution/distribution'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const typeData=ref()
|
||||
const beforeSubmit = (type:any) =>{
|
||||
typeData.value=type
|
||||
}
|
||||
|
||||
//扫一扫
|
||||
@ -37,17 +81,22 @@
|
||||
indexType.value = index
|
||||
bhms.value = []
|
||||
}
|
||||
const conScanCode = () =>{
|
||||
form.value.fabric[indexType.value].bhms=JSON.parse(JSON.stringify(bhms.value))
|
||||
showDialog.value=false
|
||||
let jcms=0
|
||||
form.value.fabric.forEach((l:any)=>{
|
||||
l.bhms.forEach((k:any)=>{
|
||||
jcms+=k.ms*1
|
||||
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) => {
|
||||
l.bhms1.forEach((k : any) => {
|
||||
jcms += k.ms * 1
|
||||
formItem.value.jcps++
|
||||
})
|
||||
})
|
||||
formItem.value.jcms=jcms.toFixed(1)
|
||||
formItem.value.jcms = jcms.toFixed(1)
|
||||
}
|
||||
|
||||
function scanCode() {
|
||||
@ -66,10 +115,10 @@
|
||||
}
|
||||
function handleSuccess(res : any) {
|
||||
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){
|
||||
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 })
|
||||
showDialog.value=true
|
||||
showDialog.value = true
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -82,6 +131,9 @@
|
||||
},
|
||||
});
|
||||
}
|
||||
function handleClose() {
|
||||
h5ScanCode.value = false;
|
||||
}
|
||||
|
||||
const chooseDate = () => {
|
||||
show.value = true
|
||||
@ -138,39 +190,54 @@
|
||||
<view class="grid-item">谁定</view>
|
||||
<view class="grid-item">面料编号/米数</view>
|
||||
</view>
|
||||
<view class="grid-container" v-for="(item,index) in form.fabric" :key="index">
|
||||
<view class="grid-item">{{item.name}}</view>
|
||||
<view class="grid-item">{{item.quantity}}</view>
|
||||
<view class="grid-item">{{item.belongTo}}</view>
|
||||
<view class="grid-item">
|
||||
<view v-for="(itemSecond,indexSecond) in item.bhms" :key="indexSecond" class="box">
|
||||
{{itemSecond.code}}<br>{{itemSecond.ms}}米
|
||||
<van-icon name="cross" color="red" @click="item.bhms.splice(indexSecond,1)"/>
|
||||
</view>
|
||||
<view class="a-c">
|
||||
<van-button type="primary" @click="upScanCode(index)">
|
||||
扫一扫
|
||||
</van-button>
|
||||
<cshaptx4869-scancode v-if="h5ScanCode" @success="handleSuccess" @fail="handleFail"
|
||||
@close="handleClose"></cshaptx4869-scancode>
|
||||
|
||||
<template v-for="(item,index) in form.fabric" :key="index">
|
||||
<view class="grid-container">
|
||||
<view class="grid-item">{{item.name}}</view>
|
||||
<view class="grid-item">{{item.quantity}}</view>
|
||||
<view class="grid-item">{{item.belongTo}}</view>
|
||||
<view class="grid-item">
|
||||
<view v-for="(itemSecond,indexSecond) in item.bhms" :key="indexSecond" class="box">
|
||||
{{itemSecond.code}}<br>{{itemSecond.ms}}米
|
||||
</view>
|
||||
<view v-for="(itemSecond,indexSecond) in item.bhms1" :key="indexSecond" class="box">
|
||||
{{itemSecond.code}}<br>{{itemSecond.ms}}米
|
||||
<van-icon name="cross" color="red" @click="item.bhms.splice(indexSecond,1)" />
|
||||
</view>
|
||||
<view class="a-c" v-if="form.zt!='已配全'">
|
||||
<van-button type="primary" @click="upScanCode(index)">
|
||||
扫一扫
|
||||
</van-button>
|
||||
<cshaptx4869-scancode v-if="h5ScanCode" @success="handleSuccess" @fail="handleFail"
|
||||
@close="handleClose">
|
||||
</cshaptx4869-scancode>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.phrq" class="line">
|
||||
<van-field v-model="item.phrq" name="配货日期" label="配货日期" colon class="bor" label-width="5em"
|
||||
readonly/>
|
||||
<van-field v-model="item.rc" name="染厂选择" label="染厂选择" colon class="bor" label-width="5em"
|
||||
readonly />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<view v-if="form.zt!='已配全'">
|
||||
<van-field v-model="formItem.phrq" name="配货日期" label="配货日期" colon class="bor" label-width="5em"
|
||||
readonly :rules="[{ required: true, message: '请填写' }]" @click="chooseDate()" />
|
||||
<van-field v-model="formItem.rc" name="染厂选择" label="染厂选择" colon class="bor" label-width="5em"
|
||||
readonly :rules="[{ required: true, message: '请填写' }]" @click="choosePic" />
|
||||
<van-field v-model="formItem.jcps" name="进厂匹数" label="进厂匹数" colon label-width="5em" class="bor-n"
|
||||
readonly />
|
||||
<van-field v-model="formItem.jcms" name="进厂米数" label="进厂米数" colon class="bor-n" readonly
|
||||
label-width="5em" />
|
||||
</view>
|
||||
|
||||
<van-field v-model="formItem.phrq" name="配货日期" label="配货日期" colon class="bor" label-width="5em"
|
||||
readonly :rules="[{ required: true, message: '请填写' }]" @click="chooseDate()" />
|
||||
<van-field v-model="formItem.rc" name="染厂选择" label="染厂选择" colon class="bor" label-width="5em"
|
||||
readonly :rules="[{ required: true, message: '请填写' }]" @click="choosePic" />
|
||||
<van-field v-model="formItem.jcps" name="进厂匹数" label="进厂匹数" colon label-width="5em" class="bor-n"
|
||||
readonly />
|
||||
<van-field v-model="formItem.jcms" name="进厂米数" label="进厂米数" colon class="bor-n" readonly
|
||||
label-width="5em" />
|
||||
</van-cell-group>
|
||||
<view style="margin: 16px;display: flex;">
|
||||
<van-button round block type="primary" native-type="submit">
|
||||
<view style="margin: 16px;display: flex;" v-if="form.zt!='已配全'">
|
||||
<van-button round block type="primary" native-type="submit" @click="beforeSubmit('部分配货')">
|
||||
部分配货
|
||||
</van-button>
|
||||
<van-button round block type="primary" native-type="submit">
|
||||
<van-button round block type="primary" native-type="submit" @click="beforeSubmit('已配全')" style="margin-left: 15px;">
|
||||
已配全
|
||||
</van-button>
|
||||
</view>
|
||||
@ -185,8 +252,9 @@
|
||||
<view v-for="(item,index) in bhms" :key="index">
|
||||
<van-field v-model="item.code" name="面料编号" label="面料编号" colon readonly label-width="5em"
|
||||
class="bor-n" />
|
||||
<van-field v-model="item.syps" name="剩余米数" label="剩余米数" colon label-width="5em" class="bor-n" readonly/>
|
||||
<van-field v-model="item.ms" name="排单米数" label="排单米数" colon label-width="5em"/>
|
||||
<van-field v-model="item.syps" name="剩余米数" label="剩余米数" colon label-width="5em" class="bor-n"
|
||||
readonly />
|
||||
<van-field v-model="item.ms" name="排单米数" label="排单米数" colon label-width="5em" />
|
||||
</view>
|
||||
</van-cell-group>
|
||||
</view>
|
||||
@ -288,9 +356,14 @@
|
||||
::v-deep .van-field__label {
|
||||
text-align: end;
|
||||
}
|
||||
.box{
|
||||
|
||||
.box {
|
||||
margin: 5rpx 20rpx;
|
||||
border: 1rpx solid #d7d7d7;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.line{
|
||||
border-bottom: 1rpx solid #d7d7d7;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
</style>
|
@ -5,10 +5,10 @@
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { showToast } from 'vant';
|
||||
|
||||
const form = ref({status:'已通过'} as any)
|
||||
const form = ref({ status: '已通过' } as any)
|
||||
const list = ref([] as any[])
|
||||
const statusList = ref([
|
||||
{ status: "部分配货", type: "warning"},
|
||||
{ status: "部分配货", type: "warning" },
|
||||
{ status: "待配货", type: "primary" },
|
||||
{ status: "已配全", type: "success" },
|
||||
])
|
||||
@ -72,35 +72,39 @@
|
||||
};
|
||||
|
||||
function init() {
|
||||
total.value=0
|
||||
getAction('/customOrder', form.value).then((res : any) => {
|
||||
total.value = 0
|
||||
getAction('/customOrder', { page: currentPage.value, size: 10, ...form.value }).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
res.data.record.forEach((l : any) => {
|
||||
l.lx=1
|
||||
list.value.push(l)
|
||||
let item = statusList.value.find((m : any) => m.status == l.customOrder.zt)
|
||||
l.customOrder.statusColor = item.type
|
||||
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
|
||||
})
|
||||
})
|
||||
total.value += res.data.total*1
|
||||
total.value += res.data.total * 1
|
||||
loading.value = false;
|
||||
finished.value = false
|
||||
}
|
||||
})
|
||||
getAction('/interOrder', form.value).then((res : any) => {
|
||||
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
|
||||
l.lx = 2
|
||||
list.value.push(l)
|
||||
let item = statusList.value.find((m : any) => m.status == l.zt)
|
||||
l.statusColor = item.type
|
||||
})
|
||||
total.value += res.data.total*1
|
||||
total.value += res.data.total * 1
|
||||
loading.value = false;
|
||||
finished.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
watch(form.value, () => {
|
||||
list.value = []
|
||||
init()
|
||||
@ -144,19 +148,20 @@
|
||||
}
|
||||
|
||||
//详情
|
||||
const toDetile = (item : any) => {
|
||||
if(item.lx===1){
|
||||
let url = './detailCus' + '?' + 'item=' + JSON.stringify(item)
|
||||
const toDetile = (item : any, item2 : any) => {
|
||||
if (item.lx === 1) {
|
||||
let a = { customOrder: item.customOrder, orderItems: item2 }
|
||||
let url = './detailCus' + '?' + 'item=' + JSON.stringify(a)
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
})
|
||||
}else if(item.lx===2){
|
||||
})
|
||||
} else if (item.lx === 2) {
|
||||
let url = './detailSpot' + '?' + 'item=' + JSON.stringify(item)
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -246,11 +251,8 @@
|
||||
@click="chooseDate('endDate')" />
|
||||
</van-cell-group>
|
||||
<van-cell-group inset style="display: flex;">
|
||||
<van-field v-model="form.makeUser" name="颜色筛选" label="颜色筛选" class="bor-a" colon label-width="5em" />
|
||||
<van-field v-model="form.makeUser" name="做单人员" label="做单人员" colon class="bor" label-width="5em" readonly
|
||||
@click="choosePic('makeUser')" />
|
||||
</van-cell-group>
|
||||
<van-cell-group inset style="display: flex;">
|
||||
<van-field v-model="form.zt" name="订单状态" label="订单状态" colon class="bor" label-width="5em" readonly
|
||||
@click="choosePic('zt')" />
|
||||
</van-cell-group>
|
||||
@ -264,7 +266,8 @@
|
||||
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
|
||||
<view v-for="(item,index) in list" :key="index">
|
||||
<template v-if="item.lx===1">
|
||||
<view class="grid-container" v-for="(itemSecond,indexSecond) in item.orderItems" :key="indexSecond">
|
||||
<view class="grid-container" v-for="(itemSecond,indexSecond) in item.orderItems"
|
||||
:key="indexSecond">
|
||||
<view class="grid-item">{{item.customOrder.makeTime}}<br>{{itemSecond.color}}</view>
|
||||
<view class="grid-item">
|
||||
<view class="grid-container1">
|
||||
@ -282,8 +285,8 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="grid-item" @click="toDetile(item)">
|
||||
<van-button :type="item.customOrder.statusColor">{{item.customOrder.zt}}</van-button>
|
||||
<view class="grid-item" @click="toDetile(item,itemSecond)">
|
||||
<van-button :type="itemSecond.statusColor">{{itemSecond.zt}}</van-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -372,13 +375,13 @@
|
||||
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;
|
||||
@ -386,7 +389,7 @@
|
||||
justify-content: center;
|
||||
padding: 5rpx;
|
||||
}
|
||||
|
||||
|
||||
.grid-item1 {
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
display: flex;
|
||||
|
548
pages/documentary/documentary.vue
Normal file
548
pages/documentary/documentary.vue
Normal file
@ -0,0 +1,548 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { getAction } from '../../common/http';
|
||||
import { formatDate } from '../../utils/date';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { showToast } from 'vant';
|
||||
|
||||
const form = ref({} as any)
|
||||
const list = ref([] as any[])
|
||||
const statusList = ref([
|
||||
{ status: "部分配货", type: "warning" },
|
||||
{ status: "待配货", type: "primary" },
|
||||
{ status: "已配全", type: "success" },
|
||||
])
|
||||
const nameList = ref([] as any[])
|
||||
|
||||
onMounted(() => {
|
||||
getAction('/fabric/info/all').then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
res.data.forEach((l : any) => {
|
||||
let itemMl = mlList.value.find(m => m.text === l.commodity)
|
||||
if (itemMl) {
|
||||
let itemMm = itemMl.children.find(m => m.value === l.momme)
|
||||
if (itemMm) {
|
||||
itemMm.children.push({ text: l.width + 'cm', value: l.width })
|
||||
} else {
|
||||
itemMl.children.push({
|
||||
text: l.momme + 'mm',
|
||||
value: l.momme,
|
||||
children: [{ text: l.width + 'cm', value: l.width }]
|
||||
})
|
||||
}
|
||||
} else {
|
||||
mlList.value.push({
|
||||
text: l.commodity,
|
||||
value: l.commodity,
|
||||
children: [{ text: l.momme + 'mm', value: l.momme, children: [{ text: l.width + 'cm', value: l.width }] }]
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
//所有用户名
|
||||
getAction('/v1/user/getNames').then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
nameList.value = res.data.map((l : any) => ({ value: l, text: l }))
|
||||
}
|
||||
})
|
||||
})
|
||||
onShow(() => {
|
||||
list.value = []
|
||||
init()
|
||||
})
|
||||
|
||||
const onClickLeft = () => {
|
||||
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() {
|
||||
total.value = 0
|
||||
getAction('/tracking', { page: currentPage.value, size: 10, ...form.value }).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
res.data.record.forEach((l:any)=>{
|
||||
l.craftComment=JSON.parse(l.craftComment)
|
||||
list.value.push(l)
|
||||
})
|
||||
|
||||
total.value += res.data.total * 1
|
||||
loading.value = false;
|
||||
finished.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
watch(form.value, () => {
|
||||
list.value = []
|
||||
init()
|
||||
})
|
||||
|
||||
const showPicker = ref(false)
|
||||
const typeData = ref()
|
||||
const popuList = ref([] as any[])
|
||||
//选择框事件
|
||||
const choosePic = (type : any) => {
|
||||
showPicker.value = true
|
||||
typeData.value = type
|
||||
}
|
||||
//选择框确认
|
||||
const pickerConfirm = (val : any) => {
|
||||
form.value[typeData.value] = val.selectedValues[0]
|
||||
showPickerCancel()
|
||||
}
|
||||
//取消
|
||||
const showPickerCancel = () => {
|
||||
showPicker.value = false
|
||||
}
|
||||
//弹窗开启事件
|
||||
const handleOpen = () => {
|
||||
if (typeData.value === 'zt') {
|
||||
popuList.value = [{ text: '待配货', value: '待配货' }, { text: '部分配货', value: '部分配货' }, { text: '已配全', value: '已配全' }]
|
||||
} else {
|
||||
popuList.value = nameList.value
|
||||
}
|
||||
}
|
||||
//日期选择
|
||||
const show = ref(false)
|
||||
const dataType = ref('')
|
||||
const chooseDate = (val : any) => {
|
||||
show.value = true
|
||||
dataType.value = val
|
||||
}
|
||||
const onConfirmDate = (val : any) => {
|
||||
form.value[dataType.value] = formatDate(val)
|
||||
show.value = false
|
||||
}
|
||||
|
||||
//详情
|
||||
const toDetile = (item : any, item2 : any) => {
|
||||
if (item.lx === 1) {
|
||||
let a = { customOrder: item.customOrder, orderItems: item2 }
|
||||
let url = './detailCus' + '?' + 'item=' + JSON.stringify(a)
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
})
|
||||
} else if (item.lx === 2) {
|
||||
let url = './detailSpot' + '?' + 'item=' + JSON.stringify(item)
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
const pickerList = ref([])//面料数据
|
||||
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()
|
||||
}
|
||||
|
||||
const butonColor = ref(['#611987','#611987','#e54077','#63b911','#036fb8','#ff9e49','#fa7cff','#f39b77','#4fcdff','#e54077','#036fb8','#ffc404','#63b911','#9cdd1c','#9cdd1c',])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="flex">
|
||||
<van-nav-bar title="跟单系统" left-text="返回" left-arrow @click-left="onClickLeft" />
|
||||
<van-cell-group inset style="display: flex;">
|
||||
<van-field v-model="form.makeUser" name="选择工厂" label="选择工厂" colon class="bor" label-width="5em" readonly
|
||||
@click="choosePic('makeUser')" />
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group inset style="display: flex;">
|
||||
<van-field v-model="form.startDate" name="开始时间" label="开始时间" colon class="bor" label-width="5em" readonly
|
||||
@click="chooseDate('startDate')" :rules="[{ required: true, message: '请填写' }]" />
|
||||
<van-field v-model="form.endDate" name="截止时间" label="截止时间" colon class="bor" label-width="5em" readonly
|
||||
@click="chooseDate('endDate')" />
|
||||
</van-cell-group>
|
||||
<van-cell-group inset style="display: flex;">
|
||||
<van-field v-model="form.ml" name="面料名称" label="面料名称" class="bor" colon label-width="5em"
|
||||
@click="selectChoose" />
|
||||
<van-field v-model="form.makeUser" name="做单人员" label="做单人员" colon class="bor" label-width="5em" readonly
|
||||
@click="choosePic('makeUser')" />
|
||||
</van-cell-group>
|
||||
<van-cell-group inset style="display: flex;">
|
||||
<van-field v-model="form.color" name="颜色色号" label="颜色色号" colon class="bor-a" label-width="5em" />
|
||||
<van-field v-model="form.zt" name="归属人员" label="归属人员" colon class="bor" label-width="5em" readonly
|
||||
@click="choosePic('makeUser')" />
|
||||
</van-cell-group>
|
||||
<van-cell-group inset style="display: flex;">
|
||||
<van-field v-model="form.color" name="谁定" label="谁 定" colon
|
||||
class="bor" label-width="5em" />
|
||||
<van-field v-model="form.zt" name="订单状态" label="订单状态" colon class="bor" label-width="5em" readonly
|
||||
@click="choosePic('zt')" />
|
||||
</van-cell-group>
|
||||
<view class="grid-container">
|
||||
<view class="grid-item">面料/颜色</view>
|
||||
<view class="grid-item">谁定/做单人/归属人<br>匹数/米数</view>
|
||||
<view class="grid-item">工艺/工艺要求</view>
|
||||
<view class="grid-item">状态</view>
|
||||
</view>
|
||||
<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">{{item.sd}}/{{item.makeUser}}/{{item.belongTo}}<br>{{item.qty}}/{{item.len}}</view>
|
||||
<view class="grid-item">{{item.craft}}<br>{{item.craftComment.name}}</view>
|
||||
<view class="grid-item">
|
||||
<van-button :style="{backgroundColor: butonColor[ Math.floor(Math.random() * 15) + 1],color:'#fff'}">{{item.status}}</van-button>
|
||||
</view>
|
||||
</view>
|
||||
</van-list>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!--选择框-->
|
||||
<van-popup v-model:show="showPicker" round position="bottom" @open="handleOpen">
|
||||
<van-picker show-toolbar :columns="popuList" @confirm="pickerConfirm" @cancel="showPickerCancel"
|
||||
ref="pickerRef" />
|
||||
</van-popup>
|
||||
|
||||
<van-calendar v-model:show="show" @confirm="onConfirmDate" :min-date="new Date(2010, 0, 1)"
|
||||
: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>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.flex {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
font-size: 24rpx;
|
||||
overflow-y: hidden;
|
||||
|
||||
.van-nav-bar {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.grid-container {
|
||||
display: grid;
|
||||
grid-template-columns: 1.5fr 2fr 1.5fr 1fr;
|
||||
padding: 0 15rpx;
|
||||
|
||||
.grid-item {
|
||||
border: 1px solid #f2f2f2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
overflow-y: scroll;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .van-cell {
|
||||
padding: 5px !important;
|
||||
}
|
||||
|
||||
::v-deep .van-field {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.bor {
|
||||
::v-deep .van-field__control {
|
||||
border: 1px solid #d7d7d7;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
::v-deep .van-field__label {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.bor-a {
|
||||
::v-deep .van-field__control {
|
||||
border-bottom: 1px solid #d7d7d7;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
::v-deep .van-field__label {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .van-button--normal {
|
||||
padding: 5px 8px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
::v-deep .van-field__control {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/*面料选择搜索框*/
|
||||
.select-model {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.confirm-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.confirm-select>p {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.confirm-select>button {
|
||||
border: none;
|
||||
background-color: #ffffff;
|
||||
color: #388aed;
|
||||
margin: 10px 30px 0 0;
|
||||
}
|
||||
|
||||
.top-select {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
::v-deep .select-model .van-picker__toolbar {
|
||||
height: 66px;
|
||||
align-items: flex-start;
|
||||
/*justify-content: flex-end;*/
|
||||
}
|
||||
|
||||
::v-deep .select-model .van-picker__cancel,
|
||||
.select-model .van-picker__confirm {
|
||||
height: 30px;
|
||||
padding: 10px 16px 0;
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
padding: 1px 8px;
|
||||
border: none;
|
||||
background-color: #388aed;
|
||||
color: #ffffff;
|
||||
margin-left: 5px;
|
||||
height: 30px;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding-top: 15px;
|
||||
padding-bottom: 5px;
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.van-search {
|
||||
background-color: #f7f7f8;
|
||||
}
|
||||
|
||||
.ml-search-jump {
|
||||
padding: 3px 10px;
|
||||
background-color: #388aed;
|
||||
color: #ffffff;
|
||||
border: none;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.flex-btn {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
/*面料选择搜索框*/
|
||||
.select-model {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.confirm-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.confirm-select>p {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.confirm-select>button {
|
||||
border: none;
|
||||
background-color: #ffffff;
|
||||
color: #388aed;
|
||||
margin: 10px 30px 0 0;
|
||||
}
|
||||
|
||||
.top-select {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
::v-deep .select-model .van-picker__toolbar {
|
||||
height: 66px;
|
||||
align-items: flex-start;
|
||||
/*justify-content: flex-end;*/
|
||||
}
|
||||
|
||||
::v-deep .select-model .van-picker__cancel,
|
||||
.select-model .van-picker__confirm {
|
||||
height: 30px;
|
||||
padding: 10px 16px 0;
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
padding: 1px 8px;
|
||||
border: none;
|
||||
background-color: #388aed;
|
||||
color: #ffffff;
|
||||
margin-left: 5px;
|
||||
height: 30px;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding-top: 15px;
|
||||
padding-bottom: 5px;
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.van-search {
|
||||
background-color: #f7f7f8;
|
||||
}
|
||||
|
||||
.ml-search-jump {
|
||||
padding: 3px 10px;
|
||||
background-color: #388aed;
|
||||
color: #ffffff;
|
||||
border: none;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.flex-btn {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
@ -97,6 +97,11 @@ const ListData =ref([
|
||||
path:'../distribution/distribution',
|
||||
name:'待配货列表',
|
||||
type:'',
|
||||
},
|
||||
{
|
||||
path:'../documentary/documentary',
|
||||
name:'跟单列表',
|
||||
type:'',
|
||||
}
|
||||
] as any[])
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
postAction('/process', form.value).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
showToast('提交成功!')
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import { showToast } from 'vant';
|
||||
putAction(url,form.value.fabric).then((res:any)=>{
|
||||
if(res.code===200){
|
||||
showToast('审核通过!')
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -29,7 +29,7 @@ import { showToast } from 'vant';
|
||||
putAction(url).then((res:any)=>{
|
||||
if(res.code===200){
|
||||
showToast('驳回成功!')
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -89,7 +89,7 @@
|
||||
postAction('/interOrder',form.value).then((res:any)=>{
|
||||
if(res.code===200){
|
||||
showToast('提交成功!')
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -75,7 +75,7 @@
|
||||
}
|
||||
|
||||
const onClickLeft = () => {
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
const onClickRight = () => {
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ onMounted(()=>{
|
||||
})
|
||||
|
||||
const onClickLeft = () =>{
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
const onClickRight=()=>{
|
||||
scanCode()
|
||||
|
@ -98,7 +98,7 @@ const onSubmit = () =>{
|
||||
}
|
||||
|
||||
const onClickLeft = () =>{
|
||||
uni.navigateBack()
|
||||
window.history.back()
|
||||
}
|
||||
const onClickRight=()=>{
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user