You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

2 years ago
<style lang="scss">
2 years ago
.container{
2 years ago
background:#F6F6F6;
min-height: 100%;
padding:30rpx 0;
.card{
min-height:1000rpx;
}
}
</style>
<template>
2 years ago
<view class="container">
2 years ago
<u-form class="card inline" labelWidth="auto" :model="formData" :rules="rules">
<d-form v-for="(v,k) in fields" :key="k" v-bind="v" :field="k" :required="!!rules[k]"/>
</u-form>
2 years ago
<button class="cu-btn round bg-green shadow submit">保存</button>
2 years ago
</view>
</template>
<script>
export default {
data(){
return{
fields:{
name:{label:"物品名称"},
unit:{label:"物品单位",type:"select"},
type:{label:"物品类型",type:"select"},
supplier:{label:"供应商"},
remarks:{label:"备注",type:"textarea"},
},
formData:{name:""},
rules:{
name:{required:true, message:"物品名称必填!", trigger:"blur"},
unit:{required:true, message:"物品单位必选!", trigger:"blur"},
type:{required:true, message:"物品类型必选!", trigger:"blur"},
supplier:{required:true, message:"供应商必填!", trigger:"blur"},
}
}
}
}
</script>