完善仓库管理

This commit is contained in:
ljx120 2024-12-27 17:29:27 +08:00
parent 4beb1406cc
commit 0c91ace525
7 changed files with 1346 additions and 514 deletions

View File

@ -1,174 +1,199 @@
<script lang="ts" setup> <script lang="ts" setup>
import { showConfirmDialog, showToast } from 'vant';
import { onMounted, ref } from 'vue'
import { deleteAction, getAction, postAction, putAction } from '../../common/http';
import { ref } from 'vue' const showPop = ref(false)
const list = ref([] as any[])
const form = ref({} as any)
const showPop = ref(false) onMounted(() => {
const list= ref([{}] as any[]) init()
const form = ref({list:[{}]} as any) })
const init = () => {
getAction('/factory').then((res : any) => {
if (res.code === 200) {
list.value = res.data
}
})
}
const onClickLeft = () =>{ const onClickLeft = () => {
history.back() history.back()
} }
const onClickRight=()=>{ const onClickRight = () => {
showPop.value=true form.value={}
} showPop.value = true
const edit = (item:any) =>{ }
console.log(item) const edit = (item : any) => {
showPop.value=true console.log(item)
} showPop.value = true
const submit =()=>{ }
const onSubmit = () => {
if (form.value.id) {
putAction('/factory', form.value).then((res : any) => {
if (res.code === 200) {
init()
showPop.value = false
showToast('提交成功!')
}
})
} else {
postAction('/factory', form.value).then((res : any) => {
if (res.code === 200) {
init()
showPop.value = false
showToast('提交成功!')
}
})
}
}
} const del = (item : any) => {
showConfirmDialog({
title: '提示',
message: '是否确认删除?',
}).then(() => {
let url = '/factory/' + item.id
deleteAction(url).then((res : any) => {
if (res.code === 200) {
init()
showToast('删除成功!')
}
})
})
.catch(() => {
// on cancel
});
}
</script> </script>
<template> <template>
<view class="flex"> <view class="flex">
<van-nav-bar <van-nav-bar title="工厂维护" left-text="返回" left-arrow right-text="新增" @click-left="onClickLeft"
title="工厂维护" @click-right="onClickRight" />
left-text="返回" <view class="content">
left-arrow <view class="grid-container">
right-text="新增" <view class="grid-item">编号</view>
@click-left="onClickLeft" <view class="grid-item">工厂</view>
@click-right="onClickRight" <view class="grid-item">操作</view>
/> </view>
<view class="content"> <view class="grid-container" v-for="(item,index) in list" :key="index">
<view class="grid-container"> <view class="grid-item">{{item.name}}</view>
<view class="grid-item">编号</view> <view class="grid-item">{{item.id}}</view>
<view class="grid-item">工厂</view> <view class="grid-item"><span style="color: #35a5f7" @click="edit(item)">编辑</span> &nbsp;&nbsp; <span
<view class="grid-item">操作</view> style="color: red" @click="del(item)">删除
</view> </span></view>
<view class="grid-container" v-for="(item,index) in list" :key="index"> </view>
<view class="grid-item">{{item.name}}</view> </view>
<view class="grid-item">{{item.id}}</view> </view>
<view
class="grid-item"><span style="color: #35a5f7" @click="edit(item)">编辑</span> &nbsp;&nbsp; <span
style="color: red">删除
</span></view>
</view>
</view>
</view>
<van-popup v-model:show="showPop" style="width: 80%" round> <van-popup v-model:show="showPop" style="width: 80%" round>
<view> <view>
<h3 style="text-align: center">新增工厂</h3> <h3 style="text-align: center">新增工厂</h3>
<van-cell-group inset> <van-form @submit="onSubmit">
<van-field <van-cell-group inset>
v-model="form.name" <van-field v-model="form.name" name="工厂名称" label="工厂名称" colon label-width="5em"
name="工厂名称" :rules="[{ required: true, message: '请填写' }]" />
label="工厂名称" <van-field v-model="form.factoryNo" name="工厂编号" label="工厂编号" type="number" colon label-width="5em"
colon :rules="[{ required: true, message: '请填写' }]" />
label-width="5em" <van-field v-model="form.cylinderName" name="染缸名称" label="染缸名称" colon label-width="5em" />
:rules="[{ required: true, message: '请填写' }]" <van-field v-model="form.cylinderNumber" name="染缸数量" label="染缸数量" type="number" colon label-width="5em" />
/> <van-field v-model="form.maximumProcess" name="最大可染" label="最大可染" type="number" colon label-width="5em" />
<van-field <van-field name="类型" label="类型" colon label-width="5em" class="b-a"
v-model="form.name" :rules="[{ required: true, message: '请填写' }]">
name="工厂编号" <template #input>
label="工厂编号" <van-radio-group v-model="form.active" direction="horizontal">
colon <van-radio :name="true">启用</van-radio>
label-width="5em" <van-radio :name="false">禁用</van-radio>
:rules="[{ required: true, message: '请填写' }]" </van-radio-group>
/> </template>
<van-field </van-field>
v-model="form.name" </van-cell-group>
name="染缸名称" <view class="a-c">
label="染缸名称" <van-button type="danger" @click="showPop=false">取消</van-button>
colon <van-button type="primary" native-type="submit">确认</van-button>
label-width="5em" </view>
:rules="[{ required: true, message: '请填写' }]" </van-form>
/> </view>
<van-field </van-popup>
v-model="form.name"
name="染缸数量"
label="染缸数量"
colon
label-width="5em"
:rules="[{ required: true, message: '请填写' }]"
/>
<van-field
v-model="form.name"
name="最大可染"
label="最大可染"
colon
label-width="5em"
:rules="[{ required: true, message: '请填写' }]"
/>
<van-field name="类型" label="类型" colon label-width="5em" class="b-a">
<template #input>
<van-radio-group v-model="form.type" direction="horizontal">
<van-radio name="1">启用</van-radio>
<van-radio name="2">禁用</van-radio>
</van-radio-group>
</template>
</van-field>
</van-cell-group>
<view class="a-c">
<van-button type="danger" @click="showPop=false">取消</van-button>
<van-button type="primary" @click="submit">确认</van-button>
</view>
</view>
</van-popup>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
.flex{ .flex {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100vh; height: 100vh;
width: 100vw; width: 100vw;
.van-nav-bar{
width: 100%; .van-nav-bar {
} width: 100%;
.content{ }
flex: 1;
padding: 0 20rpx; .content {
.grid-container { flex: 1;
display: grid; padding: 0 20rpx;
grid-template-columns: 1fr 3fr 2fr;
.grid-item{ .grid-container {
border: 1rpx solid #f2f2f2; display: grid;
text-align: center; grid-template-columns: 1fr 3fr 2fr;
::v-deep(.van-cell){
padding: 0 10rpx; .grid-item {
} border: 1rpx solid #f2f2f2;
} text-align: center;
}
.card{ ::v-deep(.van-cell) {
margin: 20rpx 30rpx; padding: 0 10rpx;
padding: 10rpx; }
border: 1rpx solid #02a7f0; }
border-radius: 20rpx; }
}
} .card {
} margin: 20rpx 30rpx;
.a-b{ padding: 10rpx;
display:flex; border: 1rpx solid #02a7f0;
align-items: center; border-radius: 20rpx;
::v-deep .van-cell{ }
padding: 0; }
}
}
::v-deep .van-field{
font-size: 16px;
}
::v-deep .van-field__control{
border-bottom: 1rpx solid #d7d7d7;
}
::v-deep .van-field__label{
text-align: end!important;
}
.b-a{
::v-deep .van-field__control{
border-bottom: none;
} }
}
.a-c{ .a-b {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-around;
margin:30rpx; ::v-deep .van-cell {
::v-deep .van-button--normal{ padding: 0;
padding: 10rpx!important; }
height: 60rpx; }
}
} ::v-deep .van-field {
</style> font-size: 16px;
}
::v-deep .van-field__control {
border-bottom: 1rpx solid #d7d7d7;
text-align: center;
}
::v-deep .van-field__label {
text-align: end !important;
}
.b-a {
::v-deep .van-field__control {
border-bottom: none;
}
}
.a-c {
display: flex;
align-items: center;
justify-content: space-around;
margin: 30rpx;
::v-deep .van-button--normal {
padding: 10rpx !important;
height: 60rpx;
}
}
</style>

View File

@ -1,9 +1,23 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { onMounted, ref } from 'vue'
import { deleteAction, getAction } from '../../common/http';
import { showConfirmDialog, showToast } from 'vant';
const list= ref([] as any[]) const list= ref([] as any[])
onMounted(()=>{
init()
})
const init=()=>{
getAction('/process').then((res:any)=>{
if(res.code===200){
list.value=res.data
}
})
}
const onClickLeft = () =>{ const onClickLeft = () =>{
history.back() history.back()
} }
@ -12,6 +26,24 @@ const onClickRight=()=>{
url:'/pages/maintenance/p-details' url:'/pages/maintenance/p-details'
}) })
} }
const del = (item : any) => {
showConfirmDialog({
title: '提示',
message: '是否确认删除?',
}).then(() => {
let url = '/process/' + item.id
deleteAction(url).then((res : any) => {
if (res.code === 200) {
init()
showToast('删除成功!')
}
})
})
.catch(() => {
// on cancel
});
}
</script> </script>
<template> <template>
@ -32,8 +64,8 @@ const onClickRight=()=>{
</view> </view>
<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.name}}</view> <view class="grid-item">{{item.name}}</view>
<view class="grid-item">{{item.id}}</view> <view class="grid-item">{{item.serialNum}}</view>
<view class="grid-item" style="color: red">删除</view> <view class="grid-item" style="color: red" @click="del(item)">删除</view>
</view> </view>
</view> </view>
</view> </view>

View File

@ -1,190 +1,217 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'
import { postAction } from '../../common/http';
import { showToast } from 'vant';
import { ref } from 'vue'
const form = ref({xx:[{}],scx:[{}]} as any) const form = ref({type:'Normal', evidence: [{ chooses: [{}] }] } as any)
const showPicker = ref(false) const showPicker = ref(false)
const popuList = ref([] as any[]) const popuList = ref([] as any[])
const dataType = ref('' as any) const dataType = ref('' as any)
const pickerOpen = () =>{ const pickerOpen = () => {
if(dataType.value==='isNull'){ if (dataType.value === 'necessary') {
popuList.value=[{text:'是',value:'是'},{text:'否',value:'否'}] popuList.value = [{ text: '是', value: true }, { text: '否', value: false }]
} }
} }
const chooseItem = (type:any) =>{
dataType.value=type
showPicker.value=true
}
const pickerConfirm = (val:any) =>{
form.value[dataType.value]=val.selectedValues[0]
showPickerCancel()
}
const showPickerCancel = () =>{
showPicker.value=false
}
const onSubmit = () =>{ const pickerConfirm = (val : any) => {
form.value[dataType.value] = val.selectedValues[0]
showPickerCancel()
}
const showPickerCancel = () => {
showPicker.value = false
}
} const onSubmit = () => {
postAction('/process', form.value).then((res : any) => {
if (res.code === 200) {
showToast('提交成功!')
uni.navigateBack()
}
})
}
const onChange = (val:any) =>{
form.value={type:val , evidence: [{}] }
}
const typeChange = (item:any) =>{
if(item.type==='Select'){
item.chooses=[{value:''}]
}else{
item.chooses=[]
}
}
</script> </script>
<template> <template>
<view class="flex"> <view class="flex">
<van-nav-bar <van-nav-bar title="工序详情" />
title="工序详情" <view class="content">
/> <van-form @submit="onSubmit">
<view class="content"> <van-cell-group inset>
<van-form @submit="onSubmit"> <van-field name="类型" label="类型" colon label-width="6em">
<van-cell-group inset> <template #input>
<van-field name="checkbox" label="类型" colon label-width="6em"> <van-radio-group v-model="form.type" direction="horizontal" @change="onChange">
<template #input> <van-radio name="Normal">普通</van-radio>
<van-radio-group v-model="form.type" direction="horizontal"> <van-radio name="Special">特殊</van-radio>
<van-radio name="1">普通</van-radio> </van-radio-group>
<van-radio name="2">特殊</van-radio> </template>
</van-radio-group> </van-field>
</template> <van-field v-model="form.name" name="工序名称" label="工序名称" colon label-width="6em"
</van-field> :rules="[{ required: true, message: '请填写工序名称' }]" />
<van-field <van-field v-model="form.serialNum" name="序号" label="序号" colon label-width="6em"
v-model="form.name" :rules="[{ required: true, message: '请填写序号' }]" />
name="工序名称"
label="工序名称"
colon
label-width="6em"
:rules="[{ required: true, message: '请填写工序名称' }]"
/>
<van-field
v-model="form.serialNum"
name="序号"
label="序号"
colon
label-width="6em"
:rules="[{ required: true, message: '请填写序号' }]"
/>
<van-field name="checkbox" label="需上传项" colon label-width="6em"> <van-field name="需上传项" label="需上传项" colon label-width="6em">
<template #input> <template #input>
<van-icon name="add" color="red" size="25" @click="form.scx.push({})"/> <van-icon name="add" color="red" size="25" @click="form.evidence.push({})" />
</template> </template>
</van-field> </van-field>
<!-- 普通 -->
<view class="card" v-for="(item,index) in form.evidence" :key="index">
<van-field v-model="item.name" name="上传项名称" label="上传项名称" colon label-width="6em"
:rules="[{ required: true, message: '请填写上传项名称' }]" />
<van-field name="类型" label="类型" colon label-width="6em">
<template #input>
<van-radio-group v-model="item.type" direction="horizontal" @change="typeChange(item)">
<van-radio name="Input">填空</van-radio>
<van-radio name="Select">选择</van-radio>
</van-radio-group>
</template>
</van-field>
<template v-if="item.type=='Input'">
<van-field name="填写内容" label="填写内容" colon label-width="6em">
<template #input>
<van-checkbox-group v-model="item.contentType" direction="horizontal"
shape="square">
<van-checkbox name="Text">文字</van-checkbox>
<van-checkbox name="File">图片</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</template>
<template v-if="item.type=='Select'">
<view v-for="(itemSecond,indexSecond) in item.chooses" :key="indexSecond">
<van-field v-model="itemSecond.value" name="选项内容" label="选项内容" class="bor-a" colon
:rules="[{ required: true, message: '请填写' }]" label-width="6em">
<template #button>
<van-icon name="add" color="red" size="25"
@click.stop="item.chooses.push({value:''})" v-if="indexSecond===0" />
<van-icon name="clear" color="red" size="25"
@click.stop="item.chooses.splice(index,1)" v-else />
</template>
</van-field>
</view>
</template>
<van-field name="是否必填" label="是否必填" colon label-width="6em"
:rules="[{ required: true, message: '请填写' }]">
<template #input>
<van-radio-group v-model="form.necessary" direction="horizontal">
<van-radio :name="true"></van-radio>
<van-radio :name="false"></van-radio>
</van-radio-group>
</template>
</van-field>
</view>
<!-- 特殊 -->
<view v-if="form.type=='Special'">
<van-field name="后续操作" label="后续操作" colon label-width="6em">
<template #input>
<van-radio-group v-model="form.nextStep" direction="horizontal">
<van-radio name="NeedFix">出厂质检</van-radio>
<van-radio name="ChangeCraft">更换工艺</van-radio>
<van-radio name="JustInsert">仅插入</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field v-model="form.externalOrderAlert" name="订单超过" label="订单超过" type="number" colon label-width="6em"
:rules="[{ required: true, message: '请填写上传项名称' }]">
<template #button>
次审核
</template>
</van-field>
<van-field v-model="form.internalOrderAlert" name="现货超过" label="现货超过" type="number" colon label-width="6em"
:rules="[{ required: true, message: '请填写上传项名称' }]">
<template #button>
次审核
</template>
</van-field>
</view>
</van-cell-group>
<view class="card" v-for="(item,index) in form.scx" :key="index"> <view style="margin: 16px;">
<van-field <van-button round block type="primary" native-type="submit">
v-model="item.name" 提交
name="上传项名称" </van-button>
label="上传项名称" </view>
colon </van-form>
label-width="6em" </view>
:rules="[{ required: true, message: '请填写上传项名称' }]" </view>
/>
<van-field name="类型" label="类型" colon label-width="6em">
<template #input>
<van-radio-group v-model="item.type1" direction="horizontal">
<van-radio name="1">填空</van-radio>
<van-radio name="2">选择</van-radio>
</van-radio-group>
</template>
</van-field>
<template v-if="item.type1==1">
<van-field name="checkbox" label="填写内容" colon label-width="6em">
<template #input>
<van-checkbox-group v-model="item.type1" direction="horizontal" shape="square">
<van-checkbox name="1">文字</van-checkbox>
<van-checkbox name="2">图片</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</template>
<template v-if="item.type1==2">
<view class="a-b">
<p style="width: 8.5em;text-align: end">选项内容</p>
<view>
<view v-for="(itemSecond,indexSecond) in item.xx" :key="indexSecond" class="a-b">
<van-icon name="add" color="red" size="25" v-if="indexSecond===0" @click="item.xx.push({})"/>
<van-icon name="clear" color="red" size="25" v-if="indexSecond!=0" @click="item.xx.splice(indexSecond,1)"/>
<van-field
v-model="itemSecond.name"
readonly
@click="chooseItem('')"
:rules="[{ required: true, message: '请选择' }]"
/>
</view>
</view>
</view>
</template>
<van-field <!--选择框-->
v-model="form.isNull" <van-popup v-model:show="showPicker" round position="bottom" @open="pickerOpen">
name="是否必填" <van-picker show-toolbar :columns="popuList" @confirm="pickerConfirm" @cancel="showPickerCancel"
label="是否必填" ref="pickerRef" />
colon </van-popup>
readonly
@click="chooseItem('isNull')"
label-width="6em"
:rules="[{ required: true, message: '请填写' }]"
/>
</view>
</van-cell-group>
<view style="margin: 16px;">
<van-button round block type="primary" native-type="submit">
提交
</van-button>
</view>
</van-form>
</view>
</view>
<!--选择框-->
<van-popup v-model:show="showPicker" round position="bottom" @open="pickerOpen">
<van-picker
show-toolbar
:columns="popuList"
@confirm="pickerConfirm"
@cancel="showPickerCancel"
ref="pickerRef"
/>
</van-popup>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
.flex{ .flex {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100vh; height: 100vh;
width: 100vw; width: 100vw;
.van-nav-bar{
width: 100%; .van-nav-bar {
} width: 100%;
.content{ }
flex: 1;
padding: 0 10px; .content {
.radio-label{ flex: 1;
margin-right: 15px; padding: 0 10rpx;
}
.card{ .radio-label {
border: 1px solid #d7d7d7; margin-right: 15px;
border-radius: 6px; }
box-shadow:2px 2px 5px rgba(0, 0, 0, 0.5);
margin: 10px; .card {
} border-bottom: 1rpx solid #d7d7d7;
::v-deep(.van-field){ }
font-size: 16px;
} ::v-deep .van-field {
::v-deep(.van-field__label){ font-size: 16px;
text-align: end; }
}
.a-b{ ::v-deep .van-field__label {
display:flex; text-align: end;
margin-bottom:10px; }
::v-deep(.van-field__control){ }
border: 1px solid #d7d7d7; }
}
::v-deep(.van-cell){ .bor-a {
padding: 0; ::v-deep .van-field__control {
} text-align: center;
} border-bottom: 1px solid #d7d7d7;
} }
} }
</style>
::v-deep .van-field__control {
text-align: center;
}
.bor {
::v-deep .van-field__control {
text-align: end;
border: 1px solid #d7d7d7;
}
}
::v-deep .van-cell {
padding: 12rpx 0;
}
::v-deep .van-cell-group--inset {
margin: 0;
}
</style>

View File

@ -1,32 +1,126 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { showConfirmDialog, showToast } from 'vant';
import { computed, onMounted, ref } from 'vue'
import { deleteAction, getAction, postAction, putAction } from '../../common/http';
import { colorsArray } from '../../utils/colorName'
const showPop = ref(false) const showPop = ref(false)
const list = ref([{}] as any[]) const list = ref([] as any[])
const form = ref({ list: [{}] } as any) const form = ref({recommend:[],shelve:'',column:'',row:''} as any)
const showPicker = ref(false) const showPicker = ref(false)
const popuList = ref([] as any[]) const popuList = ref([] as any[])
const showPicker1 = ref(false)
const warehouseList = ref([])
const pickerList = ref([])//
const pickerContainerList = ref([])
const searchValue = ref('')//
const searchIndex = ref(0)//
const mlList = ref([])
onMounted(()=>{
getAction('/warehouse').then((res:any)=>{
if(res.code===200){
warehouseList.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:any) => m.text === l.commodity)
if (itemMl) {
let itemMm = itemMl.children.find((m:any) => 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}]}]
})
}
})
}
})
init()
})
const init=()=>{
getAction('/shelves',{page: currentPage.value,size: 10,}).then((res:any)=>{
if(res.code===200){
list.value=res.data.record
total.value = res.data.total
loading.value = false;
finished.value = false
}
})
}
const onClickLeft = () => { const onClickLeft = () => {
history.back() history.back()
} }
const onClickRight = () => { const onClickRight = () => {
form.value={recommend:[],shelve:'',column:'',row:''}
showPop.value = true showPop.value = true
} }
const edit = (item : any) => { const edit = (item : any) => {
console.log(item) form.value=item
showPop.value = true showPop.value = true
} }
const onSubmit = () => { const onSubmit = () => {
if(form.value.id){
putAction('/shelves',form.value).then((res:any)=>{
if(res.code===200){
showToast('编辑成功!')
showPop.value = false
init()
}
})
}else{
postAction('/shelves',form.value).then((res:any)=>{
if(res.code===200){
showToast('提交成功!')
showPop.value = false
init()
}
})
}
} }
const del = (item:any) =>{
showConfirmDialog({
title:'提示',
message:'是否确认删除?',
}) .then(() => {
let url='/shelves/'+item.id
deleteAction(url).then((res:any) =>{
if(res.code===200){
init()
showToast('删除成功!')
}
})
})
.catch(() => {
// on cancel
});
}
// //
const choosePic = (type : any, index : any) => { const choosePic = (type : any, index : any) => {
showPicker.value = true showPicker.value = true
} }
// //
const pickerConfirm = (val : any) => { const pickerConfirm = (val : any) => {
form.value.name = val.selectedValues[0] form.value.location = val.selectedValues[0]
showPickerCancel() showPickerCancel()
} }
// //
@ -35,8 +129,99 @@
} }
// //
const handleOpen = () => { const handleOpen = () => {
popuList.value = [] popuList.value = warehouseList.value.map((l:any)=>({text:l.name,value:l.name}))
} }
//
const handleOpen1 = () =>{
pickerList.value = mlList.value
pickerContainerList.value = pickerList.value
searchValue.value = ''
popuList.value=colorsArray
}
const selectChoose = () =>{
showPicker1.value = true
}
const onConfirm = (val:any) =>{
let ml=val[0].selectedValues[2]+'/'+val[0].selectedValues[0]+val[0].selectedValues[1]
let color = val[1].selectedValues[0]
form.value.recommend.push({fabricName:ml,color:color})
showPicker1.value = false
}
const onCancel = () =>{
showPicker1.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 total = ref(0)
const currentPage = ref(1)
const finished = ref(false)
const loading = ref(false);
//
const onLoad = () => {
if (list.value.length < total.value) {
currentPage.value++
init()
} else {
finished.value = true
}
};
const kwh = computed(()=>{
return (form.value.shelve+'-'+form.value.column+'-'+form.value.row)
})
</script> </script>
<template> <template>
@ -50,14 +235,21 @@
<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 list" :key="index"> <van-list
<view class="grid-item">{{item.name}}</view> v-model:loading="loading"
<view class="grid-item">{{item.name}}</view> :finished="finished"
<view class="grid-item">{{item.id}}</view> finished-text="没有更多了"
<view class="grid-item"><span style="color: #35a5f7" @click="edit(item)">编辑</span> &nbsp;&nbsp; <span @load="onLoad">
style="color: red">删除 <view class="grid-container" v-for="(item,index) in list" :key="index">
</span></view> <view class="grid-item">{{item.shelve+'-'+item.column+'-'+item.row}}</view>
</view> <view class="grid-item">{{item.location}}</view>
<view class="grid-item">{{item.active?'启用':'禁用'}}</view>
<view class="grid-item"><span style="color: #35a5f7" @click="edit(item)">编辑</span> &nbsp;&nbsp; <span
style="color: red" @click="del(item)">删除
</span></view>
</view>
</van-list>
</view> </view>
</view> </view>
@ -66,22 +258,26 @@
<h3 style="text-align: center">新增</h3> <h3 style="text-align: center">新增</h3>
<van-form @submit="onSubmit"> <van-form @submit="onSubmit">
<van-cell-group inset> <van-cell-group inset>
<van-field v-model="form.name" name="货架号" label="货架号" colon class="bor-b" label-width="5em" <van-field v-model="form.shelve" name="货架号" label="货架号" colon class="bor-b" label-width="6em"
:rules="[{ required: true, message: '请填写' }]" /> :rules="[{ required: true, message: '请填写' }]" />
<van-field v-model="form.name" name="列号" label="列号" colon class="bor-b" label-width="5em" <van-field v-model="form.column" name="列号" label="列号" colon class="bor-b" label-width="6em"
:rules="[{ required: true, message: '请填写' }]" /> :rules="[{ required: true, message: '请填写' }]" />
<van-field v-model="form.name" name="层号" label="层号" colon class="bor-b" label-width="5em" <van-field v-model="form.row" name="层号" label="层号" colon class="bor-b" label-width="6em"
:rules="[{ required: true, message: '请填写' }]" /> :rules="[{ required: true, message: '请填写' }]" />
<van-field v-model="form.name" name="库位号" label="库位号" colon readonly label-width="5em" /> <van-field v-model="kwh" name="库位号" label="库位号" class="nonBom" colon readonly label-width="6em" />
<van-field v-model="form.name" name="所在仓库" label="所在仓库" colon readonly class="bor" <van-field v-model="form.location" name="所在仓库" label="所在仓库" colon readonly class="bor"
@click="choosePic" label-width="5em" /> @click="choosePic" label-width="6em" />
<van-field v-model="form.name" name="最大存储量" label="最大存储量" colon class="bor-b" label-width="5em" /> <van-field v-model="form.maximumPayload" name="最大存储量" label="最大存储量" colon class="bor-b" label-width="6em" />
<van-field name="状态" label="状态" colon label-width="5em" <van-field v-model="form.name" name="放置推荐" label="放置推荐" colon class="bor" readonly label-width="6em" @click="selectChoose"/>
<template v-for="(item,index) in form.recommend">
<p style="text-align: center;">{{item.fabricName}} &nbsp;&nbsp;&nbsp;&nbsp; {{item.color}}</p>
</template>
<van-field name="状态" label="状态" colon label-width="6em"
:rules="[{ required: true, message: '请选择' }]" class="nonBom"> :rules="[{ required: true, message: '请选择' }]" class="nonBom">
<template #input> <template #input>
<van-radio-group v-model="form.type1" direction="horizontal"> <van-radio-group v-model="form.active" direction="horizontal">
<van-radio name="1">启用</van-radio> <van-radio :name="true">启用</van-radio>
<van-radio name="2">禁用</van-radio> <van-radio :name="false">禁用</van-radio>
</van-radio-group> </van-radio-group>
</template> </template>
</van-field> </van-field>
@ -99,6 +295,38 @@
<van-picker show-toolbar :columns="popuList" @confirm="pickerConfirm" @cancel="showPickerCancel" <van-picker show-toolbar :columns="popuList" @confirm="pickerConfirm" @cancel="showPickerCancel"
ref="pickerRef" /> ref="pickerRef" />
</van-popup> </van-popup>
<van-popup v-model:show="showPicker1" round position="bottom" @open="handleOpen1">
<van-picker-group
title="选择"
:tabs="['选择面料', '选择颜色']"
@confirm="onConfirm"
@cancel="onCancel"
>
<!-- 面料选择框-->
<view class="select-model">
<van-picker
:columns="pickerContainerList"
v-model="selectedValue"
/>
<view>
<view class="top-select">
<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-picker show-toolbar :columns="popuList"/>
</van-picker-group>
</van-popup>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
@ -141,7 +369,7 @@
.a-b { .a-b {
display: flex; display: flex;
margin-bottom: 10px; margin-bottom: 10rpx;
::v-deep .van-cell { ::v-deep .van-cell {
padding: 0; padding: 0;
@ -154,13 +382,15 @@
.bor-b { .bor-b {
::v-deep .van-field__control { ::v-deep .van-field__control {
border-bottom: 1px solid #d7d7d7; border-bottom: 1rpx solid #d7d7d7;
text-align: center;
} }
} }
.nonBom { .nonBom {
::v-deep .van-field__control { ::v-deep .van-field__control {
border-bottom: none; border-bottom: none;
text-align: center;
} }
} }
@ -172,18 +402,97 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
margin: 15px; margin: 15rpx;
::v-deep .van-button--normal { ::v-deep .van-button--normal {
padding: 5px; padding: 8rpx 16rpx;
height: 30px; height: 50rpx;
} }
} }
.bor { .bor {
::v-deep .van-field__control { ::v-deep .van-field__control {
border: 1px solid #d7d7d7; border: 1rpx solid #d7d7d7;
text-align: center; text-align: center;
} }
} }
/*面料选择搜索框*/
.select-model {
position: relative;
}
.confirm-select {
width: 100%;
}
.confirm-select > p {
text-align: center;
}
.confirm-select > button {
border: none;
background-color: #ffffff;
color: #388aed;
margin: 10px 30px 0 0;
}
.top-select {
position: absolute;
top: 0;
left: 0;
right: 0;
margin: auto;
z-index: 999;
}
::v-deep .select-model .van-picker__toolbar {
height: 66px;
align-items: flex-start;
/*justify-content: flex-end;*/
}
::v-deep .select-model .van-picker__cancel, .select-model .van-picker__confirm {
height: 30px;
padding: 10px 16px 0;
}
.search-btn {
padding: 1px 8px;
border: none;
background-color: #388aed;
color: #ffffff;
margin-left: 5px;
height: 30px;
line-height: 25px;
}
.search-box {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
padding-top: 15px;
padding-bottom: 5px;
position: relative;
background-color: #fff;
}
.van-search {
background-color: #f7f7f8;
}
.ml-search-jump {
padding: 3px 10px;
background-color: #388aed;
color: #ffffff;
border: none;
margin-left: 10px;
}
.flex-btn {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
</style> </style>

View File

@ -1,149 +1,458 @@
<script setup lang="ts"> <script setup lang="ts">
import {ref} from 'vue' import { onMounted, ref, watch } from 'vue'
import { formatDate } from '../../utils/date'; import { formatDate } from '../../utils/date';
import { getAction, putAction } from '../../common/http';
import { showToast } from 'vant';
const form = ref({data:formatDate(new Date()),list:[{}]} as any) const form = ref({} as any)
const show = ref(false) const show = ref(false)
const onSubmit = () =>{ const list = ref([] as any[])
const dataType = ref('')
const showDialog = ref(false)
const showDialog1 = ref(false)
const listItem = ref({} as any)
} onMounted(() => {
// getAction('/test')
init()
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 = () =>{ watch(form.value, () => {
uni.navigateBack() if (timer.value) {
} clearTimeout(timer.value)
const onClickRight=()=>{ }
} timer.value = setTimeout(() => {
const chooseDate = ()=>{ currentPage.value=1
show.value=true init()
} }, 1000)
const onConfirmDate = (val:any) =>{ })
form.value.data = formatDate(val)
show.value = false const init = () => {
} let param={
page:currentPage.value,
size: 10,
...form.value
}
getAction('/rawFabric/search',param).then((res:any)=>{
if(res.code===200){
list.value = res.data.record
total.value = res.data.total
loading.value = false;
finished.value = false
}
})
}
//
const toDetile = (item : any) => {
showDialog.value = true
listItem.value = item
}
const onClickLeft = () => {
uni.navigateBack()
}
const onClickRight = () => {
}
const chooseDate = (val : any) => {
show.value = true
dataType.value = val
}
//
const changeLen = (item : any) => {
showDialog1.value = true
listItem.value = JSON.parse(JSON.stringify(item))
}
const confirmSecond = () => {
putAction('/rawFabric', { len: listItem.value.len, id: listItem.value.id }).then((res : any) => {
if (res.code === 200) {
showDialog1.value = false
showToast('修改成功!')
init()
}
})
}
const onConfirmDate = (val : any) => {
form.value[dataType.value] = formatDate(val)
show.value = false
}
const total = ref(0)
const currentPage = ref(1)
const finished = ref(false)
const loading = ref(false);
//
const onLoad = () => {
if (list.value.length < total.value) {
currentPage.value++
init()
} else {
finished.value = true
}
};
const pickerList = ref([])//
const pickerContainerList = ref([])
const showPickerList = ref(false)
const searchValue = ref('')//
const searchIndex = ref(0)//
const mlList = ref([])
//
const selectChoose = () => {
showPickerList.value = true
}
//
const mlmcOpen = () => {
pickerList.value = mlList.value
pickerContainerList.value = pickerList.value
searchValue.value = ''
}
//
const pickerCancel = () => {
showPickerList.value = false
}
//
const selectedValue = ref()
const getSeachList = () => {
searchIndex.value = 0
let reg = new RegExp(searchValue.value)
let arr = []
pickerList.value.forEach(l => {
if (reg.test(l.text)) {
arr.push(l)
}
})
pickerContainerList.value = arr
}
//
const upSearch = () => {
if (searchIndex.value === 0 && pickerContainerList.value.length) {
searchIndex.value = pickerContainerList.value.length - 1
selectedValue.value = [pickerContainerList.value[searchIndex.value].text]
} else if (pickerContainerList.value.length) {
searchIndex.value--
selectedValue.value = [pickerContainerList.value[searchIndex.value].text]
} else {
showToast('没有了!')
}
}
//
const downSearch = () => {
if (pickerContainerList.value.length) {
if (searchIndex.value === pickerContainerList.value.length) {
searchIndex.value = 0
selectedValue.value = [pickerContainerList.value[searchIndex.value].text]
} else {
searchIndex.value++
selectedValue.value = [pickerContainerList.value[searchIndex.value].text]
}
} else {
showToast('没有了!')
}
}
//
const timer = ref()
const searchTo = () => {
if (timer.value) {
clearTimeout(timer.value)
}
timer.value = setTimeout(() => {
getSeachList()
}, 800)
}
const onConfirm = (val : any) => {
form.value.category = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1]
pickerCancel()
}
</script> </script>
<template> <template>
<view class="flex"> <view class="flex">
<van-nav-bar <van-nav-bar title="白胚列表" left-text="返回" left-arrow right-text="出入库记录" @click-left="onClickLeft"
title="白胚列表" @click-right="onClickRight" />
left-text="返回" <van-cell-group inset style="display: flex;">
left-arrow <van-field v-model="form.startDate" name="开始时间" label="开始时间" colon class="bor" label-width="5em" readonly
right-text="出入库记录" @click="chooseDate('startDate')" :rules="[{ required: true, message: '请填写' }]" />
@click-left="onClickLeft" <van-field v-model="form.endDate" name="截止时间" label="截止时间" colon class="bor" label-width="5em" readonly
@click-right="onClickRight" @click="chooseDate('endDate')" />
/> </van-cell-group>
<van-form @submit="onSubmit"> <van-cell-group inset style="display: flex;">
<van-cell-group inset style="display: flex;"> <van-field v-model="form.name" name="面料名称" label="面料名称" colon class="bor" label-width="5em" readonly
<van-field @click="selectChoose" />
v-model="form.data" <van-field v-model="form.barcode" name="面料编号" label="面料编号" colon class="bor-a" label-width="5em" />
name="开始时间" </van-cell-group>
label="开始时间" <van-cell-group inset style="display: flex;">
colon <van-field v-model="form.len" name="面料米数" label="面料米数" colon class="bor-a" label-width="5em" />
class="bor" <van-field v-model="form.location" name="面料位置" label="面料位置" colon class="bor-a" label-width="5em" />
label-width="5em" </van-cell-group>
readonly
@click="chooseDate()" <view class="grid-container">
:rules="[{ required: true, message: '请填写' }]" <view class="grid-item">面料名称</view>
/> <view class="grid-item">面料编号</view>
<van-field <view class="grid-item">面料米数</view>
v-model="form.data" <view class="grid-item">位置</view>
name="截止时间" </view>
label="截止时间" <view class="content">
colon <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
class="bor" <view class="grid-container" v-for="(item,index) in list" :key="index" @click="toDetile(item)">
label-width="5em" <view class="grid-item">{{item.category}}</view>
readonly <view class="grid-item">{{item.barcode}}</view>
@click="chooseDate()" <view class="grid-item" @click.stop="changeLen(item)">{{item.len}}</view>
/> <view class="grid-item">{{item.location}}</view>
</van-cell-group> </view>
<van-cell-group inset style="display: flex;"> </van-list>
<van-field </view>
v-model="form.data" </view>
name="面料名称"
label="面料名称" <van-dialog v-model:show="showDialog">
colon <div>
class="bor" <van-cell-group inset>
label-width="5em" <van-field v-model="listItem.checkDate" name="质检时间" label="质检时间" colon label-width="5em" readlony />
readonly <van-field v-model="listItem.checkUser" name="质检人员" label="质检人员" colon label-width="5em" readlony />
/> <van-field v-model="listItem.supplier" name="供应商名" label="供应商名" colon label-width="5em" readlony />
<van-field <van-field v-model="listItem.category" name="面料名称" label="面料名称" colon label-width="5em" readlony />
v-model="form.data" <van-field v-model="listItem.barcode" name="面料编号" label="面料编号" colon label-width="5em" readlony />
name="面料编号" <van-field v-model="listItem.len" name="面料米数" label="面料米数" colon label-width="5em" readlony />
label="面料编号" <van-field v-model="listItem.inboundUser" name="入库人" label="入库人" colon label-width="5em" readlony />
colon <van-field v-model="listItem.level" name="白胚等级" label="白胚等级" colon label-width="5em" readlony />
class="bor" <van-field v-model="listItem.location" name="面料位置" label="面料位置" colon label-width="5em" readlony />
label-width="5em" <van-field v-model="listItem.inboundDate" name="入库时间" label="入库时间" colon label-width="5em" readlony />
readonly </van-cell-group>
/> </div>
</van-cell-group> </van-dialog>
<van-cell-group inset style="display: flex;"> <van-dialog v-model:show="showDialog1">
<van-field <div>
v-model="form.data" <van-cell-group inset>
name="面料米数" <van-field v-model="listItem.category" name="面料名称" label="面料名称" colon label-width="5em" readlony />
label="面料米数" <van-field v-model="listItem.barcode" name="面料编号" label="面料编号" colon label-width="5em" readlony />
colon <van-field v-model="listItem.len" name="面料米数" label="面料米数" colon label-width="5em" class="bor-a" />
class="bor" </van-cell-group>
label-width="5em" </div>
readonly <template #footer>
/> <div class="footer-button">
<van-field <van-button plain size="small" native-type="button" style="width: 25vw;" @click="showDialog1=false">
v-model="form.data" 取消
name="面料位置" </van-button>
label="面料位置" <van-button size="small" type="success" native-type="submit" style="width: 25vw;"
colon @click="confirmSecond">
class="bor" 确认
label-width="5em" </van-button>
readonly </div>
/> </template>
</van-cell-group> </van-dialog>
<view class="content">
</view> <!-- 面料选择框-->
</van-form> <van-popup v-model:show="showPickerList" position="bottom" @open="mlmcOpen">
<view class="floot"> <view class="select-model">
</view> <van-picker :columns="pickerContainerList" @cancel="pickerCancel" v-model="selectedValue"
</view> @confirm="onConfirm" />
<van-calendar v-model:show="show" @confirm="onConfirmDate" :min-date="new Date(2010, 0, 1)" :max-date="new Date(2050, 0, 31)"/> <view>
<view class="top-select">
<view class="confirm-select">
<p>请选择品种</p>
</view>
<view class="search-box">
<view>
<van-search placeholder="请输入品种名字" v-model="searchValue" label="面料搜索:" background="#ffffff"
@input="searchTo()" :clearable="false" />
</view>
<view class="flex-btn">
<button class="search-btn" @click="upSearch()"></button>
<button class="search-btn" @click="downSearch()"></button>
</view>
</view>
</view>
</view>
</view>
</van-popup>
<van-calendar v-model:show="show" @confirm="onConfirmDate" :min-date="new Date(2010, 0, 1)"
:max-date="new Date(2050, 0, 31)" />
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
.flex{ .flex {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100vh; height: 100vh;
width: 100vw; width: 100vw;
.van-nav-bar{
width: 100%; .van-nav-bar {
} width: 100%;
.content{ }
flex: 1;
.grid-container { .grid-container {
display: grid; display: grid;
grid-template-columns: 2fr 2fr 1fr; grid-template-columns: 2fr 1.6fr 1.3fr 1.5fr;
.grid-item{ padding: 0 15rpx;
border: 1px solid #f2f2f2;
text-align: center; .grid-item {
border: 1px solid #f2f2f2;
} display: flex;
} align-items: center;
} justify-content: center;
} height: 50rpx;
::v-deep .van-cell { }
padding: 5px!important; }
}
::v-deep .van-field { .content {
font-size: 16px; flex: 1;
} }
.bor{ }
::v-deep .van-field__control {
border: 1px solid #d7d7d7; ::v-deep .van-cell {
text-align: center; padding: 5px !important;
} }
::v-deep .van-field__label{
margin: 0; ::v-deep .van-field {
} font-size: 16px;
} }
::v-deep .van-button--normal{
padding: 5px 8px; .bor {
height: 30px; ::v-deep .van-field__control {
} border: 1px solid #d7d7d7;
</style> text-align: center;
}
::v-deep .van-field__label {
margin: 0;
}
}
.bor-a {
::v-deep .van-field__control {
border-bottom: 1px solid #d7d7d7;
text-align: center;
}
::v-deep .van-field__label {
margin: 0;
}
}
::v-deep .van-button--normal {
padding: 5px 8px;
height: 30px;
}
::v-deep .van-field__control {
text-align: center;
}
.footer-button {
margin: 20px;
display: flex;
justify-content: space-around;
}
/*面料选择搜索框*/
.select-model {
position: relative;
}
.confirm-select {
width: 100%;
}
.confirm-select>p {
text-align: center;
}
.confirm-select>button {
border: none;
background-color: #ffffff;
color: #388aed;
margin: 10px 30px 0 0;
}
.top-select {
position: absolute;
top: 30px;
left: 0;
right: 0;
margin: auto;
z-index: 999;
}
::v-deep .select-model .van-picker__toolbar {
height: 66px;
align-items: flex-start;
/*justify-content: flex-end;*/
}
::v-deep .select-model .van-picker__cancel,
.select-model .van-picker__confirm {
height: 30px;
padding: 10px 16px 0;
}
.search-btn {
padding: 1px 8px;
border: none;
background-color: #388aed;
color: #ffffff;
margin-left: 5px;
height: 30px;
line-height: 25px;
}
.search-box {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
padding-top: 15px;
padding-bottom: 5px;
position: relative;
background-color: #fff;
}
.van-search {
background-color: #f7f7f8;
}
.ml-search-jump {
padding: 3px 10px;
background-color: #388aed;
color: #ffffff;
border: none;
margin-left: 10px;
}
.flex-btn {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
</style>

View File

@ -2,8 +2,8 @@
import { onMounted, ref } from 'vue' import { onMounted, ref } from 'vue'
import {areaList} from '@vant/area-data'; import {areaList} from '@vant/area-data';
import { getAction, postAction, putAction } from '../../common/http'; import { deleteAction, getAction, postAction, putAction } from '../../common/http';
import { showToast } from 'vant'; import { showConfirmDialog, showToast } from 'vant';
const showPop = ref(false) const showPop = ref(false)
const list= ref([] as any[]) const list= ref([] as any[])
@ -16,11 +16,29 @@ onMounted(()=>{
const init =()=>{ const init =()=>{
getAction('/warehouse').then((res:any)=>{ getAction('/warehouse').then((res:any)=>{
if(res.code===200){ if(res.code===200){
list.value=res.data.record list.value=res.data
} }
}) })
} }
const del = (item:any) =>{
showConfirmDialog({
title:'提示',
message:'是否确认删除?',
}) .then(() => {
let url='/warehouse/'+item.id
deleteAction(url).then((res:any) =>{
if(res.code===200){
init()
showToast('删除成功!')
}
})
})
.catch(() => {
// on cancel
});
}
const onClickLeft = () =>{ const onClickLeft = () =>{
history.back() history.back()
} }
@ -88,7 +106,7 @@ const cancel = () =>{
<view class="grid-item">{{item.maximumCapacity}}</view> <view class="grid-item">{{item.maximumCapacity}}</view>
<view <view
class="grid-item"><span style="color: #35a5f7" @click="edit(item)">编辑</span> &nbsp;&nbsp; <span class="grid-item"><span style="color: #35a5f7" @click="edit(item)">编辑</span> &nbsp;&nbsp; <span
style="color: red">删除 style="color: red" @click="del(item)">删除
</span></view> </span></view>
</view> </view>
</view> </view>

112
utils/colorName.ts Normal file
View File

@ -0,0 +1,112 @@
export const colorsArray = [
{value: "01#", text: "01#中国红"},
{value: "02#", text: "02#孔雀蓝"},
{value: "03#", text: "03#特黑色"},
{value: "04#", text: "04#浅香槟"},
{value: "05#", text: "05#橙黄色"},
{value: "06#", text: "06#浅蓝色"},
{value: "07#", text: "07#品红色"},
{value: "08#", text: "08#金盏黄"},
{value: "09#", text: "09#豆沙色"},
{value: "10#", text: "10#嫩黄色"},
{value: "11#", text: "11#宝蓝色"},
{value: "12#", text: "12#天水碧"},
{value: "13#", text: "13#枣红色"},
{value: "14#", text: "14#荷粉色"},
{value: "15#", text: "15#驼色"},
{value: "16#", text: "16#沉水紫"},
{value: "17#", text: "17#灰蓝色"},
{value: "18#", text: "18#釉红色"},
{value: "19#", text: "19#豆绿色"},
{value: "20#", text: "20#浅酡红"},
{value: "21#", text: "21#叠翠色"},
{value: "22#", text: "22#深豆沙"},
{value: "23#", text: "23#玫红色"},
{value: "24#", text: "24#金黄色"},
{value: "25#", text: "25#浅咖色"},
{value: "26#", text: "26#本白色"},
{value: "27#", text: "27#银灰色"},
{value: "28#", text: "28#雪青色"},
{value: "29#", text: "29#浅驼色"},
{value: "30#", text: "30#酒红色"},
{value: "31#", text: "31#血牙色"},
{value: "32#", text: "32#妃红色"},
{value: "33#", text: "33#兰花绿"},
{value: "34#", text: "34#龙胆紫"},
{value: "35#", text: "35#皇帝黄"},
{value: "36#", text: "36#浅苔绿"},
{value: "37#", text: "37#杏黄色"},
{value: "38#", text: "38#桃红色"},
{value: "39#", text: "39#军绿色"},
{value: "40#", text: "40#漂白色"},
{value: "41#", text: "41#深咖色"},
{value: "42#", text: "42#棕红色"},
{value: "43#", text: "43#深藏青"},
{value: "44#", text: "44#艾绿色"},
{value: "45#", text: "45#深血牙"},
{value: "46#", text: "46#秋香绿"},
{value: "47#", text: "47#正粉色"},
{value: "48#", text: "48#雾青色"},
{value: "49#", text: "49#浅金色"},
{value: "50#", text: "50#深宝蓝"},
{value: "51#", text: "51#深玫红"},
{value: "52#", text: "52#墨绿色"},
{value: "53#", text: "53#青莲色"},
{value: "54#", text: "54#哈青色"},
{value: "55#", text: "55#亮玫红"},
{value: "56#", text: "56#深海蓝"},
{value: "57#", text: "57#新娘红"},
{value: "58#", text: "58#深灰色"},
{value: "59#", text: "59#浅藕色"},
{value: "60#", text: "60#象牙白"},
{value: "61#", text: "61#圣诞绿"},
{value: "62#", text: "62#藕紫色"},
{value: "63#", text: "63#浅白灰"},
{value: "64#", text: "64#鹅黄色"},
{value: "65#", text: "65#银红色"},
{value: "66#", text: "66#正灰色"},
{value: "67#", text: "67#绛红色"},
{value: "68#", text: "68#亮孔兰"},
{value: "69#", text: "69#樱花粉"},
{value: "70#", text: "70#琥珀黄"},
{value: "71#", text: "71#褪红色"},
{value: "72#", text: "72#竹青色"},
{value: "73#", text: "73#琉璃绀"},
{value: "74#", text: "74#焦糖红"},
{value: "75#", text: "75#群青色"},
{value: "76#", text: "76#柏枝青"},
{value: "77#", text: "77#绛紫色"},
{value: "78#", text: "78#佛头青"},
{value: "79#", text: "79#深殷红"},
{value: "80#", text: "80#胭脂红"},
{value: "81#", text: "81#肉桂粉"},
{value: "82#", text: "82#天青色"},
{value: "83#", text: "83#海棠红"},
{value: "84#", text: "84#燕尾青"},
{value: "85#", text: "85#松花绿"},
{value: "86#", text: "86#火柿红"},
{value: "87#", text: "87#浅檀红"},
{value: "88#", text: "88#珊瑚粉"},
{value: "89#", text: "89#海军蓝"},
{value: "90#", text: "90#石青色"},
{value: "91#", text: "91#荧光绿"},
{value: "92#", text: "92#祖母绿"},
{value: "93#", text: "93#纽普蓝"},
{value: "94#", text: "94#薰衣草"},
{value: "95#", text: "95#哑翠绿"},
{value: "96#", text: "96#灰玫红"},
{value: "97#", text: "97#绢丝色"},
{value: "98#", text: "98#丁香紫"},
{value: "99#", text: "99#沉香褐"},
{value: "100#", text: "100#檀香褐"},
{value: "101#", text: "101#青黛灰"},
{value: "102#", text: "102#暗龙灰"},
{value: "103#", text: "103#杏花粉"},
{value: "104#", text: "104#牡丹红"},
{value: "105#", text: "105#木槿紫"},
{value: "106#", text: "106#桔梗紫"},
{value: "107#", text: "107#月白青"},
{value: "108#", text: "108#松石绿"},
{value: "109#", text: "109#桂花黄"},
{value: "110#", text: "110#槐叶黄"},
];