跟单
This commit is contained in:
parent
20c8aef9bd
commit
04b67fd784
24
pages.json
24
pages.json
@ -351,6 +351,30 @@
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/documentary/history",
|
||||
"style" :
|
||||
{
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": false,
|
||||
"disableScroll": true,
|
||||
"app-plus": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/Delivery/Delivery",
|
||||
"style" :
|
||||
{
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": false,
|
||||
"disableScroll": true,
|
||||
"app-plus": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
665
pages/Delivery/Delivery.vue
Normal file
665
pages/Delivery/Delivery.vue
Normal file
@ -0,0 +1,665 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { getAction, postAction } from '../../common/http';
|
||||
import { formatDate } from '../../utils/date';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { showToast } from 'vant';
|
||||
|
||||
const form = ref({} as any)
|
||||
const dataItem = ref({ shrq: formatDate(new Date())} as any)
|
||||
const list = ref([] as any[])
|
||||
const factory = ref([] as any[])
|
||||
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 }))
|
||||
}
|
||||
})
|
||||
//获取工厂
|
||||
getAction('/factory').then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
factory.value = res.data.map((l : any) => ({ text: l.name, value: l.name }))
|
||||
}
|
||||
})
|
||||
})
|
||||
onShow(() => {
|
||||
list.value = []
|
||||
init()
|
||||
//用户信息
|
||||
uni.getStorage({
|
||||
key: 'info',
|
||||
success(res) {
|
||||
let data = JSON.parse(res.data)
|
||||
dataItem.value.shr = data.userName
|
||||
},
|
||||
fail: (err : any) => {
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
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('/stockroom/uncheck', { page: currentPage.value, size: 10, ...form.value }).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
res.data.record.forEach((l : any) => {
|
||||
if (isValidJSON(l.craftComment)) {
|
||||
l.craftComment = JSON.parse(l.craftComment)
|
||||
}
|
||||
if (l.zt === '已出厂') {
|
||||
l.butonColor = '#ff9e49'
|
||||
l.status='收货'
|
||||
}
|
||||
list.value.push(l)
|
||||
})
|
||||
|
||||
total.value += res.data.total * 1
|
||||
loading.value = false;
|
||||
finished.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function isValidJSON(str : any) {
|
||||
if (typeof str !== 'string') return false; // 确保输入是一个字符串
|
||||
try {
|
||||
JSON.parse(str);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return 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 === 'factory') {
|
||||
popuList.value = factory.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) => {
|
||||
if (dataType.value == 'shrq') {
|
||||
dataItem.value[dataType.value] = formatDate(val)
|
||||
} else {
|
||||
form.value[dataType.value] = formatDate(val)
|
||||
}
|
||||
show.value = false
|
||||
}
|
||||
|
||||
|
||||
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.fabric = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1]
|
||||
pickerCancel()
|
||||
}
|
||||
|
||||
|
||||
const showDialog = ref(false)
|
||||
const itemList = ref({} as any)
|
||||
|
||||
const submit = () => {
|
||||
// TODO
|
||||
// postAction('/tracking', { orderId: itemList.value.id, type: itemList.value.type, data: dataItem.value, status: '等待' }).then((res : any) => {
|
||||
// if (res.code === 200) {
|
||||
// showDialog.value = false
|
||||
// showToast('更新成功!')
|
||||
// }
|
||||
// })
|
||||
}
|
||||
|
||||
//计算米数
|
||||
const computing = (list:any) =>{
|
||||
let total=list.reduce((accumulator:any, currentValue:any) => {
|
||||
return accumulator + currentValue.ms*1;
|
||||
}, 0);
|
||||
return total
|
||||
}
|
||||
//工序详情
|
||||
const toDetile = (item:any) =>{
|
||||
itemList.value=item
|
||||
showDialog.value = true
|
||||
}
|
||||
</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.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.fabric" name="面料名称" label="面料名称" class="bor" colon label-width="5em" readonly
|
||||
@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.belongTo" name="归属人员" label="归属人员" colon class="bor" label-width="5em" readonly
|
||||
@click="choosePic('belongTo')" />
|
||||
</van-cell-group>
|
||||
<van-cell-group inset style="display: flex;">
|
||||
<van-field v-model="form.sd" name="谁定" label="谁 定" colon
|
||||
class="bor-a" label-width="5em" />
|
||||
<van-field v-model="form.factory" name="选择工厂" label="选择工厂" colon class="bor" label-width="5em" readonly
|
||||
@click="choosePic('factory')" />
|
||||
</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">
|
||||
<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.sh}}
|
||||
</view>
|
||||
</view>
|
||||
</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">
|
||||
{{item.sd}}/{{item.makeUser}}/{{item.belongTo}}<br>{{itemSecond.xxs.length}}匹/{{computing(itemSecond.xxs)}}米
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="grid-item">
|
||||
{{item.rc}}
|
||||
</view>
|
||||
<view class="grid-item">
|
||||
<van-button :style="{backgroundColor: item.butonColor,color:'#fff'}"
|
||||
@click="toDetile(item)">{{item.status}}</van-button>
|
||||
<p style="color: red;">{{item.processes.processes.find(l=>!l.id)?.name}}</p>
|
||||
</view>
|
||||
</view>
|
||||
</van-list>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<van-dialog v-model:show="showDialog">
|
||||
<view style="margin-top: 10rpx;">
|
||||
<van-cell-group inset>
|
||||
<van-field v-model="dataItem.shr" name="收货人" label="收货人" colon readonly label-width="5em"
|
||||
class="bor-n" label-align="right" />
|
||||
<van-field v-model="dataItem.shrq" name="收货日期" label="收货日期" colon label-width="5em" class="bor"
|
||||
readonly @click="chooseDate('shrq')" label-align="right" />
|
||||
</van-cell-group>
|
||||
</view>
|
||||
<template #footer>
|
||||
<view class="footer-button">
|
||||
<van-button plain size="small" style="width: 25vw;" @click="showDialog=false">
|
||||
取消
|
||||
</van-button>
|
||||
<van-button size="small" type="success" style="width: 25vw;" @click="submit">
|
||||
提交
|
||||
</van-button>
|
||||
</view>
|
||||
</template>
|
||||
</van-dialog>
|
||||
|
||||
<!--选择框-->
|
||||
<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;
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.grid-container1 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(1, 1fr);;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.grid-item2 {
|
||||
display: flex;
|
||||
white-space: pre-line;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 5rpx;
|
||||
word-break: break-all;
|
||||
display: -webkit-box; /*将对象转为弹性盒模型展示*/
|
||||
-webkit-box-orient: vertical; /*设置弹性盒模型子元素的排列方式*/
|
||||
overflow: hidden; /*超出隐藏*/
|
||||
}
|
||||
|
||||
.grid-item1 {
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 5rpx;
|
||||
word-break: break-all;
|
||||
display: -webkit-box; /*将对象转为弹性盒模型展示*/
|
||||
-webkit-box-orient: vertical; /*设置弹性盒模型子元素的排列方式*/
|
||||
overflow: hidden; /*超出隐藏*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
::v-deep .van-field__control {
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.footer-button {
|
||||
margin: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
/*面料选择搜索框*/
|
||||
.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>
|
@ -293,7 +293,7 @@
|
||||
subId: itemList.value.subId,
|
||||
trackingLogId: itemList.value.id,
|
||||
details: {
|
||||
zt: indexData.value + 2 === processes.value.processes.length ? '待出厂' : status.value,
|
||||
zt: status.value == processes.value.processes[processes.value.processes.length-1].name ? '待出厂' : status.value,
|
||||
list: list.value,
|
||||
form: form.value,
|
||||
},
|
||||
|
@ -90,16 +90,34 @@
|
||||
getAction('/tracking', { page: currentPage.value, size: 10, ...form.value }).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
res.data.record.forEach((l : any) => {
|
||||
let a=[]
|
||||
l.logs.forEach((l:any)=>{
|
||||
if(l.details.trackingLog){
|
||||
a=a.concat(l.details.trackingLog)
|
||||
}
|
||||
a.push(l)
|
||||
})
|
||||
l={...l.trackingLog,logs:a}
|
||||
if (isValidJSON(l.craftComment)) {
|
||||
l.craftComment = JSON.parse(l.craftComment)
|
||||
}
|
||||
if (l.zt === '待进厂') {
|
||||
l.zcts=0
|
||||
l.butonColor = butonColor.value[0]
|
||||
} else if (l.zt === '待出厂') {
|
||||
l.jcrq=l.logs[0].details.form.czrq
|
||||
l.ccrq=l.logs[0].details.form.yjccts?addDaysToDate(l.jcrq,Number(l.logs[0].details.form.yjccts)):''
|
||||
l.zcts=dateDiffInDays(l.logs[0].createTime,new Date())
|
||||
l.butonColor = butonColor.value[1]
|
||||
} else if (l.zt === '已出厂') {
|
||||
l.jcrq=l.logs[0].details.form.czrq
|
||||
l.ccrq=l.logs[0].details.form.yjccts?addDaysToDate(l.jcrq,Number(l.logs[0].details.form.yjccts)):''
|
||||
l.zcts=dateDiffInDays(l.logs[0].createTime,l.logs[l.logs.length-1].createTime)
|
||||
l.butonColor = butonColor.value[2]
|
||||
} else {
|
||||
l.jcrq=l.logs[0].details.form.czrq
|
||||
l.ccrq=l.logs[0].details.form.yjccts?addDaysToDate(l.jcrq,Number(l.logs[0].details.form.yjccts)):''
|
||||
l.zcts=dateDiffInDays(l.logs[0].createTime,new Date())
|
||||
l.butonColor = butonColor.value[getRandomIntInclusive(3, 14)]
|
||||
}
|
||||
list.value.push(l)
|
||||
@ -111,6 +129,34 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
//日期差
|
||||
function dateDiffInDays(date1:any, date2:any) {
|
||||
// 将日期字符串转换为 Date 对象
|
||||
const dt1 = new Date(date1);
|
||||
const dt2 = new Date(date2);
|
||||
|
||||
// 计算时间差(以毫秒为单位)
|
||||
const timeDifference = dt2 - dt1;
|
||||
|
||||
// 将时间差转换为天数
|
||||
const daysDifference = timeDifference / (1000 * 3600 * 24);
|
||||
|
||||
// 返回绝对值,因为结果可能是负数,取决于哪个日期更早
|
||||
return Math.abs(Math.round(daysDifference));
|
||||
}
|
||||
function addDaysToDate(date:any, days:any) {
|
||||
// 将传入的 date 转换为 Date 对象
|
||||
const result = new Date(date);
|
||||
|
||||
// 设置时间为0点,以避免时区影响
|
||||
result.setHours(0, 0, 0, 0);
|
||||
|
||||
// 增加天数
|
||||
result.setDate(result.getDate() + days);
|
||||
|
||||
// 返回新的日期
|
||||
return formatDate(result);
|
||||
}
|
||||
|
||||
function getRandomIntInclusive(min, max) {
|
||||
min = Math.ceil(min);
|
||||
@ -156,7 +202,7 @@
|
||||
const handleOpen = () => {
|
||||
if (typeData.value === 'factory') {
|
||||
popuList.value = factory.value
|
||||
} else if (typeData.value === 'status') {
|
||||
} else if (typeData.value === 'zt') {
|
||||
popuList.value = [{ text: '待进厂', value: '待进厂' }, { text: '进行中', value: '进行中' }, { text: '待出厂', value: '待出厂' }, { text: '已出厂', value: '已出厂' }]
|
||||
} else {
|
||||
popuList.value = nameList.value
|
||||
@ -261,10 +307,23 @@
|
||||
|
||||
const submit = () => {
|
||||
if (!dataItem.value.yjccts) return showToast('请填写预计出厂天数!')
|
||||
dataItem.value.zt = itemList.value.status
|
||||
postAction('/tracking', { orderId: itemList.value.id, type: itemList.value.type, data: dataItem.value, status: '等待' }).then((res : any) => {
|
||||
let data = {
|
||||
subId: itemList.value.subId,
|
||||
trackingLogId: itemList.value.id,
|
||||
details: {
|
||||
zt: '等待',
|
||||
list: [],
|
||||
form: {
|
||||
czrq:dataItem.value.jcrq,
|
||||
yjccts:dataItem.value.yjccts,
|
||||
gdy:dataItem.value.gdy,
|
||||
},
|
||||
},
|
||||
}
|
||||
postAction('/tracking', data).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
showDialog.value = false
|
||||
itemList.value.zt='等待'
|
||||
showToast('更新成功!')
|
||||
}
|
||||
})
|
||||
@ -283,6 +342,13 @@
|
||||
uni.navigateTo({
|
||||
url:'./ex-factory?item='+JSON.stringify(item)
|
||||
})
|
||||
}else if(item.zt==='已出厂'){
|
||||
uni.navigateTo({
|
||||
url:'./history?item='+JSON.stringify(item)
|
||||
})
|
||||
}else if(item.zt==='待进厂'){
|
||||
showDialog.value = true
|
||||
itemList.value=item
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url:'./detail?item='+JSON.stringify(item)
|
||||
@ -319,8 +385,8 @@
|
||||
<van-cell-group inset style="display: flex;">
|
||||
<van-field v-model="form.sd" name="谁定" label="谁 定" colon
|
||||
class="bor-a" label-width="5em" />
|
||||
<van-field v-model="form.status" name="订单状态" label="订单状态" colon class="bor" label-width="5em" readonly
|
||||
@click="choosePic('status')" />
|
||||
<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>
|
||||
@ -330,31 +396,41 @@
|
||||
</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">
|
||||
<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.sh}}
|
||||
<template v-for="(item,index) in list" :key="index">
|
||||
<view class="grid-container">
|
||||
<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.sh}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</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">
|
||||
{{item.sd}}/{{item.makeUser}}/{{item.belongTo}}<br>{{itemSecond.xxs.length}}匹/{{computing(itemSecond.xxs)}}米
|
||||
<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">
|
||||
{{item.sd}}/{{item.makeUser}}/{{item.belongTo}}<br>{{itemSecond.xxs.length}}匹/{{computing(itemSecond.xxs)}}米
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="grid-item">
|
||||
{{item.craft}}<br>{{item.craftCmt.name?item.craftCmt.name:''}}
|
||||
</view>
|
||||
<view class="grid-item">
|
||||
<van-button :style="{backgroundColor: item.butonColor,color:'#fff'}"
|
||||
@click="toDetile(item)">{{item.zt}}</van-button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="grid-item">
|
||||
{{item.craft}}<br>{{item.craftCmt.name?item.craftCmt.name:''}}
|
||||
<view style="text-align: center;display: flex;align-items: center;justify-content: space-around;">
|
||||
<p>在厂天数:{{item.zcts}}天</p>
|
||||
<p>
|
||||
进厂:{{item.jcrq}}
|
||||
<br>
|
||||
预计:{{item.ccrq}}
|
||||
</p>
|
||||
</view>
|
||||
<view class="grid-item">
|
||||
<van-button :style="{backgroundColor: item.butonColor,color:'#fff'}"
|
||||
@click="toDetile(item)">{{item.zt}}</van-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</van-list>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { showToast } from 'vant';
|
||||
import { ref } from 'vue';
|
||||
import { getAction, uploadAction } from '../../common/http';
|
||||
import { getAction, postAction, uploadAction } from '../../common/http';
|
||||
import { formatDate } from '../../utils/date';
|
||||
// 定义 props
|
||||
defineProps<{
|
||||
@ -13,6 +13,7 @@
|
||||
const processes = ref({} as any)
|
||||
const list = ref([] as any[])
|
||||
const form = ref({ czrq: formatDate(new Date()), yjxybrq: formatDate(new Date()) } as any)
|
||||
const history = ref([] as any[])
|
||||
|
||||
onLoad(async (option : any) => {
|
||||
if (option) {
|
||||
@ -38,28 +39,41 @@
|
||||
} else {
|
||||
processes.value = itemList.value.processes
|
||||
}
|
||||
getAction('/tracking/getLog?id='+itemList.value.id).then((res:any)=>{
|
||||
if(res.code===200){
|
||||
getAction('/tracking/getLog?id=' + itemList.value.id).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
processes.value.processes.forEach((m : any) => {
|
||||
if (!m.id) {
|
||||
let a = res.data.find((l : any) => l.details.zt == m.name)
|
||||
if (a) {
|
||||
m.rq = a.details.form.czrq
|
||||
res.data=res.data.concat(a.details.trackingLog)
|
||||
res.data = res.data.concat(a.details.trackingLog)
|
||||
}
|
||||
}
|
||||
})
|
||||
processes.value.processes.forEach((m : any) => {
|
||||
let a = res.data.find((l : any) => l.details.zt == m.name && l.trackingLogId == itemList.value.id)
|
||||
let a = res.data.find((l : any) => l.details.zt == m.name)
|
||||
if (a) {
|
||||
m.rq = a.details.form.czrq
|
||||
history.value=history.value.concat(a.details.list)
|
||||
}
|
||||
})
|
||||
let b = res.data.find((l : any) => l.trackingLogId == itemList.value.id && l.details.zt === '待出厂')
|
||||
processes.value.processes[processes.value.processes.length - 1].rq = b.details.form.czrq
|
||||
history.value=history.value.concat(b.details.list)
|
||||
history.value.map((l:any)=>{
|
||||
if(l.pic){
|
||||
l.pic=[{url:l.pic}]
|
||||
}
|
||||
})
|
||||
let b=res.data.find((l:any)=>l.trackingLogId==itemList.value.id&&l.details.zt==='待出厂')
|
||||
processes.value.processes[processes.value.processes.length-1].rq=b.details.form.czrq
|
||||
}
|
||||
})
|
||||
console.log(processes.value);
|
||||
postAction('/craftComment/getByIds',itemList.value.craftCmt.value).then((res:any)=>{
|
||||
if(res.code===200){
|
||||
res.data.forEach((l:any)=>{
|
||||
list.value=list.value.concat(l.content)
|
||||
})
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('Failed to parse item JSON:', error);
|
||||
// 可以选择在这里显示错误消息给用户
|
||||
@ -68,7 +82,7 @@
|
||||
})
|
||||
|
||||
const onClickLeft = () => {
|
||||
history.back()
|
||||
window.history.back();
|
||||
}
|
||||
|
||||
//选择框事件
|
||||
@ -108,9 +122,22 @@
|
||||
|
||||
//提交
|
||||
const onSubmit = () => {
|
||||
|
||||
let data = {
|
||||
subId: itemList.value.subId,
|
||||
trackingLogId: itemList.value.id,
|
||||
details: {
|
||||
zt: '已出厂',
|
||||
list: list.value,
|
||||
},
|
||||
}
|
||||
postAction('/tracking', data).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
showToast('提交成功!')
|
||||
window.history.back()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const fileList = ref([] as any[])
|
||||
const afterRead = (file : any) => {
|
||||
file.status = 'uploading';
|
||||
@ -136,11 +163,32 @@
|
||||
<van-field name="工艺流程" label="工艺流程" colon label-width="5em" readonly />
|
||||
<view class="grid-container">
|
||||
<view class="grid-item" v-for="(item,index) in processes.processes" :key="index">
|
||||
<view class="btn1">{{item.name}}</view>
|
||||
<view :class="item.id?'btn1':'btn2'">{{item.name}}</view>
|
||||
<p>{{item.rq}}</p>
|
||||
</view>
|
||||
</view>
|
||||
</van-cell-group>
|
||||
<van-cell-group inset>
|
||||
<view v-for="(item,index) in history" :key="index">
|
||||
<template v-if="item.type==='Select'">
|
||||
<van-field v-model="item.value" :name="item.name" :label="item.name" colon class="bor"
|
||||
label-width="5em" readonly
|
||||
:rules="item.necessary?[{ required: true, message: '请选择' }]:[]"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="item.type==='Input'">
|
||||
<van-field v-model="item.value" v-if="item.contentType.find(l=>l=='Text')" :name="item.name"
|
||||
:label="item.name" colon class="bor-n" label-width="5em" readonly
|
||||
:rules="item.necessary?[{ required: true, message: '请填写' }]:[]" />
|
||||
<van-field name="uploader" v-if="item.contentType.find(l=>l=='File')" :label="item.name"
|
||||
label-width="5em" colon :rules="item.necessary?[{ required: true, message: '请上传' }]:[]">
|
||||
<template #input>
|
||||
<van-uploader v-model="item.pic" multiple :max-count="1" readonly :deletable="false"/>
|
||||
</template>
|
||||
</van-field>
|
||||
</template>
|
||||
</view>
|
||||
</van-cell-group>
|
||||
<van-form @submit="onSubmit">
|
||||
<van-cell-group inset>
|
||||
<view v-for="(item,index) in list" :key="index">
|
||||
@ -151,10 +199,10 @@
|
||||
@click="choosePic(index)" />
|
||||
</template>
|
||||
<template v-if="item.type==='Input'">
|
||||
<van-field v-model="item.value" v-if="item.contentType.find(l=>l=='Text')" :name="item.name"
|
||||
<van-field v-model="item.value" v-if="item.blank.find(l=>l=='Text')" :name="item.name"
|
||||
:label="item.name" colon class="bor-n" label-width="5em"
|
||||
:rules="item.necessary?[{ required: true, message: '请填写' }]:[]" />
|
||||
<van-field name="uploader" v-if="item.contentType.find(l=>l=='File')" :label="item.name"
|
||||
<van-field name="uploader" v-if="item.blank.find(l=>l=='File')" :label="item.name"
|
||||
label-width="5em" colon :rules="item.necessary?[{ required: true, message: '请上传' }]:[]">
|
||||
<template #input>
|
||||
<van-uploader v-model="fileList" multiple :max-count="1" :after-read="afterRead"
|
||||
@ -163,12 +211,6 @@
|
||||
</van-field>
|
||||
</template>
|
||||
</view>
|
||||
<van-field v-model="form.czrq" name="操作日期" label="操作日期" colon label-width="5em"
|
||||
:rules="[{ required: true, message: '请填写' }]" readonly class="bor"
|
||||
@click="chooseDate('czrq')" />
|
||||
<van-field v-model="form.yjxybrq" name="预计下一步日期" label="预计下一步日期" colon label-width="8em"
|
||||
:rules="[{ required: true, message: '请填写' }]" readonly class="bor"
|
||||
@click="chooseDate('yjxybrq')" />
|
||||
</van-cell-group>
|
||||
<view style="margin: 32rpx;">
|
||||
<van-button round block type="primary" native-type="submit">
|
||||
@ -213,23 +255,25 @@
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
margin-top: 10rpx;
|
||||
|
||||
.btn {
|
||||
border: 1rpx solid #d7d7d7;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.btn1 {
|
||||
border: 1rpx solid #169bd5;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: #169bd5;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
border: 1rpx solid red;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: red;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn1 {
|
||||
border: 1rpx solid #169bd5;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: #169bd5;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
overflow-y: scroll;
|
||||
@ -237,35 +281,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.grid-container1 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
padding: 10rpx 15rpx;
|
||||
|
||||
.grid-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 10rpx;
|
||||
|
||||
.btn {
|
||||
border: 1rpx solid #d7d7d7;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.btn1 {
|
||||
border: 1rpx solid #169bd5;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: #169bd5;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bor {
|
||||
::v-deep .van-field__control {
|
||||
border: 1px solid #d7d7d7;
|
||||
|
205
pages/documentary/history.vue
Normal file
205
pages/documentary/history.vue
Normal file
@ -0,0 +1,205 @@
|
||||
<script setup lang="ts">
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { showToast } from 'vant';
|
||||
import { ref } from 'vue';
|
||||
import { getAction, postAction } from '../../common/http';
|
||||
// 定义 props
|
||||
defineProps<{
|
||||
item ?: string;
|
||||
}>();
|
||||
|
||||
const itemList = ref()
|
||||
const processes = ref({} as any)
|
||||
const history = ref([] as any[])
|
||||
|
||||
onLoad(async (option : any) => {
|
||||
if (option) {
|
||||
try {
|
||||
itemList.value = JSON.parse(option.item)
|
||||
if (itemList.value.sd === '门店' && !itemList.value.processes) {
|
||||
let res : any = await getAction('/flowBind')
|
||||
if (res.code === 200) {
|
||||
let item = res.data.find((l : any) => l.craftName === itemList.value.craft)
|
||||
let item2 = item.flows.find((l : any) => l.bind === "仅现货")
|
||||
if (item2) {
|
||||
let url = '/craftFlows/byName?name=' + item2.name
|
||||
let res1 : any = await getAction(url)
|
||||
if (res1.code === 200) {
|
||||
processes.value = res1.data
|
||||
} else {
|
||||
showToast('暂无此工艺!')
|
||||
}
|
||||
} else {
|
||||
showToast('暂无此工艺!')
|
||||
}
|
||||
}
|
||||
} else {
|
||||
processes.value = itemList.value.processes
|
||||
}
|
||||
getAction('/tracking/getLog?id=' + itemList.value.id).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
processes.value.processes.forEach((m : any) => {
|
||||
if (!m.id) {
|
||||
let a = res.data.find((l : any) => l.details.zt == m.name)
|
||||
if (a) {
|
||||
m.rq = a.details.form.czrq
|
||||
res.data = res.data.concat(a.details.trackingLog)
|
||||
}
|
||||
}
|
||||
})
|
||||
processes.value.processes.forEach((m : any) => {
|
||||
let a = res.data.find((l : any) => l.details.zt == m.name)
|
||||
if (a) {
|
||||
m.rq = a.details.form.czrq
|
||||
history.value=history.value.concat(a.details.list)
|
||||
}
|
||||
})
|
||||
let b = res.data.find((l : any) => l.details.zt === '待出厂')
|
||||
processes.value.processes[processes.value.processes.length - 1].rq = b.details.form.czrq
|
||||
let c = res.data.find((l : any) => l.details.zt === '已出厂')
|
||||
history.value=history.value.concat(b.details.list).concat(c.details.list)
|
||||
history.value.map((l:any)=>{
|
||||
if(l.pic){
|
||||
l.pic=[{url:l.pic}]
|
||||
}
|
||||
if(l.blank){
|
||||
l.contentType=l.blank
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('Failed to parse item JSON:', error);
|
||||
// 可以选择在这里显示错误消息给用户
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const onClickLeft = () => {
|
||||
window.history.back();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="flex">
|
||||
<van-nav-bar title="工序详情" left-text="返回" left-arrow @click-left="onClickLeft" />
|
||||
<view class="content">
|
||||
<van-cell-group inset>
|
||||
<van-field v-model="itemList.craft" name="工艺名称" label="工艺名称" colon label-width="5em" readonly />
|
||||
<van-field v-model="itemList.craftCmt.name" name="工艺要求" label="工艺要求" colon label-width="5em" readonly />
|
||||
<van-field v-model="itemList.innerComment" name="内部备注" label="内部备注" colon label-width="5em" readonly />
|
||||
<van-field name="工艺流程" label="工艺流程" colon label-width="5em" readonly />
|
||||
<view class="grid-container">
|
||||
<view class="grid-item" v-for="(item,index) in processes.processes" :key="index">
|
||||
<view :class="item.id?'btn1':'btn2'">{{item.name}}</view>
|
||||
<p>{{item.rq}}</p>
|
||||
</view>
|
||||
</view>
|
||||
</van-cell-group>
|
||||
<van-cell-group inset>
|
||||
<view v-for="(item,index) in history" :key="index">
|
||||
<template v-if="item.type==='Select'">
|
||||
<van-field v-model="item.value" :name="item.name" :label="item.name" colon class="bor"
|
||||
label-width="5em" readonly
|
||||
:rules="item.necessary?[{ required: true, message: '请选择' }]:[]"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="item.type==='Input'">
|
||||
<van-field v-model="item.value" v-if="item.contentType.find(l=>l=='Text')" :name="item.name"
|
||||
:label="item.name" colon class="bor-n" label-width="5em" readonly
|
||||
:rules="item.necessary?[{ required: true, message: '请填写' }]:[]" />
|
||||
<van-field name="uploader" v-if="item.contentType.find(l=>l=='File')" :label="item.name"
|
||||
label-width="5em" colon :rules="item.necessary?[{ required: true, message: '请上传' }]:[]">
|
||||
<template #input>
|
||||
<van-uploader v-model="item.pic" multiple :max-count="1" readonly :deletable="false"/>
|
||||
</template>
|
||||
</van-field>
|
||||
</template>
|
||||
</view>
|
||||
</van-cell-group>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.flex {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
overflow-y: hidden;
|
||||
|
||||
.van-nav-bar {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.grid-container {
|
||||
display: grid;
|
||||
align-items: top;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
padding: 10rpx 15rpx;
|
||||
|
||||
.grid-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
border: 1rpx solid red;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: red;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn1 {
|
||||
border: 1rpx solid #169bd5;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: #169bd5;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
overflow-y: scroll;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.bor {
|
||||
::v-deep .van-field__control {
|
||||
border: 1px solid #d7d7d7;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.bor-n {
|
||||
::v-deep .van-field__control {
|
||||
border-bottom: 1px solid #d7d7d7;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .van-cell {
|
||||
padding: 5px !important;
|
||||
}
|
||||
|
||||
::v-deep .van-field {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
::v-deep .van-field__control {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.footer-button {
|
||||
margin: 20px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
</style>
|
@ -102,6 +102,11 @@ const ListData =ref([
|
||||
path:'../documentary/documentary',
|
||||
name:'跟单列表',
|
||||
type:'',
|
||||
},
|
||||
{
|
||||
path:'../Delivery/Delivery',
|
||||
name:'待收货列表',
|
||||
type:'',
|
||||
}
|
||||
] as any[])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user