现货单
This commit is contained in:
parent
5f7a8c8922
commit
facb66b99b
@ -2,8 +2,8 @@ export default {
|
||||
|
||||
//正式接口
|
||||
base_scm:'http://192.168.1.222:7002',
|
||||
base_auth:'https://cloud.goodsilk.cn/auth',//登录
|
||||
base_mes:'https://cloud.goodsilk.cn/mes',//面料
|
||||
base_auth:'http://192.168.1.2:7000',//登录
|
||||
base_mes:'http://120.26.196.222:8981',//面料
|
||||
base_process:'http://120.26.196.222:8981',//工艺
|
||||
|
||||
|
||||
|
@ -20,9 +20,9 @@ function httpRequest(url : string, method : any, data = {}, headerCustom = {}) {
|
||||
// 合并请求头
|
||||
const finalHeader = Object.assign({}, header, headerCustom);
|
||||
let base_url=''
|
||||
if(url==='/v1/auth/login'){
|
||||
if(url.includes('/v1')){
|
||||
base_url=myconfig.base_auth
|
||||
}else if(url==='/fabric/info/all'){
|
||||
}else if(url==='/fabric/info/all'||url==='/color/list'){
|
||||
base_url=myconfig.base_mes
|
||||
}else if(url.includes('fabric/craft')){
|
||||
base_url=myconfig.base_process
|
||||
@ -43,6 +43,10 @@ function httpRequest(url : string, method : any, data = {}, headerCustom = {}) {
|
||||
icon:'error',
|
||||
title:'登录过期!'
|
||||
})
|
||||
uni.clearStorage()
|
||||
uni.reLaunch({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
reject(new Error('请求失败: ' + (res.data && res.data?.message || '未知错误')));
|
||||
}else {
|
||||
uni.showToast({
|
||||
|
18
pages.json
18
pages.json
@ -233,17 +233,27 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/tailorMade/tailorMade",
|
||||
"path" : "pages/customOrder/customOrder",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : ""
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": false,
|
||||
"disableScroll": true,
|
||||
"app-plus": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/tailorMade/list",
|
||||
"path" : "pages/customOrder/list",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : ""
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": false,
|
||||
"disableScroll": true,
|
||||
"app-plus": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -6,7 +6,18 @@
|
||||
|
||||
const showDialog = ref(false)
|
||||
const formList = ref([] as any[])
|
||||
const otherList = ref([] as any[])
|
||||
onMounted(() => {
|
||||
uni.getStorage({
|
||||
key: 'info',
|
||||
success(res) {
|
||||
let data = JSON.parse(res.data)
|
||||
form.value.supplier = data.userName
|
||||
},
|
||||
fail: (err : any) => {
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
getAction('/fabric/craft/info').then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
formList.value = res.data
|
||||
@ -37,6 +48,17 @@
|
||||
})
|
||||
}
|
||||
})
|
||||
getAction('/color/list').then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
|
||||
}
|
||||
})
|
||||
getAction('/extraOption').then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
otherList.value = JSON.parse(res.data.payload)
|
||||
console.log(otherList.value);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
const onClickLeft = () => {
|
||||
@ -172,33 +194,73 @@
|
||||
<view class="content">
|
||||
<van-form @submit="onSubmit">
|
||||
<van-cell-group inset>
|
||||
<van-field v-model="form.createTime" name="做单日期" label="做单日期" colon class="bor" label-width="5em"
|
||||
<van-field v-model="form.createTime" name="客户名称" label="客户名称" colon class="bor" label-width="5em"
|
||||
readonly :rules="[{ required: true, message: '请填写' }]" @click="chooseDate()" />
|
||||
<van-field v-model="form.createTime" name="做单日期" label="做单日期" colon label-width="5em" readonly
|
||||
:rules="[{ required: true, message: '请填写' }]" class="bor-n" />
|
||||
<van-field v-model="form.supplier" name="订单归属" label="订单归属" colon label-width="5em"
|
||||
:rules="[{ required: true, message: '请填写' }]" />
|
||||
<van-field v-model="form.fabricName" name="颜色色号" label="颜色色号" colon
|
||||
<van-field v-model="form.supplier" name="做单人员" label="做单人员" colon label-width="5em"
|
||||
:rules="[{ required: true, message: '请填写' }]" readonly class="bor-n" />
|
||||
<van-field v-model="form.fabricName" name="谁定" label="谁定" colon
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" />
|
||||
<van-field v-model="form.fabricName" name="工艺" label="工艺" colon
|
||||
<van-field v-model="form.fabricName" name="是否含税" label="是否含税" colon
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor"
|
||||
@click="choosePic('')" />
|
||||
<view class="a-b">
|
||||
<van-button type="primary" @click="showDialog=true">面料添加</van-button>
|
||||
</view>
|
||||
<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="card">
|
||||
<view style="text-align: end;">
|
||||
<van-icon name="cross" />
|
||||
</view>
|
||||
<van-field v-model="form.fabricName" name="颜色色号" label="颜色色号" colon
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" />
|
||||
<van-field v-model="form.fabricName" name="工艺名称" label="工艺名称" colon
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor"
|
||||
@click="choosePic('')" />
|
||||
<view v-for="(item,index) in form.processes" :key="index">
|
||||
<view class="a-c">
|
||||
<van-icon name="add" color="red" size="25" v-if="index===0"
|
||||
@click="form.processes.push({})" />
|
||||
<van-icon name="clear" color="red" size="25" v-if="index!=0"
|
||||
@click="form.processes.splice(index,1)" />
|
||||
<van-field v-model="form.ml" name="面料名称" label="面料名称" colon readonly label-width="5em"
|
||||
@click="selectChoose" class="bor" />
|
||||
</view>
|
||||
<van-field v-model="item.ml" name="需求米数" label="需求米数" type="number" colon
|
||||
label-width="6.5em" />
|
||||
<van-field v-model="item.ml" name="需求匹数" label="需求匹数" colon label-width="6.5em" readonly />
|
||||
</view>
|
||||
<van-field v-model="form.fabricName" name="订单单价" label="订单单价" colon
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" />
|
||||
<van-field v-model="form.fabricName" name="工艺要求" label="工艺要求" colon
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor"
|
||||
@click="choosePic('')" />
|
||||
<van-field v-model="form.fabricName" name="有效门幅" label="有效门幅" colon label-width="5em" />
|
||||
<van-field v-model="form.fabricName" name="全门幅" label="全门幅" colon label-width="5em" />
|
||||
<p>其他要求</p>
|
||||
<view v-for="(item,index) in otherList" :key="index">
|
||||
<van-field v-model="form.fabricName" :name="item.name" :label="item.name" colon
|
||||
:rules="item.necessary?[{ required: true, message: '请填写' }]:[]" label-width="5em"
|
||||
readonly class="bor" @click="choosePic('')" />
|
||||
</view>
|
||||
<p style="text-align: center;margin: 10rpx 0;color: #02a7f0;">复制新增</p>
|
||||
</view>
|
||||
<view class="grid-container" v-for="(item,index) in form.processes" :key=index>
|
||||
<view class="grid-item">{{item.ml}}</view>
|
||||
<view class="grid-item">匹数</view>
|
||||
<view class="grid-item">库存</view>
|
||||
<view class="grid-item">谁定</view>
|
||||
<view class="grid-item">操作</view>
|
||||
</view>
|
||||
<van-field v-model="form.fabricName" name="备注" label="备注" colon label-width="5em" />
|
||||
|
||||
<van-field v-model="form.supplier" name="总米数" label="总米数" colon label-width="5em"
|
||||
:rules="[{ required: true, message: '请填写' }]" readonly class="bor-n" />
|
||||
<van-field v-model="form.supplier" name="总匹数" label="总匹数" colon label-width="5em"
|
||||
:rules="[{ required: true, message: '请填写' }]" readonly class="bor-n" />
|
||||
<van-field v-model="form.supplier" name="订单总额" label="订单总额" colon label-width="5em"
|
||||
:rules="[{ required: true, message: '请填写' }]" readonly class="bor-n" />
|
||||
<van-field v-model="form.supplier" name="交货日期" label="交货日期" colon label-width="5em"
|
||||
:rules="[{ required: true, message: '请填写' }]" readonly class="bor" @click="chooseDate()" />
|
||||
<van-field v-model="form.supplier" name="客户备注" label="客户备注" colon label-width="5em"
|
||||
:rules="[{ required: true, message: '请填写' }]" readonly class="bor-n" />
|
||||
<van-field v-model="form.supplier" name="内部备注" label="内部备注" colon label-width="5em"
|
||||
:rules="[{ required: true, message: '请填写' }]" readonly class="bor-n"/>
|
||||
</van-cell-group>
|
||||
<view style="margin: 16px;">
|
||||
<van-button round block type="primary" native-type="submit">
|
||||
@ -209,37 +271,6 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<van-dialog v-model:show="showDialog">
|
||||
<view>
|
||||
<van-cell-group inset>
|
||||
<view v-for="(item,index) in form.processes" :key="index">
|
||||
<view class="a-c">
|
||||
<van-icon name="add" color="red" size="25" v-if="index===0" @click="form.processes.push({})" />
|
||||
<van-icon name="clear" color="red" size="25" v-if="index!=0"
|
||||
@click="form.processes.splice(index,1)" />
|
||||
<van-field v-model="form.ml" name="面料名称" label="面料名称" colon readonly label-width="5em"
|
||||
@click="selectChoose" class="bor"/>
|
||||
</view>
|
||||
<van-field v-model="item.ml" name="需求匹数" label="需求匹数" type="number" colon label-width="6.5em" />
|
||||
<van-field v-model="item.ml" name="库存匹数" label="库存匹数" colon label-width="6.5em" readonly/>
|
||||
<van-field v-model="form.ml" name="谁定" label="谁定" colon readonly label-width="6.5em" @click="choosePic" class="bor" />
|
||||
</view>
|
||||
</van-cell-group>
|
||||
</view>
|
||||
<template #footer>
|
||||
<view class="footer-button">
|
||||
<van-button plain size="small" native-type="button" style="width: 25vw;" @click="showDialog=false">
|
||||
取消
|
||||
</van-button>
|
||||
<van-button size="small" type="success" native-type="submit" style="width: 25vw;"
|
||||
@click="confirmSecond">
|
||||
确认
|
||||
</van-button>
|
||||
</view>
|
||||
</template>
|
||||
</van-dialog>
|
||||
|
||||
|
||||
<van-calendar v-model:show="show" @confirm="onConfirmDate" :min-date="new Date(2010, 0, 1)"
|
||||
:max-date="new Date(2050, 0, 31)" />
|
||||
|
||||
@ -281,6 +312,7 @@
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
overflow-y: hidden;
|
||||
|
||||
.van-nav-bar {
|
||||
width: 100%;
|
||||
@ -289,23 +321,16 @@
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 0 10px;
|
||||
|
||||
.grid-container {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr 1.5fr 1fr 1fr;
|
||||
|
||||
.grid-item {
|
||||
border: 1px solid #f2f2f2;
|
||||
text-align: center;
|
||||
|
||||
::v-deep .van-cell {
|
||||
padding: 0 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
overflow-y: scroll;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
border: 1rpx solid #d7d7d7;
|
||||
border-radius: 5rpx;
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
.footer-button {
|
||||
margin: 20px;
|
||||
display: flex;
|
||||
@ -342,6 +367,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
.bor-n {
|
||||
::v-deep .van-field__control {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .van-field__control {
|
||||
border-bottom: 1px solid #d7d7d7;
|
||||
text-align: center;
|
@ -39,7 +39,7 @@ import { formatDate } from '../../utils/date';
|
||||
}
|
||||
const onClickRight = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/spot/spot'
|
||||
url: '/pages/customOrder/customOrder'
|
||||
})
|
||||
}
|
||||
|
||||
@ -183,7 +183,7 @@ import { formatDate } from '../../utils/date';
|
||||
|
||||
<template>
|
||||
<view class="flex">
|
||||
<van-nav-bar title="需求单列表" left-text="返回" left-arrow right-text="新增需求单" @click-left="onClickLeft"
|
||||
<van-nav-bar title="定做单列表" left-text="返回" left-arrow right-text="新增" @click-left="onClickLeft"
|
||||
@click-right="onClickRight()" />
|
||||
<van-cell-group inset style="display: flex;">
|
||||
<van-field v-model="form.startDate" name="开始时间" label="开始时间" colon class="bor" label-width="5em" readonly
|
||||
@ -259,6 +259,7 @@ import { formatDate } from '../../utils/date';
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
overflow-y: hidden;
|
||||
|
||||
.van-nav-bar {
|
||||
width: 100%;
|
||||
@ -280,6 +281,7 @@ import { formatDate } from '../../utils/date';
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
}
|
||||
|
@ -83,6 +83,11 @@ const ListData =ref([
|
||||
name:'需求单列表',
|
||||
type:'',
|
||||
},
|
||||
{
|
||||
path:'../customOrder/list',
|
||||
name:'定做单列表',
|
||||
type:'',
|
||||
},
|
||||
] as any[])
|
||||
|
||||
|
||||
|
@ -1,89 +1,85 @@
|
||||
<template>
|
||||
<div style="margin-top: 30vh">
|
||||
<van-form @submit="onSubmit">
|
||||
<van-cell-group inset>
|
||||
<van-field
|
||||
style="font-size: 16px"
|
||||
v-model="username"
|
||||
name="用户名"
|
||||
label="用户名"
|
||||
placeholder="用户名"
|
||||
:rules="[{ required: true, message: '请填写用户名' }]"
|
||||
/>
|
||||
<van-field
|
||||
style="font-size: 16px"
|
||||
v-model="password"
|
||||
type="password"
|
||||
name="密码"
|
||||
label="密码"
|
||||
placeholder="密码"
|
||||
:rules="[{ required: true, message: '请填写密码' }]"
|
||||
/>
|
||||
</van-cell-group>
|
||||
<div style="margin: 16px;">
|
||||
<van-button round block type="primary" native-type="submit">
|
||||
登录
|
||||
</van-button>
|
||||
</div>
|
||||
</van-form>
|
||||
</div>
|
||||
<div style="margin-top: 30vh">
|
||||
<van-form @submit="onSubmit">
|
||||
<van-cell-group inset>
|
||||
<van-field style="font-size: 16px" v-model="username" name="用户名" label="用户名" placeholder="用户名"
|
||||
:rules="[{ required: true, message: '请填写用户名' }]" />
|
||||
<van-field style="font-size: 16px" v-model="password" type="password" name="密码" label="密码"
|
||||
placeholder="密码" :rules="[{ required: true, message: '请填写密码' }]" />
|
||||
</van-cell-group>
|
||||
<div style="margin: 16px;">
|
||||
<van-button round block type="primary" native-type="submit">
|
||||
登录
|
||||
</van-button>
|
||||
</div>
|
||||
</van-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref,onMounted } from "vue";
|
||||
import { showFailToast, showSuccessToast } from "vant";
|
||||
import { postAction } from "../../common/http";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { showFailToast, showSuccessToast } from "vant";
|
||||
import { getAction, postAction } from "../../common/http";
|
||||
|
||||
onMounted(()=>{
|
||||
})
|
||||
//手机
|
||||
const username = ref('');
|
||||
const password = ref('');
|
||||
const onSubmit = () => {
|
||||
let data={
|
||||
'username':username.value,
|
||||
'password':password.value,
|
||||
}
|
||||
postAction('/v1/auth/login',data,{'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}).then((res:any) => {
|
||||
if (res.code === 200) {
|
||||
const token = res.data;
|
||||
localStorage.setItem("token", token);
|
||||
showSuccessToast('登录成功!')
|
||||
setTimeout(()=>{
|
||||
uni.reLaunch({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
},500)
|
||||
} else {
|
||||
showFailToast(res.msg)
|
||||
}
|
||||
})
|
||||
};
|
||||
onMounted(() => {
|
||||
})
|
||||
//手机
|
||||
const username = ref('');
|
||||
const password = ref('');
|
||||
const onSubmit = () => {
|
||||
let data = {
|
||||
'username': username.value,
|
||||
'password': password.value,
|
||||
}
|
||||
postAction('/v1/auth/login', data, { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' }).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
const token = res.data;
|
||||
localStorage.setItem("token", token);
|
||||
showSuccessToast('登录成功!')
|
||||
getAction('/v1/auth/info').then((res1 : any) => {
|
||||
if (res1.code === 200) {
|
||||
localStorage.setItem("info", JSON.stringify(res1.data));
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}, 500)
|
||||
} else {
|
||||
showFailToast(res.msg)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
showFailToast(res.msg)
|
||||
}
|
||||
})
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.login-box {
|
||||
width: 100vm;
|
||||
height: 100vh;
|
||||
background: url(../assets/loginBackground.png);
|
||||
text-align: center;
|
||||
background-size: cover;
|
||||
overflow: hidden;
|
||||
.login-form {
|
||||
width: 500px;
|
||||
margin: 200px auto;
|
||||
background-color: #ffffff;
|
||||
padding: 30px;
|
||||
border-radius: 20px;
|
||||
.login-box {
|
||||
width: 100vm;
|
||||
height: 100vh;
|
||||
background: url(../assets/loginBackground.png);
|
||||
text-align: center;
|
||||
background-size: cover;
|
||||
overflow: hidden;
|
||||
|
||||
.login-button {
|
||||
width: 33%;
|
||||
margin-left: 26%;
|
||||
margin-right: 33%;
|
||||
}
|
||||
h2 {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.login-form {
|
||||
width: 500px;
|
||||
margin: 200px auto;
|
||||
background-color: #ffffff;
|
||||
padding: 30px;
|
||||
border-radius: 20px;
|
||||
|
||||
.login-button {
|
||||
width: 33%;
|
||||
margin-left: 26%;
|
||||
margin-right: 33%;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,278 +1,62 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { formatDate } from '../../utils/date';
|
||||
import { getAction } from '../../common/http';
|
||||
import { showToast } from 'vant';
|
||||
import { ref } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
|
||||
const showDialog = ref(false)
|
||||
const formList = ref([] as any[])
|
||||
onMounted(() => {
|
||||
getAction('/fabric/craft/info').then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
formList.value = res.data
|
||||
}
|
||||
})
|
||||
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 }] }]
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
onLoad((option : any) => {
|
||||
form.value = JSON.parse(option.item)
|
||||
})
|
||||
|
||||
const onClickLeft = () => {
|
||||
history.back()
|
||||
}
|
||||
|
||||
//弹窗提交
|
||||
const confirmSecond = () => {
|
||||
|
||||
}
|
||||
const onSubmit = () => {
|
||||
|
||||
}
|
||||
|
||||
const form = ref({ processes: [{}] } 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 choosePic = (type : any) => {
|
||||
showPicker.value = true
|
||||
typeData.value = type
|
||||
}
|
||||
//选择框确认
|
||||
const pickerConfirm = (val : any) => {
|
||||
if (typeData.value === 'level') {
|
||||
} else {
|
||||
form.value[typeData.value] = val.selectedValues[0]
|
||||
}
|
||||
showPickerCancel()
|
||||
}
|
||||
//取消
|
||||
const showPickerCancel = () => {
|
||||
showPicker.value = false
|
||||
}
|
||||
//弹窗开启事件
|
||||
const handleOpen = () => {
|
||||
if (typeData.value === 'supplier') {
|
||||
popuList.value = []
|
||||
} else if (typeData.value === 'level') {
|
||||
popuList.value = []
|
||||
}
|
||||
}
|
||||
const chooseDate = () => {
|
||||
show.value = true
|
||||
}
|
||||
//日期选择
|
||||
const onConfirmDate = (val : any) => {
|
||||
form.value.createTime = formatDate(val)
|
||||
show.value = false
|
||||
}
|
||||
|
||||
//选择面料
|
||||
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.fabricName = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1]
|
||||
pickerCancel()
|
||||
}
|
||||
const form = ref({} as any)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="flex">
|
||||
<van-nav-bar title="现货需求单" left-text="返回" left-arrow @click-left="onClickLeft" />
|
||||
<view class="content">
|
||||
<van-form @submit="onSubmit">
|
||||
<van-cell-group inset>
|
||||
<van-field v-model="form.createTime" name="做单日期" label="做单日期" colon class="bor" label-width="5em"
|
||||
readonly :rules="[{ required: true, message: '请填写' }]" @click="chooseDate()" />
|
||||
<van-field v-model="form.supplier" name="订单归属" label="订单归属" colon label-width="5em"
|
||||
:rules="[{ required: true, message: '请填写' }]" />
|
||||
<van-field v-model="form.fabricName" name="颜色色号" label="颜色色号" colon
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" />
|
||||
<van-field v-model="form.fabricName" name="工艺" label="工艺" colon
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor"
|
||||
@click="choosePic('')" />
|
||||
<view class="a-b">
|
||||
<van-button type="primary" @click="showDialog=true">面料添加</van-button>
|
||||
</view>
|
||||
<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>
|
||||
<view class="grid-container" v-for="(item,index) in form.processes" :key=index>
|
||||
<view class="grid-item">{{item.ml}}</view>
|
||||
<view class="grid-item">匹数</view>
|
||||
<view class="grid-item">库存</view>
|
||||
<view class="grid-item">谁定</view>
|
||||
<view class="grid-item">操作</view>
|
||||
</view>
|
||||
<van-field v-model="form.fabricName" name="备注" label="备注" colon label-width="5em" />
|
||||
</van-cell-group>
|
||||
<view style="margin: 16px;">
|
||||
<van-button round block type="primary" native-type="submit">
|
||||
提交
|
||||
</van-button>
|
||||
</view>
|
||||
</van-form>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<van-dialog v-model:show="showDialog">
|
||||
<view>
|
||||
<van-cell-group inset>
|
||||
<view v-for="(item,index) in form.processes" :key="index">
|
||||
<view class="a-c">
|
||||
<van-icon name="add" color="red" size="25" v-if="index===0" @click="form.processes.push({})" />
|
||||
<van-icon name="clear" color="red" size="25" v-if="index!=0"
|
||||
@click="form.processes.splice(index,1)" />
|
||||
<van-field v-model="form.ml" name="面料名称" label="面料名称" colon readonly label-width="5em"
|
||||
@click="selectChoose" class="bor"/>
|
||||
</view>
|
||||
<van-field v-model="item.ml" name="需求匹数" label="需求匹数" type="number" colon label-width="6.5em" />
|
||||
<van-field v-model="item.ml" name="库存匹数" label="库存匹数" colon label-width="6.5em" readonly/>
|
||||
<van-field v-model="form.ml" name="谁定" label="谁定" colon readonly label-width="6.5em" @click="choosePic" class="bor" />
|
||||
<van-field v-model="form.orderNo" name="需求单号" label="需求单号" colon label-width="5em" readonly />
|
||||
<van-field v-model="form.orderTime" name="做单日期" label="做单日期" colon class="bor" label-width="5em"
|
||||
readonly />
|
||||
<van-field v-model="form.createUser" name="做单人" label="做单人" colon label-width="5em" readonly />
|
||||
<van-field v-model="form.color" name="颜色色号" label="颜色色号" colon readonly label-width="5em" />
|
||||
<van-field v-model="form.craft" name="工艺" label="工艺" colon readonly label-width="5em" class="bor" />
|
||||
<view class="a-b">
|
||||
<van-button type="primary">面料添加</van-button>
|
||||
</view>
|
||||
<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>
|
||||
<view class="grid-container" v-for="(item,index) in form.fabrics" :key="index">
|
||||
<view class="grid-item">{{item.name}}</view>
|
||||
<view class="grid-item">
|
||||
<van-field v-model="item.quantity" class="bor" type="number" />
|
||||
</view>
|
||||
<view class="grid-item">{{item.storageQuantity}}</view>
|
||||
<view class="grid-item">{{item.belongTo}}</view>
|
||||
<view class="grid-item" style="color: red;" @click="form.fabrics.splice(index,1)">删除</view>
|
||||
</view>
|
||||
<van-field v-model="form.comment" name="备注" label="备注" colon label-width="5em" readonly/>
|
||||
</van-cell-group>
|
||||
</view>
|
||||
<template #footer>
|
||||
<view class="footer-button">
|
||||
<van-button plain size="small" native-type="button" style="width: 25vw;" @click="showDialog=false">
|
||||
<view style="margin: 16px;display: flex;align-items: center;justify-content: space-between;">
|
||||
<van-button round block type="danger">
|
||||
取消
|
||||
</van-button>
|
||||
<van-button size="small" type="success" native-type="submit" style="width: 25vw;"
|
||||
@click="confirmSecond">
|
||||
确认
|
||||
|
||||
<van-button round block type="primary">
|
||||
提交
|
||||
</van-button>
|
||||
</view>
|
||||
</template>
|
||||
</van-dialog>
|
||||
|
||||
|
||||
<van-calendar v-model:show="show" @confirm="onConfirmDate" :min-date="new Date(2010, 0, 1)"
|
||||
:max-date="new Date(2050, 0, 31)" />
|
||||
|
||||
<!--选择框-->
|
||||
<van-popup v-model:show="showPicker" round position="bottom" @open="handleOpen">
|
||||
<van-picker show-toolbar :columns="popuList" @confirm="pickerConfirm" @cancel="showPickerCancel"
|
||||
ref="pickerRef" />
|
||||
</van-popup>
|
||||
|
||||
<!-- 面料选择框-->
|
||||
<van-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>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -292,11 +76,12 @@
|
||||
|
||||
.grid-container {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr 1.5fr 1fr 1fr;
|
||||
grid-template-columns: 2fr 1fr 1fr 2fr 1fr;
|
||||
|
||||
.grid-item {
|
||||
border: 1px solid #f2f2f2;
|
||||
text-align: center;
|
||||
padding: 15rpx 0;
|
||||
|
||||
::v-deep .van-cell {
|
||||
padding: 0 5px;
|
||||
|
@ -1,11 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import { showToast } from 'vant';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { getAction } from '../../common/http';
|
||||
import { formatDate } from '../../utils/date';
|
||||
import { formatDate } from '../../utils/date';
|
||||
|
||||
const form = ref({} as any)
|
||||
const list = ref([] as any[])
|
||||
const colorList = ref([] as any[])
|
||||
const nameList = ref([] as any[])
|
||||
const status = ref()
|
||||
onMounted(() => {
|
||||
getAction('/fabric/info/all').then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
@ -32,6 +35,17 @@ import { formatDate } from '../../utils/date';
|
||||
})
|
||||
}
|
||||
})
|
||||
getAction('/color/list').then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
colorList.value = res.data.map((l : any) => ({ value: l.colorCode + l.colorName, text: l.colorCode + l.colorName }))
|
||||
}
|
||||
})
|
||||
getAction('/v1/user/getNames').then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
nameList.value = res.data.map((l : any) => ({ value: l, text: l }))
|
||||
}
|
||||
})
|
||||
init()
|
||||
})
|
||||
|
||||
const onClickLeft = () => {
|
||||
@ -43,6 +57,10 @@ import { formatDate } from '../../utils/date';
|
||||
})
|
||||
}
|
||||
|
||||
watch(form.value, () => {
|
||||
list.value = []
|
||||
init()
|
||||
})
|
||||
|
||||
const total = ref(0)
|
||||
const currentPage = ref(1)
|
||||
@ -60,7 +78,16 @@ import { formatDate } from '../../utils/date';
|
||||
};
|
||||
|
||||
function init() {
|
||||
|
||||
getAction('/order/internal', { page: currentPage.value, size: 10, ...form.value }).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
res.data.record.forEach((l : any) => {
|
||||
list.value.push(l)
|
||||
})
|
||||
total.value = res.data.total
|
||||
loading.value = false;
|
||||
finished.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -139,7 +166,7 @@ import { formatDate } from '../../utils/date';
|
||||
form.value.category = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1]
|
||||
pickerCancel()
|
||||
}
|
||||
|
||||
|
||||
const showPicker = ref(false)
|
||||
const typeData = ref()
|
||||
const popuList = ref([] as any[])
|
||||
@ -150,22 +177,43 @@ import { formatDate } from '../../utils/date';
|
||||
}
|
||||
//选择框确认
|
||||
const pickerConfirm = (val : any) => {
|
||||
if (typeData.value === 'level') {
|
||||
if (typeData.value === 'status') {
|
||||
status.value = val.selectedOptions[0].text
|
||||
form.value[typeData.value] = val.selectedOptions[0].value
|
||||
} else {
|
||||
form.value[typeData.value] = val.selectedValues[0]
|
||||
}
|
||||
showPickerCancel()
|
||||
showPicker.value = false
|
||||
}
|
||||
//取消
|
||||
const showPickerCancel = () => {
|
||||
showPicker.value = false
|
||||
form.value[typeData.value] = ''
|
||||
}
|
||||
//弹窗开启事件
|
||||
const handleOpen = () => {
|
||||
if (typeData.value === 'supplier') {
|
||||
popuList.value = []
|
||||
} else if (typeData.value === 'level') {
|
||||
popuList.value = []
|
||||
if (typeData.value === 'color') {
|
||||
popuList.value = colorList.value
|
||||
} else if (typeData.value === 'status') {
|
||||
popuList.value = [
|
||||
{ text: "待审核", value: "UnCheck" },
|
||||
{ text: "待主管审核", value: "UnCheckByLeader" },
|
||||
{ text: "待跟单员审核", value: "UnCheckByCharger", },
|
||||
{ text: "已通过(待配货)", value: "Checked" },
|
||||
{ text: "取消审核中", value: "Canceling" },
|
||||
{ text: "已取消", value: "Canceled" },
|
||||
{ text: "被驳回", value: "Rejected" },
|
||||
{ text: "部分配货", value: "Allocating" },
|
||||
{ text: "已配完(待进厂)", value: "Allocated", },
|
||||
{ text: "已进厂", value: "Processing" },
|
||||
{ text: "已出厂(待收货)", value: "Processed", },
|
||||
{ text: "待质检", value: "UnTested" },
|
||||
{ text: "已质检(待入库)", value: "Testing" },
|
||||
{ text: "已质检(待入库)", value: "Tested" },
|
||||
{ text: "已入库", value: "Storage", },
|
||||
]
|
||||
} else if (typeData.value === 'orderUser') {
|
||||
popuList.value = nameList.value
|
||||
}
|
||||
}
|
||||
//日期选择
|
||||
@ -179,6 +227,40 @@ import { formatDate } from '../../utils/date';
|
||||
form.value[dataType.value] = formatDate(val)
|
||||
show.value = false
|
||||
}
|
||||
|
||||
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: "primary" },
|
||||
{ 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 statusColor = ref()
|
||||
//状态字典
|
||||
function ztShow(status : any) {
|
||||
let item = statusList.value.find((l : any) => l.code === status)
|
||||
statusColor.value = item.type
|
||||
return item.status
|
||||
}
|
||||
|
||||
|
||||
const gotoLink= (item:any) =>{
|
||||
let a = statusList.value.find((l : any) => l.code === item.status)
|
||||
let url=a.path+'?'+'item='+JSON.stringify(item)
|
||||
uni.navigateTo({
|
||||
url:url,
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -192,13 +274,16 @@ import { formatDate } from '../../utils/date';
|
||||
@click="chooseDate('endDate')" />
|
||||
</van-cell-group>
|
||||
<van-cell-group inset style="display: flex;">
|
||||
<van-field v-model="form.category" name="面料筛选" label="面料筛选" colon class="bor" label-width="5em" readonly
|
||||
@click="selectChoose" />
|
||||
<van-field v-model="form.barcode" name="订单状态" label="订单状态" colon class="bor" label-width="5em" readonly @click="choosePic"/>
|
||||
<!-- <van-field v-model="form.category" name="面料筛选" label="面料筛选" colon class="bor" label-width="5em" readonly
|
||||
@click="selectChoose" /> -->
|
||||
<van-field v-model="form.color" name="颜色筛选" label="颜色筛选" colon class="bor" label-width="5em" readonly
|
||||
@click="choosePic('color')" />
|
||||
<van-field v-model="status" name="订单状态" label="订单状态" colon class="bor" label-width="5em" readonly
|
||||
@click="choosePic('status')" />
|
||||
</van-cell-group>
|
||||
<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.location" name="做单人员" label="做单人员" colon class="bor" label-width="5em" readonly @click="choosePic"/>
|
||||
<van-field v-model="form.orderUser" name="做单人员" label="做单人员" colon class="bor" label-width="5em" readonly
|
||||
@click="choosePic('orderUser')" />
|
||||
</van-cell-group>
|
||||
<view class="grid-container">
|
||||
<view class="grid-item">日期/颜色</view>
|
||||
@ -209,15 +294,31 @@ import { formatDate } from '../../utils/date';
|
||||
<view class="content">
|
||||
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
|
||||
<view class="grid-container" v-for="(item,index) in list" :key="index">
|
||||
<view class="grid-item">{{item.category}}</view>
|
||||
<view class="grid-item">{{item.barcode}}</view>
|
||||
<view class="grid-item" @click="toDetile(item)">{{item.len}}</view>
|
||||
<view class="grid-item">{{item.location}}</view>
|
||||
<view class="grid-item">{{formatDate(item.orderTime)}}<br>{{item.color}}</view>
|
||||
<view class="grid-item">
|
||||
<view class="grid-container1">
|
||||
<view :class="indexSecond===(item.fabrics.length-1)?'grid-item2':'grid-item1'"
|
||||
v-for="(itemSecond,indexSecond) in item.fabrics" :key="indexSecond">
|
||||
{{itemSecond.name}}<br>{{item.craft}} {{itemSecond.belongTo}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="grid-item">
|
||||
<view class="grid-container1">
|
||||
<view :class="indexSecond===(item.fabrics.length-1)?'grid-item2':'grid-item1'"
|
||||
v-for="(itemSecond,indexSecond) in item.fabrics" :key="indexSecond">
|
||||
{{itemSecond.quantity}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="grid-item" @click="gotoLink(item)">
|
||||
<van-button :type="statusColor">{{ztShow(item.status)}}</van-button>
|
||||
</view>
|
||||
</view>
|
||||
</van-list>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!--选择框-->
|
||||
<van-popup v-model:show="showPicker" round position="bottom" @open="handleOpen">
|
||||
<van-picker show-toolbar :columns="popuList" @confirm="pickerConfirm" @cancel="showPickerCancel"
|
||||
@ -259,6 +360,7 @@ import { formatDate } from '../../utils/date';
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
overflow-y: hidden;
|
||||
|
||||
.van-nav-bar {
|
||||
width: 100%;
|
||||
@ -273,13 +375,39 @@ import { formatDate } from '../../utils/date';
|
||||
border: 1px solid #f2f2f2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
height: 50rpx;
|
||||
padding: 5rpx;
|
||||
|
||||
.grid-container1 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.grid-item2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
padding: 5rpx;
|
||||
}
|
||||
|
||||
.grid-item1 {
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
padding: 5rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,15 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { formatDate } from '../../utils/date';
|
||||
import { getAction } from '../../common/http';
|
||||
import { getAction, postAction } from '../../common/http';
|
||||
import { showToast } from 'vant';
|
||||
|
||||
const showDialog = ref(false)
|
||||
const formList = ref([] as any[])
|
||||
const craftList = ref([] as any[])
|
||||
const colorList = ref([])
|
||||
onMounted(() => {
|
||||
uni.getStorage({
|
||||
key: 'info',
|
||||
success(res) {
|
||||
let data = JSON.parse(res.data)
|
||||
form.value.createUser = data.userName
|
||||
},
|
||||
fail: (err : any) => {
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
getAction('/fabric/craft/info').then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
formList.value = res.data
|
||||
craftList.value = res.data.map((l : any) => ({ value: l.name, text: l.name }))
|
||||
}
|
||||
})
|
||||
getAction('/fabric/info/all').then((res : any) => {
|
||||
@ -37,21 +48,54 @@
|
||||
})
|
||||
}
|
||||
})
|
||||
getAction('/color/list').then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
colorList.value = res.data.map((l : any) => ({ value: l.colorCode + l.colorName, text: l.colorCode + l.colorName }))
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
const onClickLeft = () => {
|
||||
history.back()
|
||||
}
|
||||
|
||||
const addFabrics = () => {
|
||||
showDialog.value = true
|
||||
fabrics.value = JSON.parse(JSON.stringify(form.value.fabrics))
|
||||
}
|
||||
|
||||
//弹窗提交
|
||||
const confirmSecond = () => {
|
||||
|
||||
showDialog.value = false
|
||||
form.value.fabrics = JSON.parse(JSON.stringify(fabrics.value))
|
||||
}
|
||||
const onSubmit = () => {
|
||||
|
||||
let set=new Set()
|
||||
let tj=true
|
||||
form.value.fabrics.forEach((l:any)=>{
|
||||
if(!l.name){
|
||||
tj=false
|
||||
}else{
|
||||
let width=l.name.split('/')[0]
|
||||
set.add(width)
|
||||
}
|
||||
|
||||
if(!l.quantity||!l.belongTo){
|
||||
tj=false
|
||||
}
|
||||
})
|
||||
if(!tj) return showToast('请填写完整信息!')
|
||||
if([...set].length>1) return showToast('相同门幅才可以提交!')
|
||||
postAction('/order/internal',form.value).then((res:any)=>{
|
||||
if(res.code===200){
|
||||
showToast('提交成功!')
|
||||
uni.navigateBack()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const form = ref({ processes: [{}] } as any)
|
||||
const form = ref({ orderTime: formatDate(new Date()), fabrics: [{ belongTo: '门店' }], craft: '染色' } as any)
|
||||
const fabrics = ref([{ belongTo: '门店' }] as any[])
|
||||
const showPicker = ref(false)
|
||||
const typeData = ref()
|
||||
const popuList = ref([] as any[])
|
||||
@ -69,10 +113,7 @@
|
||||
}
|
||||
//选择框确认
|
||||
const pickerConfirm = (val : any) => {
|
||||
if (typeData.value === 'level') {
|
||||
} else {
|
||||
form.value[typeData.value] = val.selectedValues[0]
|
||||
}
|
||||
form.value[typeData.value] = val.selectedValues[0]
|
||||
showPickerCancel()
|
||||
}
|
||||
//取消
|
||||
@ -81,10 +122,10 @@
|
||||
}
|
||||
//弹窗开启事件
|
||||
const handleOpen = () => {
|
||||
if (typeData.value === 'supplier') {
|
||||
popuList.value = []
|
||||
} else if (typeData.value === 'level') {
|
||||
popuList.value = []
|
||||
if (typeData.value === 'craft') {
|
||||
popuList.value = craftList.value
|
||||
} else if (typeData.value === 'color') {
|
||||
popuList.value = colorList.value
|
||||
}
|
||||
}
|
||||
const chooseDate = () => {
|
||||
@ -97,8 +138,9 @@
|
||||
}
|
||||
|
||||
//选择面料
|
||||
const selectChoose = () => {
|
||||
const selectChoose = (index : any) => {
|
||||
showPickerList.value = true
|
||||
typeData.value = index
|
||||
}
|
||||
//面料开启
|
||||
const mlmcOpen = () => {
|
||||
@ -161,7 +203,7 @@
|
||||
}, 800)
|
||||
}
|
||||
const onConfirm = (val : any) => {
|
||||
form.value.fabricName = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1]
|
||||
fabrics.value[typeData.value].name = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1]
|
||||
pickerCancel()
|
||||
}
|
||||
</script>
|
||||
@ -172,17 +214,17 @@
|
||||
<view class="content">
|
||||
<van-form @submit="onSubmit">
|
||||
<van-cell-group inset>
|
||||
<van-field v-model="form.createTime" name="做单日期" label="做单日期" colon class="bor" label-width="5em"
|
||||
<van-field v-model="form.orderTime" name="做单日期" label="做单日期" colon class="bor" label-width="5em"
|
||||
readonly :rules="[{ required: true, message: '请填写' }]" @click="chooseDate()" />
|
||||
<van-field v-model="form.supplier" name="订单归属" label="订单归属" colon label-width="5em"
|
||||
<van-field v-model="form.createUser" name="做单人" label="做单人" colon label-width="5em"
|
||||
:rules="[{ required: true, message: '请填写' }]" />
|
||||
<van-field v-model="form.fabricName" name="颜色色号" label="颜色色号" colon
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" />
|
||||
<van-field v-model="form.fabricName" name="工艺" label="工艺" colon
|
||||
<van-field v-model="form.color" name="颜色色号" label="颜色色号" colon class="bor" readonly
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" @click="choosePic('color')" />
|
||||
<van-field v-model="form.craft" name="工艺" label="工艺" colon
|
||||
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor"
|
||||
@click="choosePic('')" />
|
||||
@click="choosePic('craft')" />
|
||||
<view class="a-b">
|
||||
<van-button type="primary" @click="showDialog=true">面料添加</van-button>
|
||||
<van-button type="primary" @click="addFabrics">面料添加</van-button>
|
||||
</view>
|
||||
<view class="grid-container">
|
||||
<view class="grid-item">面料名称</view>
|
||||
@ -191,14 +233,14 @@
|
||||
<view class="grid-item">谁定</view>
|
||||
<view class="grid-item">操作</view>
|
||||
</view>
|
||||
<view class="grid-container" v-for="(item,index) in form.processes" :key=index>
|
||||
<view class="grid-item">{{item.ml}}</view>
|
||||
<view class="grid-item">匹数</view>
|
||||
<view class="grid-item">库存</view>
|
||||
<view class="grid-item">谁定</view>
|
||||
<view class="grid-item">操作</view>
|
||||
<view class="grid-container" v-for="(item,index) in form.fabrics" :key="index">
|
||||
<view class="grid-item">{{item.name}}</view>
|
||||
<view class="grid-item">{{item.quantity}}</view>
|
||||
<view class="grid-item">{{item.storageQuantity}}</view>
|
||||
<view class="grid-item">{{item.belongTo}}</view>
|
||||
<view class="grid-item" style="color: red;" @click="form.fabrics.splice(index,1)">删除</view>
|
||||
</view>
|
||||
<van-field v-model="form.fabricName" name="备注" label="备注" colon label-width="5em" />
|
||||
<van-field v-model="form.comment" name="备注" label="备注" colon label-width="5em" />
|
||||
</van-cell-group>
|
||||
<view style="margin: 16px;">
|
||||
<van-button round block type="primary" native-type="submit">
|
||||
@ -212,17 +254,19 @@
|
||||
<van-dialog v-model:show="showDialog">
|
||||
<view>
|
||||
<van-cell-group inset>
|
||||
<view v-for="(item,index) in form.processes" :key="index">
|
||||
<view v-for="(item,index) in fabrics" :key="index">
|
||||
<view class="a-c">
|
||||
<van-icon name="add" color="red" size="25" v-if="index===0" @click="form.processes.push({})" />
|
||||
<van-icon name="clear" color="red" size="25" v-if="index!=0"
|
||||
@click="form.processes.splice(index,1)" />
|
||||
<van-field v-model="form.ml" name="面料名称" label="面料名称" colon readonly label-width="5em"
|
||||
@click="selectChoose" class="bor"/>
|
||||
<van-icon name="add" color="red" size="25" v-if="index===0"
|
||||
@click="fabrics.push({belongTo:'门店'})" />
|
||||
<van-icon name="clear" color="red" size="25" v-if="index!=0" @click="fabrics.splice(index,1)" />
|
||||
<van-field v-model="item.name" name="面料名称" label="面料名称" colon readonly label-width="5em"
|
||||
@click="selectChoose(index)" class="bor" />
|
||||
</view>
|
||||
<van-field v-model="item.ml" name="需求匹数" label="需求匹数" type="number" colon label-width="6.5em" />
|
||||
<van-field v-model="item.ml" name="库存匹数" label="库存匹数" colon label-width="6.5em" readonly/>
|
||||
<van-field v-model="form.ml" name="谁定" label="谁定" colon readonly label-width="6.5em" @click="choosePic" class="bor" />
|
||||
<van-field v-model="item.quantity" name="需求匹数" label="需求匹数" type="number" colon
|
||||
label-width="6.5em" />
|
||||
<van-field v-model="item.storageQuantity" name="库存匹数" label="库存匹数" colon label-width="6.5em"
|
||||
readonly />
|
||||
<van-field v-model="item.belongTo" name="订单归属人" label="订单归属人" colon label-width="6.5em" />
|
||||
</view>
|
||||
</van-cell-group>
|
||||
</view>
|
||||
@ -297,6 +341,7 @@
|
||||
.grid-item {
|
||||
border: 1px solid #f2f2f2;
|
||||
text-align: center;
|
||||
padding: 15rpx 0;
|
||||
|
||||
::v-deep .van-cell {
|
||||
padding: 0 5px;
|
||||
|
Loading…
Reference in New Issue
Block a user