9/10
This commit is contained in:
@@ -4,21 +4,21 @@
|
||||
<div class="AddBuildingBody">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="addBuildingFormBody">
|
||||
<el-form class="formBody" label-position="right" ref="formRef" :model="form" :rules="rules" label-width="130px">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" class="formBody" label-position="right" label-width="130px">
|
||||
<el-form-item label="物料名称" prop="materialName">
|
||||
<el-input maxlength="20" v-model.trim="form.materialName" placeholder="请输入物料名称" />
|
||||
<el-input v-model.trim="form.materialName" maxlength="20" placeholder="请输入物料名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌" prop="brand">
|
||||
<el-input maxlength="20" v-model.trim="form.brand" placeholder="请输入品牌" />
|
||||
<el-input v-model.trim="form.brand" maxlength="20" placeholder="请输入品牌" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="model">
|
||||
<el-input maxlength="20" v-model.trim="form.model" placeholder="请输入规格型号" />
|
||||
<el-input v-model.trim="form.model" maxlength="20" placeholder="请输入规格型号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计量单位" prop="unit">
|
||||
<el-input maxlength="20" v-model.trim="form.unit" placeholder="请输入计量单位" />
|
||||
<el-input v-model.trim="form.unit" maxlength="20" placeholder="请输入计量单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" maxlength="200" show-word-limit :rows="5" v-model.trim="form.remark" placeholder="请输入备注" />
|
||||
<el-input v-model.trim="form.remark" :rows="5" maxlength="200" placeholder="请输入备注" show-word-limit type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-top: 30px">
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
@@ -30,7 +30,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { getMaterial, updateMaterial, addMaterial } from '@/api/system/Tmaterial';
|
||||
@@ -45,7 +45,8 @@ const form = ref({
|
||||
brand: '', // 联系电话
|
||||
model: '', // 邮箱
|
||||
unit: '', // 地址
|
||||
remark: '' // 备注
|
||||
remark: '', // 备注
|
||||
villageId: ''
|
||||
});
|
||||
const rules = ref({
|
||||
materialName: [{ required: true, message: '请输入 物料名称', trigger: 'blur' }],
|
||||
@@ -63,13 +64,16 @@ if (route.query.id) {
|
||||
brand: res.data.brand,
|
||||
model: res.data.model,
|
||||
unit: res.data.unit,
|
||||
remark: res.data.remark
|
||||
remark: res.data.remark,
|
||||
villageId: res.data.villageId
|
||||
};
|
||||
});
|
||||
}
|
||||
// !== 提交 =============================================================================
|
||||
// 提交
|
||||
const submitForm = () => {
|
||||
const villageId = localStorage.getItem('villageid');
|
||||
form.value.villageId = villageId;
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (userid.value) {
|
||||
@@ -92,7 +96,7 @@ const cancelForm = () => {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
.AddBuildingBox {
|
||||
padding: 15px;
|
||||
height: 100%;
|
||||
|
||||
Reference in New Issue
Block a user