现货单
This commit is contained in:
parent
5f7a8c8922
commit
facb66b99b
@ -2,8 +2,8 @@ export default {
|
|||||||
|
|
||||||
//正式接口
|
//正式接口
|
||||||
base_scm:'http://192.168.1.222:7002',
|
base_scm:'http://192.168.1.222:7002',
|
||||||
base_auth:'https://cloud.goodsilk.cn/auth',//登录
|
base_auth:'http://192.168.1.2:7000',//登录
|
||||||
base_mes:'https://cloud.goodsilk.cn/mes',//面料
|
base_mes:'http://120.26.196.222:8981',//面料
|
||||||
base_process:'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);
|
const finalHeader = Object.assign({}, header, headerCustom);
|
||||||
let base_url=''
|
let base_url=''
|
||||||
if(url==='/v1/auth/login'){
|
if(url.includes('/v1')){
|
||||||
base_url=myconfig.base_auth
|
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
|
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
|
||||||
@ -43,6 +43,10 @@ function httpRequest(url : string, method : any, data = {}, headerCustom = {}) {
|
|||||||
icon:'error',
|
icon:'error',
|
||||||
title:'登录过期!'
|
title:'登录过期!'
|
||||||
})
|
})
|
||||||
|
uni.clearStorage()
|
||||||
|
uni.reLaunch({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
reject(new Error('请求失败: ' + (res.data && res.data?.message || '未知错误')));
|
reject(new Error('请求失败: ' + (res.data && res.data?.message || '未知错误')));
|
||||||
}else {
|
}else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
18
pages.json
18
pages.json
@ -233,17 +233,27 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path" : "pages/tailorMade/tailorMade",
|
"path" : "pages/customOrder/customOrder",
|
||||||
"style" :
|
"style" :
|
||||||
{
|
{
|
||||||
"navigationBarTitleText" : ""
|
"navigationStyle": "custom",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"disableScroll": true,
|
||||||
|
"app-plus": {
|
||||||
|
"bounce": "none"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path" : "pages/tailorMade/list",
|
"path" : "pages/customOrder/list",
|
||||||
"style" :
|
"style" :
|
||||||
{
|
{
|
||||||
"navigationBarTitleText" : ""
|
"navigationStyle": "custom",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"disableScroll": true,
|
||||||
|
"app-plus": {
|
||||||
|
"bounce": "none"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -6,7 +6,18 @@
|
|||||||
|
|
||||||
const showDialog = ref(false)
|
const showDialog = ref(false)
|
||||||
const formList = ref([] as any[])
|
const formList = ref([] as any[])
|
||||||
|
const otherList = ref([] as any[])
|
||||||
onMounted(() => {
|
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) => {
|
getAction('/fabric/craft/info').then((res : any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
formList.value = res.data
|
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 = () => {
|
const onClickLeft = () => {
|
||||||
@ -172,33 +194,73 @@
|
|||||||
<view class="content">
|
<view class="content">
|
||||||
<van-form @submit="onSubmit">
|
<van-form @submit="onSubmit">
|
||||||
<van-cell-group inset>
|
<van-cell-group inset>
|
||||||
<van-field v-model="form.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()" />
|
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"
|
<van-field v-model="form.supplier" name="订单归属" label="订单归属" colon label-width="5em"
|
||||||
:rules="[{ required: true, message: '请填写' }]" />
|
: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" />
|
: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"
|
:rules="[{ required: true, message: '请填写' }]" label-width="5em" readonly class="bor"
|
||||||
@click="choosePic('')" />
|
@click="choosePic('')" />
|
||||||
<view class="a-b">
|
<view class="a-b">
|
||||||
<van-button type="primary" @click="showDialog=true">面料添加</van-button>
|
<van-button type="primary" @click="showDialog=true">面料添加</van-button>
|
||||||
</view>
|
</view>
|
||||||
<view class="grid-container">
|
|
||||||
<view class="grid-item">面料名称</view>
|
<view class="card">
|
||||||
<view class="grid-item">匹数</view>
|
<view style="text-align: end;">
|
||||||
<view class="grid-item">库存</view>
|
<van-icon name="cross" />
|
||||||
<view class="grid-item">谁定</view>
|
</view>
|
||||||
<view class="grid-item">操作</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>
|
||||||
<view class="grid-container" v-for="(item,index) in form.processes" :key=index>
|
|
||||||
<view class="grid-item">{{item.ml}}</view>
|
<van-field v-model="form.supplier" name="总米数" label="总米数" colon label-width="5em"
|
||||||
<view class="grid-item">匹数</view>
|
:rules="[{ required: true, message: '请填写' }]" readonly class="bor-n" />
|
||||||
<view class="grid-item">库存</view>
|
<van-field v-model="form.supplier" name="总匹数" label="总匹数" colon label-width="5em"
|
||||||
<view class="grid-item">谁定</view>
|
:rules="[{ required: true, message: '请填写' }]" readonly class="bor-n" />
|
||||||
<view class="grid-item">操作</view>
|
<van-field v-model="form.supplier" name="订单总额" label="订单总额" colon label-width="5em"
|
||||||
</view>
|
:rules="[{ required: true, message: '请填写' }]" readonly class="bor-n" />
|
||||||
<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" @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>
|
</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">
|
||||||
@ -209,37 +271,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</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)"
|
<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)" />
|
||||||
|
|
||||||
@ -281,6 +312,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
|
overflow-y: hidden;
|
||||||
|
|
||||||
.van-nav-bar {
|
.van-nav-bar {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -289,23 +321,16 @@
|
|||||||
.content {
|
.content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
|
overflow-y: scroll;
|
||||||
.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
border: 1rpx solid #d7d7d7;
|
||||||
|
border-radius: 5rpx;
|
||||||
|
padding: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.footer-button {
|
.footer-button {
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -342,6 +367,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bor-n {
|
||||||
|
::v-deep .van-field__control {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
::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;
|
@ -39,7 +39,7 @@ import { formatDate } from '../../utils/date';
|
|||||||
}
|
}
|
||||||
const onClickRight = () => {
|
const onClickRight = () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/spot/spot'
|
url: '/pages/customOrder/customOrder'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ import { formatDate } from '../../utils/date';
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="flex">
|
<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()" />
|
@click-right="onClickRight()" />
|
||||||
<van-cell-group inset style="display: flex;">
|
<van-cell-group inset style="display: flex;">
|
||||||
<van-field v-model="form.startDate" name="开始时间" label="开始时间" colon class="bor" label-width="5em" readonly
|
<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;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
|
overflow-y: hidden;
|
||||||
|
|
||||||
.van-nav-bar {
|
.van-nav-bar {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -280,6 +281,7 @@ import { formatDate } from '../../utils/date';
|
|||||||
|
|
||||||
.content {
|
.content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -83,6 +83,11 @@ const ListData =ref([
|
|||||||
name:'需求单列表',
|
name:'需求单列表',
|
||||||
type:'',
|
type:'',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path:'../customOrder/list',
|
||||||
|
name:'定做单列表',
|
||||||
|
type:'',
|
||||||
|
},
|
||||||
] as any[])
|
] as any[])
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,89 +1,85 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="margin-top: 30vh">
|
<div style="margin-top: 30vh">
|
||||||
<van-form @submit="onSubmit">
|
<van-form @submit="onSubmit">
|
||||||
<van-cell-group inset>
|
<van-cell-group inset>
|
||||||
<van-field
|
<van-field style="font-size: 16px" v-model="username" name="用户名" label="用户名" placeholder="用户名"
|
||||||
style="font-size: 16px"
|
:rules="[{ required: true, message: '请填写用户名' }]" />
|
||||||
v-model="username"
|
<van-field style="font-size: 16px" v-model="password" type="password" name="密码" label="密码"
|
||||||
name="用户名"
|
placeholder="密码" :rules="[{ required: true, message: '请填写密码' }]" />
|
||||||
label="用户名"
|
</van-cell-group>
|
||||||
placeholder="用户名"
|
<div style="margin: 16px;">
|
||||||
:rules="[{ required: true, message: '请填写用户名' }]"
|
<van-button round block type="primary" native-type="submit">
|
||||||
/>
|
登录
|
||||||
<van-field
|
</van-button>
|
||||||
style="font-size: 16px"
|
</div>
|
||||||
v-model="password"
|
</van-form>
|
||||||
type="password"
|
</div>
|
||||||
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>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref,onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { showFailToast, showSuccessToast } from "vant";
|
import { showFailToast, showSuccessToast } from "vant";
|
||||||
import { postAction } from "../../common/http";
|
import { getAction, postAction } from "../../common/http";
|
||||||
|
|
||||||
onMounted(()=>{
|
onMounted(() => {
|
||||||
})
|
})
|
||||||
//手机
|
//手机
|
||||||
const username = ref('');
|
const username = ref('');
|
||||||
const password = ref('');
|
const password = ref('');
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
let data={
|
let data = {
|
||||||
'username':username.value,
|
'username': username.value,
|
||||||
'password':password.value,
|
'password': password.value,
|
||||||
}
|
}
|
||||||
postAction('/v1/auth/login',data,{'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}).then((res:any) => {
|
postAction('/v1/auth/login', data, { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' }).then((res : any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
const token = res.data;
|
const token = res.data;
|
||||||
localStorage.setItem("token", token);
|
localStorage.setItem("token", token);
|
||||||
showSuccessToast('登录成功!')
|
showSuccessToast('登录成功!')
|
||||||
setTimeout(()=>{
|
getAction('/v1/auth/info').then((res1 : any) => {
|
||||||
uni.reLaunch({
|
if (res1.code === 200) {
|
||||||
url:'/pages/index/index'
|
localStorage.setItem("info", JSON.stringify(res1.data));
|
||||||
})
|
setTimeout(() => {
|
||||||
},500)
|
uni.reLaunch({
|
||||||
} else {
|
url: '/pages/index/index'
|
||||||
showFailToast(res.msg)
|
})
|
||||||
}
|
}, 500)
|
||||||
})
|
} else {
|
||||||
};
|
showFailToast(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
showFailToast(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.login-box {
|
.login-box {
|
||||||
width: 100vm;
|
width: 100vm;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background: url(../assets/loginBackground.png);
|
background: url(../assets/loginBackground.png);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
.login-form {
|
|
||||||
width: 500px;
|
|
||||||
margin: 200px auto;
|
|
||||||
background-color: #ffffff;
|
|
||||||
padding: 30px;
|
|
||||||
border-radius: 20px;
|
|
||||||
|
|
||||||
.login-button {
|
.login-form {
|
||||||
width: 33%;
|
width: 500px;
|
||||||
margin-left: 26%;
|
margin: 200px auto;
|
||||||
margin-right: 33%;
|
background-color: #ffffff;
|
||||||
}
|
padding: 30px;
|
||||||
h2 {
|
border-radius: 20px;
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
.login-button {
|
||||||
}
|
width: 33%;
|
||||||
}
|
margin-left: 26%;
|
||||||
|
margin-right: 33%;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
@ -1,278 +1,62 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { formatDate } from '../../utils/date';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
import { getAction } from '../../common/http';
|
|
||||||
import { showToast } from 'vant';
|
|
||||||
|
|
||||||
const showDialog = ref(false)
|
|
||||||
const formList = ref([] as any[])
|
onLoad((option : any) => {
|
||||||
onMounted(() => {
|
form.value = JSON.parse(option.item)
|
||||||
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 }] }]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const onClickLeft = () => {
|
const onClickLeft = () => {
|
||||||
history.back()
|
history.back()
|
||||||
}
|
}
|
||||||
|
|
||||||
//弹窗提交
|
const form = ref({} as any)
|
||||||
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()
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<van-nav-bar title="现货需求单" left-text="返回" left-arrow @click-left="onClickLeft" />
|
<van-nav-bar title="现货需求单" left-text="返回" left-arrow @click-left="onClickLeft" />
|
||||||
<view class="content">
|
<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>
|
<van-cell-group inset>
|
||||||
<view v-for="(item,index) in form.processes" :key="index">
|
<van-field v-model="form.orderNo" name="需求单号" label="需求单号" colon label-width="5em" readonly />
|
||||||
<view class="a-c">
|
<van-field v-model="form.orderTime" name="做单日期" label="做单日期" colon class="bor" label-width="5em"
|
||||||
<van-icon name="add" color="red" size="25" v-if="index===0" @click="form.processes.push({})" />
|
readonly />
|
||||||
<van-icon name="clear" color="red" size="25" v-if="index!=0"
|
<van-field v-model="form.createUser" name="做单人" label="做单人" colon label-width="5em" readonly />
|
||||||
@click="form.processes.splice(index,1)" />
|
<van-field v-model="form.color" name="颜色色号" label="颜色色号" colon readonly label-width="5em" />
|
||||||
<van-field v-model="form.ml" name="面料名称" label="面料名称" colon readonly label-width="5em"
|
<van-field v-model="form.craft" name="工艺" label="工艺" colon readonly label-width="5em" class="bor" />
|
||||||
@click="selectChoose" class="bor"/>
|
<view class="a-b">
|
||||||
</view>
|
<van-button type="primary">面料添加</van-button>
|
||||||
<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>
|
</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>
|
</van-cell-group>
|
||||||
</view>
|
<view style="margin: 16px;display: flex;align-items: center;justify-content: space-between;">
|
||||||
<template #footer>
|
<van-button round block type="danger">
|
||||||
<view class="footer-button">
|
|
||||||
<van-button plain size="small" native-type="button" style="width: 25vw;" @click="showDialog=false">
|
|
||||||
取消
|
取消
|
||||||
</van-button>
|
</van-button>
|
||||||
<van-button size="small" type="success" native-type="submit" style="width: 25vw;"
|
|
||||||
@click="confirmSecond">
|
<van-button round block type="primary">
|
||||||
确认
|
提交
|
||||||
</van-button>
|
</van-button>
|
||||||
</view>
|
</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>
|
</view>
|
||||||
</van-popup>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@ -292,11 +76,12 @@
|
|||||||
|
|
||||||
.grid-container {
|
.grid-container {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 2fr 1fr 1.5fr 1fr 1fr;
|
grid-template-columns: 2fr 1fr 1fr 2fr 1fr;
|
||||||
|
|
||||||
.grid-item {
|
.grid-item {
|
||||||
border: 1px solid #f2f2f2;
|
border: 1px solid #f2f2f2;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
padding: 15rpx 0;
|
||||||
|
|
||||||
::v-deep .van-cell {
|
::v-deep .van-cell {
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { showToast } from 'vant';
|
import { showToast } from 'vant';
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref, watch } from 'vue';
|
||||||
import { getAction } from '../../common/http';
|
import { getAction } from '../../common/http';
|
||||||
import { formatDate } from '../../utils/date';
|
import { formatDate } from '../../utils/date';
|
||||||
|
|
||||||
const form = ref({} as any)
|
const form = ref({} as any)
|
||||||
const list = ref([] as any[])
|
const list = ref([] as any[])
|
||||||
|
const colorList = ref([] as any[])
|
||||||
|
const nameList = ref([] as any[])
|
||||||
|
const status = ref()
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getAction('/fabric/info/all').then((res : any) => {
|
getAction('/fabric/info/all').then((res : any) => {
|
||||||
if (res.code === 200) {
|
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 = () => {
|
const onClickLeft = () => {
|
||||||
@ -43,6 +57,10 @@ import { formatDate } from '../../utils/date';
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(form.value, () => {
|
||||||
|
list.value = []
|
||||||
|
init()
|
||||||
|
})
|
||||||
|
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const currentPage = ref(1)
|
const currentPage = ref(1)
|
||||||
@ -60,7 +78,16 @@ import { formatDate } from '../../utils/date';
|
|||||||
};
|
};
|
||||||
|
|
||||||
function init() {
|
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
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -150,22 +177,43 @@ import { formatDate } from '../../utils/date';
|
|||||||
}
|
}
|
||||||
//选择框确认
|
//选择框确认
|
||||||
const pickerConfirm = (val : any) => {
|
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 {
|
} else {
|
||||||
form.value[typeData.value] = val.selectedValues[0]
|
form.value[typeData.value] = val.selectedValues[0]
|
||||||
}
|
}
|
||||||
showPickerCancel()
|
showPicker.value = false
|
||||||
}
|
}
|
||||||
//取消
|
//取消
|
||||||
const showPickerCancel = () => {
|
const showPickerCancel = () => {
|
||||||
showPicker.value = false
|
showPicker.value = false
|
||||||
|
form.value[typeData.value] = ''
|
||||||
}
|
}
|
||||||
//弹窗开启事件
|
//弹窗开启事件
|
||||||
const handleOpen = () => {
|
const handleOpen = () => {
|
||||||
if (typeData.value === 'supplier') {
|
if (typeData.value === 'color') {
|
||||||
popuList.value = []
|
popuList.value = colorList.value
|
||||||
} else if (typeData.value === 'level') {
|
} else if (typeData.value === 'status') {
|
||||||
popuList.value = []
|
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)
|
form.value[dataType.value] = formatDate(val)
|
||||||
show.value = false
|
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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -192,13 +274,16 @@ 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.category" name="面料筛选" label="面料筛选" colon class="bor" label-width="5em" readonly
|
||||||
@click="selectChoose" />
|
@click="selectChoose" /> -->
|
||||||
<van-field v-model="form.barcode" name="订单状态" label="订单状态" colon class="bor" label-width="5em" readonly @click="choosePic"/>
|
<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>
|
||||||
<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.orderUser" name="做单人员" label="做单人员" colon class="bor" label-width="5em" readonly
|
||||||
<van-field v-model="form.location" name="做单人员" label="做单人员" colon class="bor" label-width="5em" readonly @click="choosePic"/>
|
@click="choosePic('orderUser')" />
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
<view class="grid-container">
|
<view class="grid-container">
|
||||||
<view class="grid-item">日期/颜色</view>
|
<view class="grid-item">日期/颜色</view>
|
||||||
@ -209,10 +294,26 @@ import { formatDate } from '../../utils/date';
|
|||||||
<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">{{formatDate(item.orderTime)}}<br>{{item.color}}</view>
|
||||||
<view class="grid-item">{{item.barcode}}</view>
|
<view class="grid-item">
|
||||||
<view class="grid-item" @click="toDetile(item)">{{item.len}}</view>
|
<view class="grid-container1">
|
||||||
<view class="grid-item">{{item.location}}</view>
|
<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>
|
</view>
|
||||||
</van-list>
|
</van-list>
|
||||||
</view>
|
</view>
|
||||||
@ -259,6 +360,7 @@ import { formatDate } from '../../utils/date';
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
|
overflow-y: hidden;
|
||||||
|
|
||||||
.van-nav-bar {
|
.van-nav-bar {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -273,13 +375,39 @@ import { formatDate } from '../../utils/date';
|
|||||||
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;
|
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 {
|
.content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,26 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } 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 showDialog = ref(false)
|
const showDialog = ref(false)
|
||||||
const formList = ref([] as any[])
|
const craftList = ref([] as any[])
|
||||||
|
const colorList = ref([])
|
||||||
onMounted(() => {
|
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) => {
|
getAction('/fabric/craft/info').then((res : any) => {
|
||||||
if (res.code === 200) {
|
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) => {
|
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 = () => {
|
const onClickLeft = () => {
|
||||||
history.back()
|
history.back()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const addFabrics = () => {
|
||||||
|
showDialog.value = true
|
||||||
|
fabrics.value = JSON.parse(JSON.stringify(form.value.fabrics))
|
||||||
|
}
|
||||||
|
|
||||||
//弹窗提交
|
//弹窗提交
|
||||||
const confirmSecond = () => {
|
const confirmSecond = () => {
|
||||||
|
showDialog.value = false
|
||||||
|
form.value.fabrics = JSON.parse(JSON.stringify(fabrics.value))
|
||||||
}
|
}
|
||||||
const onSubmit = () => {
|
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 showPicker = ref(false)
|
||||||
const typeData = ref()
|
const typeData = ref()
|
||||||
const popuList = ref([] as any[])
|
const popuList = ref([] as any[])
|
||||||
@ -69,10 +113,7 @@
|
|||||||
}
|
}
|
||||||
//选择框确认
|
//选择框确认
|
||||||
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()
|
||||||
}
|
}
|
||||||
//取消
|
//取消
|
||||||
@ -81,10 +122,10 @@
|
|||||||
}
|
}
|
||||||
//弹窗开启事件
|
//弹窗开启事件
|
||||||
const handleOpen = () => {
|
const handleOpen = () => {
|
||||||
if (typeData.value === 'supplier') {
|
if (typeData.value === 'craft') {
|
||||||
popuList.value = []
|
popuList.value = craftList.value
|
||||||
} else if (typeData.value === 'level') {
|
} else if (typeData.value === 'color') {
|
||||||
popuList.value = []
|
popuList.value = colorList.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const chooseDate = () => {
|
const chooseDate = () => {
|
||||||
@ -97,8 +138,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//选择面料
|
//选择面料
|
||||||
const selectChoose = () => {
|
const selectChoose = (index : any) => {
|
||||||
showPickerList.value = true
|
showPickerList.value = true
|
||||||
|
typeData.value = index
|
||||||
}
|
}
|
||||||
//面料开启
|
//面料开启
|
||||||
const mlmcOpen = () => {
|
const mlmcOpen = () => {
|
||||||
@ -161,7 +203,7 @@
|
|||||||
}, 800)
|
}, 800)
|
||||||
}
|
}
|
||||||
const onConfirm = (val : any) => {
|
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()
|
pickerCancel()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -172,17 +214,17 @@
|
|||||||
<view class="content">
|
<view class="content">
|
||||||
<van-form @submit="onSubmit">
|
<van-form @submit="onSubmit">
|
||||||
<van-cell-group inset>
|
<van-cell-group inset>
|
||||||
<van-field v-model="form.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()" />
|
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: '请填写' }]" />
|
:rules="[{ required: true, message: '请填写' }]" />
|
||||||
<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" />
|
:rules="[{ required: true, message: '请填写' }]" label-width="5em" @click="choosePic('color')" />
|
||||||
<van-field v-model="form.fabricName" name="工艺" label="工艺" colon
|
<van-field v-model="form.craft" 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('')" />
|
@click="choosePic('craft')" />
|
||||||
<view class="a-b">
|
<view class="a-b">
|
||||||
<van-button type="primary" @click="showDialog=true">面料添加</van-button>
|
<van-button type="primary" @click="addFabrics">面料添加</van-button>
|
||||||
</view>
|
</view>
|
||||||
<view class="grid-container">
|
<view class="grid-container">
|
||||||
<view class="grid-item">面料名称</view>
|
<view class="grid-item">面料名称</view>
|
||||||
@ -191,14 +233,14 @@
|
|||||||
<view class="grid-item">谁定</view>
|
<view class="grid-item">谁定</view>
|
||||||
<view class="grid-item">操作</view>
|
<view class="grid-item">操作</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="grid-container" v-for="(item,index) in form.processes" :key=index>
|
<view class="grid-container" v-for="(item,index) in form.fabrics" :key="index">
|
||||||
<view class="grid-item">{{item.ml}}</view>
|
<view class="grid-item">{{item.name}}</view>
|
||||||
<view class="grid-item">匹数</view>
|
<view class="grid-item">{{item.quantity}}</view>
|
||||||
<view class="grid-item">库存</view>
|
<view class="grid-item">{{item.storageQuantity}}</view>
|
||||||
<view class="grid-item">谁定</view>
|
<view class="grid-item">{{item.belongTo}}</view>
|
||||||
<view class="grid-item">操作</view>
|
<view class="grid-item" style="color: red;" @click="form.fabrics.splice(index,1)">删除</view>
|
||||||
</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>
|
</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">
|
||||||
@ -212,17 +254,19 @@
|
|||||||
<van-dialog v-model:show="showDialog">
|
<van-dialog v-model:show="showDialog">
|
||||||
<view>
|
<view>
|
||||||
<van-cell-group inset>
|
<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">
|
<view class="a-c">
|
||||||
<van-icon name="add" color="red" size="25" v-if="index===0" @click="form.processes.push({})" />
|
<van-icon name="add" color="red" size="25" v-if="index===0"
|
||||||
<van-icon name="clear" color="red" size="25" v-if="index!=0"
|
@click="fabrics.push({belongTo:'门店'})" />
|
||||||
@click="form.processes.splice(index,1)" />
|
<van-icon name="clear" color="red" size="25" v-if="index!=0" @click="fabrics.splice(index,1)" />
|
||||||
<van-field v-model="form.ml" name="面料名称" label="面料名称" colon readonly label-width="5em"
|
<van-field v-model="item.name" name="面料名称" label="面料名称" colon readonly label-width="5em"
|
||||||
@click="selectChoose" class="bor"/>
|
@click="selectChoose(index)" class="bor" />
|
||||||
</view>
|
</view>
|
||||||
<van-field v-model="item.ml" name="需求匹数" label="需求匹数" type="number" colon label-width="6.5em" />
|
<van-field v-model="item.quantity" name="需求匹数" label="需求匹数" type="number" colon
|
||||||
<van-field v-model="item.ml" name="库存匹数" label="库存匹数" colon label-width="6.5em" readonly/>
|
label-width="6.5em" />
|
||||||
<van-field v-model="form.ml" name="谁定" label="谁定" colon readonly label-width="6.5em" @click="choosePic" class="bor" />
|
<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>
|
</view>
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
</view>
|
</view>
|
||||||
@ -297,6 +341,7 @@
|
|||||||
.grid-item {
|
.grid-item {
|
||||||
border: 1px solid #f2f2f2;
|
border: 1px solid #f2f2f2;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
padding: 15rpx 0;
|
||||||
|
|
||||||
::v-deep .van-cell {
|
::v-deep .van-cell {
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
|
Loading…
Reference in New Issue
Block a user