定做单审核
This commit is contained in:
parent
85e23229be
commit
06c58cac4d
@ -1,5 +1,5 @@
|
|||||||
import httpRequest from '../http/interface'
|
import httpRequest from '../http/interface'
|
||||||
|
import myconfig from '../http/config'
|
||||||
export const postAction = (url : string, data = {}, headerCustom = {}) => {
|
export const postAction = (url : string, data = {}, headerCustom = {}) => {
|
||||||
return httpRequest(
|
return httpRequest(
|
||||||
url,
|
url,
|
||||||
@ -32,4 +32,11 @@ export const deleteAction = (url : string, data = {}, headerCustom = {}) => {
|
|||||||
headerCustom
|
headerCustom
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
export const uploadAction = (url : string, data = {}) => {
|
||||||
|
return httpRequest(
|
||||||
|
url,
|
||||||
|
'',
|
||||||
|
data,
|
||||||
|
)
|
||||||
|
}
|
||||||
// 默认全部导出 import api from '@/common/vmeitime-http/'
|
// 默认全部导出 import api from '@/common/vmeitime-http/'
|
@ -22,43 +22,62 @@ function httpRequest(url : string, method : any, data = {}, headerCustom = {}) {
|
|||||||
let base_url=''
|
let base_url=''
|
||||||
if(url.includes('/v1')){
|
if(url.includes('/v1')){
|
||||||
base_url=myconfig.base_auth
|
base_url=myconfig.base_auth
|
||||||
}else if(url==='/fabric/info/all'||url==='/color/list'){
|
}else if(url==='/fabric/info/all'||url==='/color/list'||url.includes('/fabric/info/craftPrice')){
|
||||||
base_url=myconfig.base_mes
|
base_url=myconfig.base_mes
|
||||||
}else if(url.includes('fabric/craft')){
|
}else if(url.includes('fabric/craft')){
|
||||||
base_url=myconfig.base_process
|
base_url=myconfig.base_process
|
||||||
}else{
|
}else{
|
||||||
base_url=myconfig.base_scm
|
base_url=myconfig.base_scm
|
||||||
}
|
}
|
||||||
uni.request({
|
if(url==='/upload'){
|
||||||
url: base_url + url, // 拼接基础URL和请求路径
|
uni.uploadFile({
|
||||||
method: method,
|
url: base_url + url, // 拼接基础URL和请求路径
|
||||||
data: data, // 如果是GET请求,data应该为null
|
file: data,
|
||||||
header: finalHeader,
|
header: {
|
||||||
success: (res:any) => {
|
'Authorization': 'Bearer ' + token
|
||||||
// 如果服务器返回的状态码为200,则认为是成功的响应
|
},
|
||||||
if (res.data && res.data.code === 200) {
|
success: (uploadFileRes : any) => {
|
||||||
resolve(res.data);
|
let res=JSON.parse(uploadFileRes.data)
|
||||||
}else if(res.data && res.data.code === 401){
|
resolve(res);
|
||||||
uni.showToast({
|
|
||||||
icon:'error',
|
|
||||||
title:'登录过期!'
|
|
||||||
})
|
|
||||||
uni.clearStorage()
|
|
||||||
uni.reLaunch({
|
|
||||||
url:'/pages/login/login'
|
|
||||||
})
|
|
||||||
reject(new Error('请求失败: ' + (res.data && res.data?.message || '未知错误')));
|
|
||||||
}else {
|
|
||||||
uni.showToast({
|
|
||||||
icon:'error',
|
|
||||||
title:res.data.msg
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
fail: (err) => {
|
}else{
|
||||||
reject(err);
|
uni.request({
|
||||||
}
|
url: base_url + url, // 拼接基础URL和请求路径
|
||||||
});
|
method: method,
|
||||||
|
data: data, // 如果是GET请求,data应该为null
|
||||||
|
header: finalHeader,
|
||||||
|
success: (res:any) => {
|
||||||
|
// 如果服务器返回的状态码为200,则认为是成功的响应
|
||||||
|
if (res.data && res.data.code === 200) {
|
||||||
|
resolve(res.data);
|
||||||
|
}else if(res.data && res.data.code === 401){
|
||||||
|
uni.showToast({
|
||||||
|
icon:'error',
|
||||||
|
title:'登录过期!'
|
||||||
|
})
|
||||||
|
uni.clearStorage()
|
||||||
|
uni.reLaunch({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
|
reject(new Error('请求失败: ' + (res.data && res.data?.message || '未知错误')));
|
||||||
|
}else if(res.data && res.data.code === 401){
|
||||||
|
uni.showToast({
|
||||||
|
icon:'error',
|
||||||
|
title:'暂无权限!'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
icon:'error',
|
||||||
|
title:res.data.msg
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
pages.json
12
pages.json
@ -267,6 +267,18 @@
|
|||||||
"bounce": "none"
|
"bounce": "none"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/customOrder/detail",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"disableScroll": true,
|
||||||
|
"app-plus": {
|
||||||
|
"bounce": "none"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
@ -1,14 +1,23 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref, watch } from 'vue';
|
||||||
import { formatDate } from '../../utils/date';
|
import { formatDate } from '../../utils/date';
|
||||||
import { getAction } from '../../common/http';
|
import { getAction, postAction } from '../../common/http';
|
||||||
import { showToast } from 'vant';
|
import { showToast } from 'vant';
|
||||||
|
|
||||||
const craftList = ref([] as any[])
|
const craftList = ref([] as any[])
|
||||||
const otherList = ref([] as any[])
|
const otherList = ref([] as any[])
|
||||||
const hasTex = ref('' as any)
|
const hasTex = ref('' as any)
|
||||||
const nameList = ref([] as any[])
|
const nameList = ref([] as any[])
|
||||||
|
const craftCommentList = ref([] as any[])
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
//工艺要求获取
|
||||||
|
getAction('/craftCommentCategory').then((res : any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
craftCommentList.value = res.data.map((l : any) => ({ text: l.category, id: l.id, children: l.subCategory.map((m : any) => ({ text: m.subCategory, id: m.id })) }))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//用户信息
|
||||||
uni.getStorage({
|
uni.getStorage({
|
||||||
key: 'info',
|
key: 'info',
|
||||||
success(res) {
|
success(res) {
|
||||||
@ -20,11 +29,13 @@
|
|||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
//工艺信息
|
||||||
getAction('/fabric/craft/info').then((res : any) => {
|
getAction('/fabric/craft/info').then((res : any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
craftList.value = res.data.map((l : any) => ({ value: l.name, text: l.name }))
|
craftList.value = res.data.map((l : any) => ({ value: l.name, text: l.name }))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
//面料信息
|
||||||
getAction('/fabric/info/all').then((res : any) => {
|
getAction('/fabric/info/all').then((res : any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
res.data.forEach((l : any) => {
|
res.data.forEach((l : any) => {
|
||||||
@ -50,27 +61,41 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
//所有用户名
|
||||||
getAction('/v1/user/getNames').then((res : any) => {
|
getAction('/v1/user/getNames').then((res : any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
nameList.value = res.data.map((l : any) => ({ value: l, text: l }))
|
nameList.value = res.data.map((l : any) => ({ value: l, text: l }))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
//其他选项
|
||||||
getAction('/extraOption').then((res : any) => {
|
getAction('/extraOption').then((res : any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
otherList.value = JSON.parse(res.data.payload)
|
otherList.value = JSON.parse(res.data.payload)
|
||||||
|
form.value.orderItems[0].extraOptions = otherList.value.map((l : any) => ({ name: l.name, value: l.options.find((m : any) => m.default) ? l.options.find((m : any) => m.default).name : '' }))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
//新增面料块
|
||||||
|
const addFabric = () => {
|
||||||
|
let extraOptions = otherList.value.map((l : any) => ({ name: l.name, value: l.options.find((m : any) => m.default) ? l.options.find((m : any) => m.default).name : '' }))
|
||||||
|
form.value.orderItems.push({ extraOptions: extraOptions, fabric: [{}], craftComment: {} })
|
||||||
|
}
|
||||||
|
|
||||||
const onClickLeft = () => {
|
const onClickLeft = () => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}
|
}
|
||||||
|
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
|
postAction('/customOrder',form.value).then((res:any)=>{
|
||||||
|
if(res.code===200){
|
||||||
|
showToast('提交成功!')
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const form = ref({ customOrder: { makeTime: formatDate(new Date()) }, orderItems: [{ fabric: [{}] }] } as any)
|
const form = ref({ customOrder: { makeTime: formatDate(new Date()) }, orderItems: [{ fabric: [{}], craftComment: {} }] } as any)
|
||||||
const showPicker = ref(false)
|
const showPicker = ref(false)
|
||||||
const typeData = ref()
|
const typeData = ref()
|
||||||
const popuList = ref([] as any[])
|
const popuList = ref([] as any[])
|
||||||
@ -82,11 +107,13 @@
|
|||||||
const searchIndex = ref(0)//查询到的数组
|
const searchIndex = ref(0)//查询到的数组
|
||||||
const mlList = ref([])
|
const mlList = ref([])
|
||||||
const indexData = ref()
|
const indexData = ref()
|
||||||
|
const indexData1 = ref()
|
||||||
//选择框事件
|
//选择框事件
|
||||||
const choosePic = (type : any, index : any) => {
|
const choosePic = (type : any, index : any, indexSecond : any) => {
|
||||||
showPicker.value = true
|
showPicker.value = true
|
||||||
typeData.value = type
|
typeData.value = type
|
||||||
indexData.value = index
|
indexData.value = index
|
||||||
|
indexData1.value = indexSecond
|
||||||
}
|
}
|
||||||
//选择框确认
|
//选择框确认
|
||||||
const pickerConfirm = (val : any) => {
|
const pickerConfirm = (val : any) => {
|
||||||
@ -95,6 +122,8 @@
|
|||||||
} else if (typeData.value === 'hasTex') {
|
} else if (typeData.value === 'hasTex') {
|
||||||
hasTex.value = val.selectedOptions[0].text
|
hasTex.value = val.selectedOptions[0].text
|
||||||
form.value.customOrder[typeData.value] = val.selectedOptions[0].value
|
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 {
|
||||||
form.value.customOrder[typeData.value] = val.selectedValues[0]
|
form.value.customOrder[typeData.value] = val.selectedValues[0]
|
||||||
}
|
}
|
||||||
@ -112,6 +141,8 @@
|
|||||||
popuList.value = [{ value: 'true', text: '含税' }, { value: 'false', text: '不含税' }]
|
popuList.value = [{ value: 'true', text: '含税' }, { value: 'false', text: '不含税' }]
|
||||||
} else if (typeData.value === 'belongTo') {
|
} else if (typeData.value === 'belongTo') {
|
||||||
popuList.value = nameList.value
|
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 }))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,30 +223,89 @@
|
|||||||
}, 800)
|
}, 800)
|
||||||
}
|
}
|
||||||
const onConfirm = (val : any) => {
|
const onConfirm = (val : any) => {
|
||||||
|
if (!form.value.customOrder.hasTex) return showToast('请选择是否含税!')
|
||||||
|
if (!form.value.orderItems[indexData.value].craft) return showToast('请选择工艺!')
|
||||||
form.value.orderItems[indexData.value].fabric[typeData.value].name = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1]
|
form.value.orderItems[indexData.value].fabric[typeData.value].name = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1]
|
||||||
pickerCancel()
|
pickerCancel()
|
||||||
|
let ml = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1]
|
||||||
|
let url = '/fabric/info/craftPrice?names=' + ml + '&hasTex=' + form.value.customOrder.hasTex
|
||||||
|
//面料价格
|
||||||
|
getAction(url).then((res : any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
res.data.forEach((l : any) => {
|
||||||
|
if (l.name === form.value.orderItems[indexData.value].craft) {
|
||||||
|
form.value.orderItems[indexData.value].price = l.broadHeadingPrice
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
const activeIds = ref([1, 2]);
|
const activeIds = ref([] as any[]);
|
||||||
const activeIndex = ref(0);
|
const activeIndex = ref(0);
|
||||||
const items = [
|
//选择提交
|
||||||
{
|
const subActive = () => {
|
||||||
text: '浙江',
|
let textList = []
|
||||||
children: [
|
craftCommentList.value.forEach((l : any) => {
|
||||||
{ text: '杭州', id: 1 },
|
l.children.forEach((m : any) => {
|
||||||
{ text: '温州', id: 2 },
|
let item = activeIds.value.find((k : any) => k === m.id)
|
||||||
{ text: '宁波', id: 3, },
|
if (item) {
|
||||||
],
|
textList.push(m.text)
|
||||||
},
|
}
|
||||||
{
|
})
|
||||||
text: '江苏',
|
})
|
||||||
children: [
|
form.value.orderItems[indexData.value].craftComment = { name: textList.join(','), value: JSON.parse(JSON.stringify(activeIds.value)) }
|
||||||
{ text: '南京', id: 4 },
|
showPicker.value = false
|
||||||
{ text: '无锡', id: 5 },
|
activeIds.value = []
|
||||||
{ text: '徐州', id: 6 },
|
}
|
||||||
],
|
|
||||||
},
|
|
||||||
{ text: '福建', },
|
const culit = (itemSecond : any) => {
|
||||||
];
|
itemSecond.qty = (itemSecond.len / 47).toFixed(1)
|
||||||
|
computing()
|
||||||
|
}
|
||||||
|
const computing = () => {
|
||||||
|
let zms = 0
|
||||||
|
let zps = 0
|
||||||
|
let ddje = 0
|
||||||
|
form.value.orderItems.forEach((l : any) => {
|
||||||
|
l.fabric.forEach((m : any) => {
|
||||||
|
zms += m.len * 1
|
||||||
|
zps += m.qty * 1
|
||||||
|
})
|
||||||
|
ddje = zms * l.price
|
||||||
|
})
|
||||||
|
form.value.customOrder.totalLen = zms.toFixed(1)
|
||||||
|
form.value.customOrder.totalQty = zps.toFixed(1)
|
||||||
|
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 search = () =>{
|
||||||
|
if (timer.value) {
|
||||||
|
clearTimeout(timer.value)
|
||||||
|
}
|
||||||
|
timer.value = setTimeout(() => {
|
||||||
|
getCustom()
|
||||||
|
}, 800)
|
||||||
|
}
|
||||||
|
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
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -225,8 +315,14 @@
|
|||||||
<van-form @submit="onSubmit">
|
<van-form @submit="onSubmit">
|
||||||
<van-cell-group inset>
|
<van-cell-group inset>
|
||||||
<van-field v-model="form.customOrder.customerName" name="客户名称" label="客户名称" colon class="bor"
|
<van-field v-model="form.customOrder.customerName" name="客户名称" label="客户名称" colon class="bor"
|
||||||
label-width="5em" readonly :rules="[{ required: true, message: '请填写' }]"
|
label-width="5em" :rules="[{ required: true, message: '请填写' }]" @input="search()"/>
|
||||||
@click="chooseDate()" />
|
<transition name="fade">
|
||||||
|
<ul class="searchPop" v-if="showPopup">
|
||||||
|
<template v-for="item in customerList">
|
||||||
|
<li @click="choose(item)">{{ item.name }}—{{ item.id }}</li>
|
||||||
|
</template>
|
||||||
|
</ul>
|
||||||
|
</transition>
|
||||||
<van-field v-model="form.customOrder.makeTime" name="做单日期" label="做单日期" colon label-width="5em"
|
<van-field v-model="form.customOrder.makeTime" name="做单日期" label="做单日期" colon label-width="5em"
|
||||||
readonly :rules="[{ required: true, message: '请填写' }]" class="bor-n" />
|
readonly :rules="[{ required: true, message: '请填写' }]" class="bor-n" />
|
||||||
<van-field v-model="form.customOrder.belongTo" name="订单归属" label="订单归属" colon label-width="5em"
|
<van-field v-model="form.customOrder.belongTo" name="订单归属" label="订单归属" colon label-width="5em"
|
||||||
@ -240,7 +336,7 @@
|
|||||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor"
|
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor"
|
||||||
@click="choosePic('hasTex')" />
|
@click="choosePic('hasTex')" />
|
||||||
<view class="a-b">
|
<view class="a-b">
|
||||||
<van-button type="primary" @click="form.orderItems.push({})">面料添加</van-button>
|
<van-button type="primary" @click="addFabric">面料添加</van-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="card" v-for="(item,index) in form.orderItems" :key="index">
|
<view class="card" v-for="(item,index) in form.orderItems" :key="index">
|
||||||
@ -259,27 +355,34 @@
|
|||||||
<van-icon name="clear" color="red" size="25" v-if="index!=0"
|
<van-icon name="clear" color="red" size="25" v-if="index!=0"
|
||||||
@click="item.fabric.splice(index,1)" />
|
@click="item.fabric.splice(index,1)" />
|
||||||
<van-field v-model="itemSecond.name" name="面料名称" label="面料名称" colon readonly
|
<van-field v-model="itemSecond.name" name="面料名称" label="面料名称" colon readonly
|
||||||
label-width="5em" @click="selectChoose(index,indexSecond)" class="bor" />
|
label-width="5em" @click="selectChoose(index,indexSecond)" class="bor"
|
||||||
|
:rules="[{ required: true, message: '请填写' }]" />
|
||||||
</view>
|
</view>
|
||||||
<van-field v-model="itemSecond.len" name="需求米数" label="需求米数" type="number" colon
|
<van-field v-model="itemSecond.len" name="需求米数" label="需求米数" type="number" colon
|
||||||
label-width="6.5em" />
|
label-width="6.5em"
|
||||||
<van-field v-model="itemSecond.qty" name="需求匹数" label="需求匹数" colon label-width="6.5em"
|
:rules="[{ required: true, message: '请填写' },{ validator, message: '保留一位小数' }]"
|
||||||
readonly />
|
@blur="culit(itemSecond)" />
|
||||||
|
<van-field v-model="itemSecond.qty" type="number" name="需求匹数" label="需求匹数" colon
|
||||||
|
label-width="6.5em"
|
||||||
|
:rules="[{ required: true, message: '请填写' },{ validator, message: '保留一位小数' }]"
|
||||||
|
@blur="computing()" />
|
||||||
</view>
|
</view>
|
||||||
<van-field v-model="item.price" name="订单单价" label="订单单价" colon
|
<van-field v-model="item.price" name="订单单价" label="订单单价" colon
|
||||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" />
|
:rules="[{ required: true, message: '请填写' }]" label-width="5em" @blur="computing()" />
|
||||||
<van-field v-model="item.craftComment" name="工艺要求" label="工艺要求" colon
|
<van-field v-model="item.craftComment.name" name="工艺要求" label="工艺要求" colon
|
||||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor"
|
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor"
|
||||||
@click="choosePic('craftComment')" />
|
@click="choosePic('craftComment',index)" />
|
||||||
<van-field v-model="item.width" name="有效门幅" label="有效门幅" colon label-width="5em" />
|
<van-field v-model="item.width" name="有效门幅" label="有效门幅" colon label-width="5em"
|
||||||
<van-field v-model="item.expecetWidth" name="全门幅" label="全门幅" colon label-width="5em" />
|
:rules="item.expecetWidth?[]:[{ required: true, message: '请填写' },{ validator, message: '保留一位小数' }]" />
|
||||||
|
<van-field v-model="item.expecetWidth" name="全门幅" label="全门幅" colon label-width="5em"
|
||||||
|
:rules="item.width?[]:[{ required: true, message: '请填写' },{ validator, message: '保留一位小数' }]" />
|
||||||
<p>其他要求</p>
|
<p>其他要求</p>
|
||||||
<view v-for="(item,index) in otherList" :key="index">
|
<view v-for="(itemSecond,indexSecond) in item.extraOptions" :key="indexSecond">
|
||||||
<van-field v-model="item.value" :name="item.name" :label="item.name" colon
|
<van-field v-model="itemSecond.value" :name="itemSecond.name" :label="itemSecond.name" colon
|
||||||
:rules="item.necessary?[{ required: true, message: '请填写' }]:[]" label-width="5em"
|
:rules="item.necessary?[{ required: true, message: '请填写' }]:[]" label-width="5em"
|
||||||
readonly class="bor" @click="choosePic('')" />
|
readonly class="bor" @click="choosePic('extraOptions',index,indexSecond)" />
|
||||||
</view>
|
</view>
|
||||||
<p style="text-align: center;margin: 10rpx 0;color: #02a7f0;" @click="form.fabrics.push({})">
|
<p style="text-align: center;margin: 10rpx 0;color: #02a7f0;" @click="addFabric">
|
||||||
复制新增</p>
|
复制新增</p>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -293,9 +396,9 @@
|
|||||||
:rules="[{ required: true, message: '请填写' }]" readonly class="bor"
|
:rules="[{ required: true, message: '请填写' }]" readonly class="bor"
|
||||||
@click="chooseDate('finishDate')" />
|
@click="chooseDate('finishDate')" />
|
||||||
<van-field v-model="form.customOrder.customerComment" name="客户备注" label="客户备注" colon
|
<van-field v-model="form.customOrder.customerComment" name="客户备注" label="客户备注" colon
|
||||||
label-width="5em" :rules="[{ required: true, message: '请填写' }]" readonly class="bor-n" />
|
label-width="5em" />
|
||||||
<van-field v-model="form.customOrder.interComment" name="内部备注" label="内部备注" colon label-width="5em"
|
<van-field v-model="form.customOrder.interComment" name="内部备注" label="内部备注" colon
|
||||||
:rules="[{ required: true, message: '请填写' }]" readonly class="bor-n" />
|
label-width="5em" />
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
<view style="margin: 16px;">
|
<view style="margin: 16px;">
|
||||||
<van-button round block type="primary" native-type="submit">
|
<van-button round block type="primary" native-type="submit">
|
||||||
@ -311,8 +414,15 @@
|
|||||||
|
|
||||||
<!--选择框-->
|
<!--选择框-->
|
||||||
<van-popup v-model:show="showPicker" round position="bottom" @open="handleOpen">
|
<van-popup v-model:show="showPicker" round position="bottom" @open="handleOpen">
|
||||||
<van-tree-select v-if="typeData==='craftComment'" v-model:active-id="activeIds"
|
<view v-if="typeData==='craftComment'">
|
||||||
v-model:main-active-index="activeIndex" :items="items" />
|
<view class="b-a">
|
||||||
|
<van-button @click="showPicker=false,activeIds=[]">取消</van-button>
|
||||||
|
<van-button type="primary" @click="subActive">提交</van-button>
|
||||||
|
</view>
|
||||||
|
<van-tree-select v-model:active-id="activeIds" v-model:main-active-index="activeIndex"
|
||||||
|
:items="craftCommentList" />
|
||||||
|
</view>
|
||||||
|
|
||||||
<van-picker show-toolbar :columns="popuList" @confirm="pickerConfirm" @cancel="showPickerCancel" ref="pickerRef"
|
<van-picker show-toolbar :columns="popuList" @confirm="pickerConfirm" @cancel="showPickerCancel" ref="pickerRef"
|
||||||
v-else />
|
v-else />
|
||||||
</van-popup>
|
</van-popup>
|
||||||
@ -366,6 +476,7 @@
|
|||||||
border: 1rpx solid #d7d7d7;
|
border: 1rpx solid #d7d7d7;
|
||||||
border-radius: 5rpx;
|
border-radius: 5rpx;
|
||||||
padding: 10rpx;
|
padding: 10rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-button {
|
.footer-button {
|
||||||
@ -410,6 +521,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.b-a {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
|
||||||
|
::v-deep .van-button--normal {
|
||||||
|
padding: 5px 8px;
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
::v-deep .van-field__control {
|
::v-deep .van-field__control {
|
||||||
border-bottom: 1px solid #d7d7d7;
|
border-bottom: 1px solid #d7d7d7;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -499,4 +622,19 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
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;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
795
pages/customOrder/detail.vue
Normal file
795
pages/customOrder/detail.vue
Normal file
@ -0,0 +1,795 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted, ref, watch } from 'vue';
|
||||||
|
import { formatDate } from '../../utils/date';
|
||||||
|
import { getAction, postAction, putAction, upLoadAction, uploadAction } from '../../common/http';
|
||||||
|
import { showConfirmDialog, showToast } from 'vant';
|
||||||
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
|
|
||||||
|
const craftList = ref([] as any[])
|
||||||
|
const otherList = ref([] as any[])
|
||||||
|
const hasTex = ref('' as any)
|
||||||
|
const nameList = ref([] as any[])
|
||||||
|
const craftCommentList = ref([] as any[])
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
//工艺要求获取
|
||||||
|
getAction('/craftCommentCategory').then((res : any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
craftCommentList.value = res.data.map((l : any) => ({ text: l.category, id: l.id, children: l.subCategory.map((m : any) => ({ text: m.subCategory, id: m.id })) }))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//用户信息
|
||||||
|
uni.getStorage({
|
||||||
|
key: 'info',
|
||||||
|
success(res) {
|
||||||
|
let data = JSON.parse(res.data)
|
||||||
|
form.value.customOrder.makeUser = data.userName
|
||||||
|
form.value.customOrder.belongTo = data.userName
|
||||||
|
},
|
||||||
|
fail: (err : any) => {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//工艺信息
|
||||||
|
getAction('/fabric/craft/info').then((res : any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
craftList.value = res.data.map((l : any) => ({ value: l.name, text: l.name }))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//面料信息
|
||||||
|
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('/extraOption').then((res : any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
otherList.value = JSON.parse(res.data.payload)
|
||||||
|
form.value.orderItems[0].extraOptions = otherList.value.map((l : any) => ({ name: l.name, value: l.options.find((m : any) => m.default) ? l.options.find((m : any) => m.default).name : '' }))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
//新增面料块
|
||||||
|
const addFabric = () => {
|
||||||
|
let extraOptions = otherList.value.map((l : any) => ({ name: l.name, value: l.options.find((m : any) => m.default) ? l.options.find((m : any) => m.default).name : '' }))
|
||||||
|
form.value.orderItems.push({ extraOptions: extraOptions, fabric: [{}], craftComment: {} })
|
||||||
|
}
|
||||||
|
|
||||||
|
const onClickLeft = () => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
|
||||||
|
const onSubmit = () => {
|
||||||
|
putAction('/customOrder', form.value).then((res : any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
showToast('提交成功!')
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
onLoad((option : any) => {
|
||||||
|
form.value = JSON.parse(option.item)
|
||||||
|
fileList.value = [{ url: form.value.customOrder.checkPic }]
|
||||||
|
hasTex.value = form.value.customOrder.hasTex ? '含税' : '不含税'
|
||||||
|
})
|
||||||
|
|
||||||
|
const form = ref({ customOrder: { makeTime: formatDate(new Date()) }, orderItems: [{ fabric: [{}], craftComment: {} }] } as any)
|
||||||
|
const showPicker = ref(false)
|
||||||
|
const typeData = ref()
|
||||||
|
const popuList = ref([] as any[])
|
||||||
|
const show = ref(false)
|
||||||
|
const pickerList = ref([])//面料数据
|
||||||
|
const pickerContainerList = ref([])
|
||||||
|
const showPickerList = ref(false)
|
||||||
|
const searchValue = ref('')//查询的值
|
||||||
|
const searchIndex = ref(0)//查询到的数组
|
||||||
|
const mlList = ref([])
|
||||||
|
const indexData = ref()
|
||||||
|
const indexData1 = ref()
|
||||||
|
//选择框事件
|
||||||
|
const choosePic = (type : any, index : any, indexSecond : any) => {
|
||||||
|
showPicker.value = true
|
||||||
|
typeData.value = type
|
||||||
|
indexData.value = index
|
||||||
|
indexData1.value = indexSecond
|
||||||
|
}
|
||||||
|
//选择框确认
|
||||||
|
const pickerConfirm = (val : any) => {
|
||||||
|
if (typeData.value === 'craft') {
|
||||||
|
form.value.orderItems[indexData.value][typeData.value] = val.selectedValues[0]
|
||||||
|
} else if (typeData.value === 'hasTex') {
|
||||||
|
hasTex.value = val.selectedOptions[0].text
|
||||||
|
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 {
|
||||||
|
form.value.customOrder[typeData.value] = val.selectedValues[0]
|
||||||
|
}
|
||||||
|
showPickerCancel()
|
||||||
|
}
|
||||||
|
//取消
|
||||||
|
const showPickerCancel = () => {
|
||||||
|
showPicker.value = false
|
||||||
|
}
|
||||||
|
//弹窗开启事件
|
||||||
|
const handleOpen = () => {
|
||||||
|
if (typeData.value === 'craft') {
|
||||||
|
popuList.value = craftList.value
|
||||||
|
} 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 }))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const chooseDate = (type : any) => {
|
||||||
|
typeData.value = type
|
||||||
|
show.value = true
|
||||||
|
}
|
||||||
|
//日期选择
|
||||||
|
const onConfirmDate = (val : any) => {
|
||||||
|
form.value.customOrder[typeData.value] = formatDate(val)
|
||||||
|
show.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
//选择面料
|
||||||
|
const selectChoose = (index : any, indexSecond : any) => {
|
||||||
|
indexData.value = index
|
||||||
|
typeData.value = indexSecond
|
||||||
|
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) => {
|
||||||
|
if (!form.value.customOrder.hasTex) return showToast('请选择是否含税!')
|
||||||
|
if (!form.value.orderItems[indexData.value].craft) return showToast('请选择工艺!')
|
||||||
|
form.value.orderItems[indexData.value].fabric[typeData.value].name = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1]
|
||||||
|
pickerCancel()
|
||||||
|
let ml = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1]
|
||||||
|
let url = '/fabric/info/craftPrice?names=' + ml + '&hasTex=' + form.value.customOrder.hasTex
|
||||||
|
//面料价格
|
||||||
|
getAction(url).then((res : any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
res.data.forEach((l : any) => {
|
||||||
|
if (l.name === form.value.orderItems[indexData.value].craft) {
|
||||||
|
form.value.orderItems[indexData.value].price = l.broadHeadingPrice
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const activeIds = ref([] as any[]);
|
||||||
|
const activeIndex = ref(0);
|
||||||
|
//选择提交
|
||||||
|
const subActive = () => {
|
||||||
|
let textList = []
|
||||||
|
craftCommentList.value.forEach((l : any) => {
|
||||||
|
l.children.forEach((m : any) => {
|
||||||
|
let item = activeIds.value.find((k : any) => k === m.id)
|
||||||
|
if (item) {
|
||||||
|
textList.push(m.text)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
form.value.orderItems[indexData.value].craftComment = { name: textList.join(','), value: JSON.parse(JSON.stringify(activeIds)) }
|
||||||
|
showPicker.value = false
|
||||||
|
activeIds.value = []
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const culit = (itemSecond : any) => {
|
||||||
|
itemSecond.qty = (itemSecond.len / 47).toFixed(1)
|
||||||
|
computing()
|
||||||
|
}
|
||||||
|
const computing = () => {
|
||||||
|
let zms = 0
|
||||||
|
let zps = 0
|
||||||
|
let ddje = 0
|
||||||
|
form.value.orderItems.forEach((l : any) => {
|
||||||
|
l.fabric.forEach((m : any) => {
|
||||||
|
zms += m.len * 1
|
||||||
|
zps += m.qty * 1
|
||||||
|
})
|
||||||
|
ddje = zms * l.price
|
||||||
|
})
|
||||||
|
form.value.customOrder.totalLen = zms.toFixed(1)
|
||||||
|
form.value.customOrder.totalQty = zps.toFixed(1)
|
||||||
|
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 search = () => {
|
||||||
|
if (timer.value) {
|
||||||
|
clearTimeout(timer.value)
|
||||||
|
}
|
||||||
|
timer.value = setTimeout(() => {
|
||||||
|
getCustom()
|
||||||
|
}, 800)
|
||||||
|
}
|
||||||
|
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
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//取消弹窗
|
||||||
|
const showDialog = ref(false)
|
||||||
|
const confirmSecond = () => {
|
||||||
|
if (!form.value.customOrder.cancelReason) showToast('请填写取消原因!')
|
||||||
|
let url = "/customerOrder/cancel/" + form.value.customOrder.id
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//驳回
|
||||||
|
const check = () => {
|
||||||
|
showConfirmDialog({
|
||||||
|
title: '提示',
|
||||||
|
message: '是否确认驳回本单?',
|
||||||
|
}).then(() => {
|
||||||
|
let url = '/customOrder/reject/' + form.value.customOrder.id
|
||||||
|
putAction(url).then((res : any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
showToast('操作成功!')
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
// on cancel
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//通过
|
||||||
|
const pass = () => {
|
||||||
|
if (form.value.customOrder.status === '待排单员审核') {
|
||||||
|
if (!pic.value) showToast('请上传排单图!')
|
||||||
|
showConfirmDialog({
|
||||||
|
title: '提示',
|
||||||
|
message: '是否确认通过本单?',
|
||||||
|
}).then(() => {
|
||||||
|
let url = '/customOrder/dispatcherCheck/' + form.value.customOrder.id
|
||||||
|
putAction(url, { pic: pic.value, comment: form.value.customOrder.interComment }).then((res : any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
showToast('操作成功!')
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
// on cancel
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
showConfirmDialog({
|
||||||
|
title: '提示',
|
||||||
|
message: '是否确认通过本单?',
|
||||||
|
}).then(() => {
|
||||||
|
let url = '/customOrder/managerCheck/' + form.value.customOrder.id
|
||||||
|
putAction(url).then((res : any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
showToast('操作成功!')
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
// on cancel
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const fileList = ref([] as any[])
|
||||||
|
const pic = ref()
|
||||||
|
const afterRead = (file : any) => {
|
||||||
|
file.status = 'uploading';
|
||||||
|
file.message = '上传中...';
|
||||||
|
uploadAction('/upload', file.file).then((res : any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
file.status = 'success';
|
||||||
|
file.message = '成功!';
|
||||||
|
pic.value = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<view class="flex">
|
||||||
|
<van-nav-bar :title="form.customOrder.status" left-text="返回" left-arrow @click-left="onClickLeft" />
|
||||||
|
<view class="content">
|
||||||
|
<van-form @submit="onSubmit">
|
||||||
|
<view class="a-f">
|
||||||
|
<van-button type="danger" @click="showDialog=true"
|
||||||
|
v-if="!'取消审核中'.includes(form.customOrder.status)">取消</van-button>
|
||||||
|
<van-button type="primary" style="margin: 0 15rpx;" native-type="submit"
|
||||||
|
v-if="!'取消审核中,已通过'.includes(form.customOrder.status)">编辑</van-button>
|
||||||
|
</view>
|
||||||
|
<van-cell-group inset>
|
||||||
|
<van-field v-model="form.customOrder.id" name="订单编号" label="订单编号" colon label-width="5em" readonly
|
||||||
|
class="bor-n" />
|
||||||
|
<van-field v-model="form.customOrder.customerName" name="客户名称" label="客户名称" colon class="bor"
|
||||||
|
label-width="5em" :rules="[{ required: true, message: '请填写' }]" @input="search()" />
|
||||||
|
<transition name="fade">
|
||||||
|
<ul class="searchPop" v-if="showPopup">
|
||||||
|
<template v-for="item in customerList">
|
||||||
|
<li @click="choose(item)">{{ item.name }}—{{ item.id }}</li>
|
||||||
|
</template>
|
||||||
|
</ul>
|
||||||
|
</transition>
|
||||||
|
<van-field v-model="form.customOrder.makeTime" name="做单日期" label="做单日期" colon label-width="5em"
|
||||||
|
readonly :rules="[{ required: true, message: '请填写' }]" class="bor-n" />
|
||||||
|
<van-field v-model="form.customOrder.belongTo" name="订单归属" label="订单归属" colon label-width="5em"
|
||||||
|
:rules="[{ required: true, message: '请填写' }]" readonly class="bor"
|
||||||
|
@click="choosePic('belongTo')" />
|
||||||
|
<van-field v-model="form.customOrder.makeUser" name="做单人员" label="做单人员" colon label-width="5em"
|
||||||
|
:rules="[{ required: true, message: '请填写' }]" readonly class="bor-n" />
|
||||||
|
<van-field v-model="form.customOrder.sd" name="谁定" label="谁定" colon
|
||||||
|
:rules="[{ required: true, message: '请填写' }]" label-width="5em" />
|
||||||
|
<van-field v-model="hasTex" name="是否含税" label="是否含税" colon
|
||||||
|
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor"
|
||||||
|
@click="choosePic('hasTex')" />
|
||||||
|
<view class="a-b">
|
||||||
|
<van-button type="primary" @click="addFabric">面料添加</van-button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="card" v-for="(item,index) in form.orderItems" :key="index">
|
||||||
|
<view style="text-align: end;">
|
||||||
|
<van-icon name="cross" @click="form.orderItems.splice(index,1)" />
|
||||||
|
</view>
|
||||||
|
<van-field v-model="item.color" name="颜色色号" label="颜色色号" colon
|
||||||
|
:rules="[{ required: true, message: '请填写' }]" label-width="5em" />
|
||||||
|
<van-field v-model="item.craft" name="工艺名称" label="工艺名称" colon
|
||||||
|
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor"
|
||||||
|
@click="choosePic('craft',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"
|
||||||
|
@click="item.fabric.push({})" />
|
||||||
|
<van-icon name="clear" color="red" size="25" v-if="index!=0"
|
||||||
|
@click="item.fabric.splice(index,1)" />
|
||||||
|
<van-field v-model="itemSecond.name" name="面料名称" label="面料名称" colon readonly
|
||||||
|
label-width="5em" @click="selectChoose(index,indexSecond)" class="bor"
|
||||||
|
:rules="[{ required: true, message: '请填写' }]" />
|
||||||
|
</view>
|
||||||
|
<van-field v-model="itemSecond.len" name="需求米数" label="需求米数" type="number" colon
|
||||||
|
label-width="6.5em"
|
||||||
|
:rules="[{ required: true, message: '请填写' },{ validator, message: '保留一位小数' }]"
|
||||||
|
@blur="culit(itemSecond)" />
|
||||||
|
<van-field v-model="itemSecond.qty" type="number" name="需求匹数" label="需求匹数" colon
|
||||||
|
label-width="6.5em"
|
||||||
|
:rules="[{ required: true, message: '请填写' },{ validator, message: '保留一位小数' }]"
|
||||||
|
@blur="computing()" />
|
||||||
|
</view>
|
||||||
|
<van-field v-model="item.price" name="订单单价" label="订单单价" colon
|
||||||
|
:rules="[{ required: true, message: '请填写' }]" label-width="5em" @blur="computing()" />
|
||||||
|
<van-field v-model="item.craftComment.name" name="工艺要求" label="工艺要求" colon
|
||||||
|
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor"
|
||||||
|
@click="choosePic('craftComment',index)" />
|
||||||
|
<van-field v-model="item.width" name="有效门幅" label="有效门幅" colon label-width="5em"
|
||||||
|
:rules="item.expecetWidth?[]:[{ required: true, message: '请填写' },{ validator, message: '保留一位小数' }]" />
|
||||||
|
<van-field v-model="item.expecetWidth" name="全门幅" label="全门幅" colon label-width="5em"
|
||||||
|
:rules="item.width?[]:[{ required: true, message: '请填写' },{ validator, message: '保留一位小数' }]" />
|
||||||
|
<p>其他要求</p>
|
||||||
|
<view v-for="(itemSecond,indexSecond) in item.extraOptions" :key="indexSecond">
|
||||||
|
<van-field v-model="itemSecond.value" :name="itemSecond.name" :label="itemSecond.name" colon
|
||||||
|
:rules="item.necessary?[{ required: true, message: '请填写' }]:[]" label-width="5em"
|
||||||
|
readonly class="bor" @click="choosePic('extraOptions',index,indexSecond)" />
|
||||||
|
</view>
|
||||||
|
<p style="text-align: center;margin: 10rpx 0;color: #02a7f0;" @click="addFabric">
|
||||||
|
复制新增</p>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<van-field v-model="form.customOrder.totalLen" name="总米数" label="总米数" colon label-width="5em"
|
||||||
|
:rules="[{ required: true, message: '请填写' }]" readonly class="bor-n" />
|
||||||
|
<van-field v-model="form.customOrder.totalQty" name="总匹数" label="总匹数" colon label-width="5em"
|
||||||
|
:rules="[{ required: true, message: '请填写' }]" readonly class="bor-n" />
|
||||||
|
<van-field v-model="form.customOrder.currency" name="订单总额" label="订单总额" colon label-width="5em"
|
||||||
|
:rules="[{ required: true, message: '请填写' }]" readonly class="bor-n" />
|
||||||
|
<van-field v-model="form.customOrder.finishDate" name="交货日期" label="交货日期" colon label-width="5em"
|
||||||
|
:rules="[{ required: true, message: '请填写' }]" readonly class="bor"
|
||||||
|
@click="chooseDate('finishDate')" />
|
||||||
|
<van-field v-model="form.customOrder.customerComment" name="客户备注" label="客户备注" colon
|
||||||
|
label-width="5em" />
|
||||||
|
<van-field v-model="form.customOrder.interComment" name="内部备注" label="内部备注" colon
|
||||||
|
label-width="5em" />
|
||||||
|
<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" />
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
</view>
|
||||||
|
<view v-if="form.customOrder.status==='取消审核中'">
|
||||||
|
<van-field v-model="form.customOrder.cancelReason" name="取消原因" label="取消原因" colon
|
||||||
|
label-width="5em" readonly />
|
||||||
|
<p>是否同意取消该定做单?</p>
|
||||||
|
</view>
|
||||||
|
</van-cell-group>
|
||||||
|
</van-form>
|
||||||
|
<view class="c-a" v-if="form.customOrder.status!=='已通过'">
|
||||||
|
<van-button type="danger" @click="check">驳回</van-button>
|
||||||
|
<van-button type="primary" @click="pass">通过</van-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<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">
|
||||||
|
<view v-if="typeData==='craftComment'">
|
||||||
|
<view class="b-a">
|
||||||
|
<van-button @click="showPicker=false,activeIds=[]">取消</van-button>
|
||||||
|
<van-button type="primary" @click="subActive">提交</van-button>
|
||||||
|
</view>
|
||||||
|
<van-tree-select v-model:active-id="activeIds" v-model:main-active-index="activeIndex"
|
||||||
|
:items="craftCommentList" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<van-picker show-toolbar :columns="popuList" @confirm="pickerConfirm" @cancel="showPickerCancel" ref="pickerRef"
|
||||||
|
v-else />
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
<!-- 面料选择框-->
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<van-dialog v-model:show="showDialog">
|
||||||
|
<view>
|
||||||
|
<p style="padding: 20rpx;text-align: center;">是否确认取消订单?</p>
|
||||||
|
<van-cell-group inset>
|
||||||
|
<van-field v-model="form.customOrder.cancelReason" colon name="取消原因" label="取消原因" label-width="5em" />
|
||||||
|
</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>
|
||||||
|
<van-button size="small" type="success" native-type="submit" style="width: 25vw;"
|
||||||
|
@click="confirmSecond">
|
||||||
|
确认
|
||||||
|
</van-button>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</van-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.flex {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100vh;
|
||||||
|
width: 100vw;
|
||||||
|
overflow-y: hidden;
|
||||||
|
|
||||||
|
.van-nav-bar {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
flex: 1;
|
||||||
|
padding: 0 10px;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
border: 1rpx solid #d7d7d7;
|
||||||
|
border-radius: 5rpx;
|
||||||
|
padding: 10rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-button {
|
||||||
|
margin: 20px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .van-field {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.a-b {
|
||||||
|
margin: 10rpx;
|
||||||
|
|
||||||
|
::v-deep .van-button--normal {
|
||||||
|
padding: 5px 8px;
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.a-c {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
::v-deep .van-button--normal {
|
||||||
|
padding: 8rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
width: 7em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.a-f {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: end;
|
||||||
|
|
||||||
|
::v-deep .van-button--normal {
|
||||||
|
padding: 8rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
width: 3.5em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.c-a {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
padding: 15rpx;
|
||||||
|
|
||||||
|
::v-deep .van-button--normal {
|
||||||
|
padding: 8rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
width: 7em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bor {
|
||||||
|
::v-deep .van-field__control {
|
||||||
|
border: 1px solid #d7d7d7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bor-n {
|
||||||
|
::v-deep .van-field__control {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.b-a {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
|
||||||
|
::v-deep .van-button--normal {
|
||||||
|
padding: 5px 8px;
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .van-field__control {
|
||||||
|
border-bottom: 1px solid #d7d7d7;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .van-field__label {
|
||||||
|
text-align: end;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*面料选择搜索框*/
|
||||||
|
.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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>
|
@ -1,38 +1,42 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { showToast } from 'vant';
|
import { onMounted, ref, watch } from 'vue';
|
||||||
import { onMounted, ref } from 'vue';
|
|
||||||
import { getAction } from '../../common/http';
|
import { getAction } from '../../common/http';
|
||||||
import { formatDate } from '../../utils/date';
|
import { formatDate } from '../../utils/date';
|
||||||
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
|
|
||||||
const form = ref({} as any)
|
const form = ref({} as any)
|
||||||
const list = ref([] as any[])
|
const list = ref([] as any[])
|
||||||
|
const statusList = ref([
|
||||||
|
{ status: "待审核", code: "UnCheck", type: "warning", path: '/pages/spot/audit' },
|
||||||
|
{ status: "待主管审核", code: "UnCheckByLeader", type: "primary" },
|
||||||
|
{ status: "待排单员审核", code: "UnCheckByCharger", type: "success" },
|
||||||
|
{ status: "已通过", code: "Checked", type: "primary", path: '/pages/spot/pass' },
|
||||||
|
{ status: "取消审核中", code: "Canceling", type: "warning" },
|
||||||
|
{ status: "已取消", code: "Canceled", type: "danger" },
|
||||||
|
{ status: "被驳回", code: "Rejected", type: "danger" },
|
||||||
|
{ status: "部分配货", code: "Allocating", type: "warning" },
|
||||||
|
{ status: "已配完(待进厂)", code: "Allocated", type: "success" },
|
||||||
|
{ status: "已进厂", code: "Processing", type: "primary" },
|
||||||
|
{ status: "已出厂(待收货)", code: "Processed", type: "success" },
|
||||||
|
{ status: "待质检", code: "UnTested", type: "warning" },
|
||||||
|
{ status: "已质检(待入库)", code: "Testing", type: "primary" },
|
||||||
|
{ status: "已质检(待入库)", code: "Tested", type: "primary" },
|
||||||
|
{ status: "已入库", code: "Storage", type: "success" }
|
||||||
|
])
|
||||||
|
const nameList = ref([] as any[])
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getAction('/fabric/info/all').then((res : any) => {
|
//所有用户名
|
||||||
|
getAction('/v1/user/getNames').then((res : any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
res.data.forEach((l : any) => {
|
nameList.value = res.data.map((l : any) => ({ value: l, text: l }))
|
||||||
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 }] }]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
onShow(()=>{
|
||||||
|
list.value = []
|
||||||
|
init()
|
||||||
|
})
|
||||||
|
|
||||||
const onClickLeft = () => {
|
const onClickLeft = () => {
|
||||||
history.back()
|
history.back()
|
||||||
@ -60,85 +64,24 @@ import { formatDate } from '../../utils/date';
|
|||||||
};
|
};
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
getAction('/customOrder', form.value).then((res : any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
res.data.record.forEach((l : any) => {
|
||||||
|
list.value.push(l)
|
||||||
|
let item = statusList.value.find((m : any) => m.status == l.customOrder.status)
|
||||||
|
l.customOrder.statusColor = item.type
|
||||||
|
|
||||||
}
|
})
|
||||||
|
total.value = res.data.total
|
||||||
|
loading.value = false;
|
||||||
|
finished.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.category = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1]
|
|
||||||
pickerCancel()
|
|
||||||
}
|
}
|
||||||
|
watch(form.value, () => {
|
||||||
|
list.value = []
|
||||||
|
init()
|
||||||
|
})
|
||||||
|
|
||||||
const showPicker = ref(false)
|
const showPicker = ref(false)
|
||||||
const typeData = ref()
|
const typeData = ref()
|
||||||
@ -150,10 +93,7 @@ import { formatDate } from '../../utils/date';
|
|||||||
}
|
}
|
||||||
//选择框确认
|
//选择框确认
|
||||||
const pickerConfirm = (val : any) => {
|
const pickerConfirm = (val : any) => {
|
||||||
if (typeData.value === 'level') {
|
form.value[typeData.value] = val.selectedValues[0]
|
||||||
} else {
|
|
||||||
form.value[typeData.value] = val.selectedValues[0]
|
|
||||||
}
|
|
||||||
showPickerCancel()
|
showPickerCancel()
|
||||||
}
|
}
|
||||||
//取消
|
//取消
|
||||||
@ -162,10 +102,10 @@ import { formatDate } from '../../utils/date';
|
|||||||
}
|
}
|
||||||
//弹窗开启事件
|
//弹窗开启事件
|
||||||
const handleOpen = () => {
|
const handleOpen = () => {
|
||||||
if (typeData.value === 'supplier') {
|
if (typeData.value === 'status') {
|
||||||
popuList.value = []
|
popuList.value = [{ text: '待主管审核', value: '待主管审核' }, { text: '待主管审核', value: '待主管审核' }, { text: '待排单审核', value: '待排单审核' }, { text: '已通过', value: '已通过' }, { text: '被驳回', value: '被驳回' }, { text: '取消审核中', value: '取消审核中' }, { text: '已取消', value: '已取消' }]
|
||||||
} else if (typeData.value === 'level') {
|
} else {
|
||||||
popuList.value = []
|
popuList.value = nameList.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//日期选择
|
//日期选择
|
||||||
@ -179,6 +119,14 @@ import { formatDate } from '../../utils/date';
|
|||||||
form.value[dataType.value] = formatDate(val)
|
form.value[dataType.value] = formatDate(val)
|
||||||
show.value = false
|
show.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//详情
|
||||||
|
const toDetile = (item : any) => {
|
||||||
|
let url='./detail'+'?'+'item='+JSON.stringify(item)
|
||||||
|
uni.navigateTo({
|
||||||
|
url:url,
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -192,27 +140,34 @@ import { formatDate } from '../../utils/date';
|
|||||||
@click="chooseDate('endDate')" />
|
@click="chooseDate('endDate')" />
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
<van-cell-group inset style="display: flex;">
|
<van-cell-group inset style="display: flex;">
|
||||||
<van-field v-model="form.category" name="面料筛选" label="面料筛选" colon class="bor" label-width="5em" readonly
|
<van-field v-model="form.makeUser" name="做单人员" label="做单人员" colon class="bor" label-width="5em" readonly
|
||||||
@click="selectChoose" />
|
@click="choosePic('makeUser')" />
|
||||||
<van-field v-model="form.barcode" name="订单状态" label="订单状态" colon class="bor" label-width="5em" readonly @click="choosePic"/>
|
<van-field v-model="form.belongTo" name="订单归属" label="订单归属" colon class="bor" label-width="5em" readonly
|
||||||
|
@click="choosePic('belongTo')" />
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
<van-cell-group inset style="display: flex;">
|
<van-cell-group inset style="display: flex;">
|
||||||
<van-field v-model="form.len" name="颜色筛选" label="颜色筛选" colon class="bor" label-width="5em" readonly @click="choosePic"/>
|
<van-field v-model="form.sd" name="谁定" label="谁 定" colon
|
||||||
<van-field v-model="form.location" name="做单人员" label="做单人员" colon class="bor" label-width="5em" readonly @click="choosePic"/>
|
label-width="5em" class="bor-a" />
|
||||||
|
<van-field v-model="form.status" name="订单状态" label="订单状态" colon class="bor" label-width="5em" readonly
|
||||||
|
@click="choosePic('status')" />
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
<view class="grid-container">
|
<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 class="grid-item">匹数</view>
|
<view class="grid-item">总米数<br>总匹数</view>
|
||||||
<view class="grid-item">操作</view>
|
<view class="grid-item">状态</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
|
<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-container" v-for="(item,index) in list" :key="index">
|
||||||
<view class="grid-item">{{item.category}}</view>
|
<view class="grid-item">{{item.customOrder.makeTime}}</view>
|
||||||
<view class="grid-item">{{item.barcode}}</view>
|
<view class="grid-item">
|
||||||
<view class="grid-item" @click="toDetile(item)">{{item.len}}</view>
|
{{item.customOrder.makeUser}}/{{item.customOrder.belongTo}}<br>{{item.customOrder.sd}}
|
||||||
<view class="grid-item">{{item.location}}</view>
|
</view>
|
||||||
|
<view class="grid-item">{{item.customOrder.totalLen}}米/{{item.customOrder.totalQty}}匹</view>
|
||||||
|
<view class="grid-item" @click="toDetile(item)">
|
||||||
|
<van-button :type="item.customOrder.statusColor">{{item.customOrder.status}}</van-button>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</van-list>
|
</van-list>
|
||||||
</view>
|
</view>
|
||||||
@ -224,31 +179,6 @@ import { formatDate } from '../../utils/date';
|
|||||||
ref="pickerRef" />
|
ref="pickerRef" />
|
||||||
</van-popup>
|
</van-popup>
|
||||||
|
|
||||||
<!-- 面料选择框-->
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<van-calendar v-model:show="show" @confirm="onConfirmDate" :min-date="new Date(2010, 0, 1)"
|
<van-calendar v-model:show="show" @confirm="onConfirmDate" :min-date="new Date(2010, 0, 1)"
|
||||||
:max-date="new Date(2050, 0, 31)" />
|
:max-date="new Date(2050, 0, 31)" />
|
||||||
</template>
|
</template>
|
||||||
@ -267,15 +197,15 @@ import { formatDate } from '../../utils/date';
|
|||||||
|
|
||||||
.grid-container {
|
.grid-container {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 2fr 3fr 1.3fr 1.5fr;
|
grid-template-columns: 1.5fr 2fr 1fr 1.5fr;
|
||||||
padding: 0 15rpx;
|
padding: 0 15rpx;
|
||||||
|
|
||||||
.grid-item {
|
.grid-item {
|
||||||
border: 1px solid #f2f2f2;
|
border: 1px solid #f2f2f2;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
height: 50rpx;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,154 +1,151 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from 'vue'
|
import { onMounted, ref } from 'vue'
|
||||||
import { getAction, putAction } from '../../common/http';
|
import { getAction, putAction } from '../../common/http';
|
||||||
import { showToast } from 'vant';
|
import { showToast } from 'vant';
|
||||||
|
|
||||||
const list = ref([] as any[])
|
const list = ref([] as any[])
|
||||||
|
|
||||||
onMounted(()=>{
|
onMounted(() => {
|
||||||
init()
|
init()
|
||||||
})
|
|
||||||
function init(){
|
|
||||||
getAction('/extraOption').then((res:any)=>{
|
|
||||||
if(res.code===200){
|
|
||||||
list.value=JSON.parse(res.data.payload)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
function init() {
|
||||||
const onClickLeft = () =>{
|
getAction('/extraOption').then((res : any) => {
|
||||||
history.back()
|
if (res.code === 200) {
|
||||||
}
|
list.value = JSON.parse(res.data.payload)
|
||||||
const onClickRight=()=>{
|
}
|
||||||
list.value.push({options:[{}]})
|
})
|
||||||
}
|
|
||||||
//新增选项
|
|
||||||
const addxx = (item:any) =>{
|
|
||||||
item.options.push({})
|
|
||||||
}
|
|
||||||
const onSubmit = () =>{
|
|
||||||
let param={
|
|
||||||
id:1,
|
|
||||||
payload:JSON.stringify(list.value)
|
|
||||||
}
|
}
|
||||||
putAction('/extraOption',param).then((res:any)=>{
|
const onClickLeft = () => {
|
||||||
if(res.code===200){
|
history.back()
|
||||||
showToast('提交成功!')
|
}
|
||||||
init()
|
const onClickRight = () => {
|
||||||
|
list.value.push({ options: [{}] })
|
||||||
|
}
|
||||||
|
//新增选项
|
||||||
|
const addxx = (item : any) => {
|
||||||
|
item.options.push({})
|
||||||
|
}
|
||||||
|
const onSubmit = () => {
|
||||||
|
let param = {
|
||||||
|
id: 1,
|
||||||
|
payload: JSON.stringify(list.value)
|
||||||
}
|
}
|
||||||
})
|
putAction('/extraOption', param).then((res : any) => {
|
||||||
}
|
if (res.code === 200) {
|
||||||
|
showToast('提交成功!')
|
||||||
|
init()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<van-nav-bar
|
<van-nav-bar title="其他要求项维护" left-text="返回" left-arrow right-text="新增" @click-left="onClickLeft"
|
||||||
title="其他要求项维护"
|
@click-right="onClickRight" />
|
||||||
left-text="返回"
|
<view class="content">
|
||||||
left-arrow
|
<view class="card" v-for="(item,index) in list" :key="index">
|
||||||
right-text="新增"
|
<van-cell-group inset>
|
||||||
@click-left="onClickLeft"
|
<view class="a-b">
|
||||||
@click-right="onClickRight"
|
<van-icon name="clear" color="red" size="25" @click="list.splice(index,1)" />
|
||||||
/>
|
<van-field v-model="item.name" name="要求项名称" label="要求项名称" colon class="a-c" label-width="6em"
|
||||||
<view class="content">
|
:rules="[{ required: true, message: '请填写' }]" />
|
||||||
<view class="card" v-for="(item,index) in list" :key="index">
|
<van-button type="primary" @click="addxx(item)">新增选项</van-button>
|
||||||
<van-cell-group inset>
|
</view>
|
||||||
<view class="a-b">
|
<van-field name="是否必填" label="是否必填" colon label-width="7.5em">
|
||||||
<van-icon name="clear" color="red" size="25" @click="list.splice(index,1)"/>
|
<template #input>
|
||||||
<van-field
|
<van-radio-group v-model="item.necessary" direction="horizontal">
|
||||||
v-model="item.name"
|
<van-radio :name="true">是</van-radio>
|
||||||
name="要求项名称"
|
<van-radio :name="false">否</van-radio>
|
||||||
label="要求项名称"
|
</van-radio-group>
|
||||||
colon
|
</template>
|
||||||
class="a-c"
|
</van-field>
|
||||||
label-width="6em"
|
</van-cell-group>
|
||||||
:rules="[{ required: true, message: '请填写' }]"
|
<view class="grid-container">
|
||||||
/>
|
<view class="grid-item"></view>
|
||||||
<van-button type="primary" @click="addxx(item)">新增选项</van-button>
|
<view class="grid-item">内容</view>
|
||||||
</view>
|
<view class="grid-item">是否默认</view>
|
||||||
<van-field name="是否必填" label="是否必填" colon label-width="7.5em">
|
<view class="grid-item">操作</view>
|
||||||
<template #input>
|
</view>
|
||||||
<van-radio-group v-model="item.necessary" direction="horizontal">
|
<view class="grid-container" v-for="(itemSecond,indexSecond) in item.options" :key="indexSecond">
|
||||||
<van-radio :name="true">是</van-radio>
|
<view class="grid-item">选项</view>
|
||||||
<van-radio :name="false">否</van-radio>
|
<view class="grid-item"> <van-field v-model="itemSecond.name" /></view>
|
||||||
</van-radio-group>
|
<view class="grid-item" style="display: flex;align-items: center;justify-content: center">
|
||||||
</template>
|
<van-checkbox v-model="itemSecond.default" :name="true"></van-checkbox>
|
||||||
</van-field>
|
</view>
|
||||||
</van-cell-group>
|
<view class="grid-item" style="color: red" @click="item.options.splice(indexSecond,1)">删除</view>
|
||||||
<view class="grid-container">
|
</view>
|
||||||
<view class="grid-item"></view>
|
</view>
|
||||||
<view class="grid-item">内容</view>
|
</view>
|
||||||
<view class="grid-item">是否默认</view>
|
<van-button type="primary" style="margin: 10rpx;" @click="onSubmit">提交</van-button>
|
||||||
<view class="grid-item">操作</view>
|
</view>
|
||||||
</view>
|
|
||||||
<view class="grid-container" v-for="(itemSecond,indexSecond) in item.options" :key="indexSecond">
|
|
||||||
<view class="grid-item">选项</view>
|
|
||||||
<view class="grid-item"> <van-field v-model="itemSecond.name" /></view>
|
|
||||||
<view class="grid-item" style="display: flex;align-items: center;justify-content: center">
|
|
||||||
<van-checkbox-group v-model="itemSecond.default">
|
|
||||||
<van-checkbox :name="true"></van-checkbox>
|
|
||||||
</van-checkbox-group></view>
|
|
||||||
<view class="grid-item" style="color: red" @click="item.options.splice(indexSecond,1)">删除</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<van-button type="primary" style="margin: 10rpx;" @click="onSubmit">提交</van-button>
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.flex{
|
.flex {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
.van-nav-bar{
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.content{
|
|
||||||
flex: 1;
|
|
||||||
padding: 0 20rpx;
|
|
||||||
.grid-container {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 2fr 1.5fr 1.5fr;
|
|
||||||
.grid-item{
|
|
||||||
border: 1rpx solid #f2f2f2;
|
|
||||||
text-align: center;
|
|
||||||
::v-deep .van-cell{
|
|
||||||
padding: 0 10rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.card{
|
|
||||||
margin: 16rpx 20rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
border: 1rpx solid #02a7f0;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
}
|
|
||||||
.a-b{
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
::v-deep .van-button--normal {
|
|
||||||
padding: 8rpx;
|
|
||||||
height: 50rpx;
|
|
||||||
width: 7em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
::v-deep .van-field{
|
|
||||||
font-size: 16px;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
::v-deep .van-cell-group--inset{
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.a-c{
|
|
||||||
::v-deep .van-field__control{
|
|
||||||
border-bottom: 1rpx solid #d7d7d7;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .van-field__label{
|
.van-nav-bar {
|
||||||
text-align: end;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
.content {
|
||||||
|
flex: 1;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
|
||||||
|
.grid-container {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 2fr 1.5fr 1.5fr;
|
||||||
|
|
||||||
|
.grid-item {
|
||||||
|
border: 1rpx solid #f2f2f2;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
::v-deep .van-cell {
|
||||||
|
padding: 0 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
margin: 16rpx 20rpx;
|
||||||
|
padding: 10rpx;
|
||||||
|
border: 1rpx solid #02a7f0;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.a-b {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
::v-deep .van-button--normal {
|
||||||
|
padding: 8rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
width: 7em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .van-field {
|
||||||
|
font-size: 16px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .van-cell-group--inset {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.a-c {
|
||||||
|
::v-deep .van-field__control {
|
||||||
|
border-bottom: 1rpx solid #d7d7d7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .van-field__label {
|
||||||
|
text-align: end;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue
Block a user