This commit is contained in:
Zy
2026-09-10 16:12:22 +08:00
parent e8564269b0
commit 292ee1a6dd
68 changed files with 1397 additions and 757 deletions

View File

@@ -4,24 +4,24 @@
<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="supplierName">
<el-input maxlength="20" v-model.trim="form.supplierName" placeholder="请输入供应商名称" />
<el-input v-model.trim="form.supplierName" maxlength="20" placeholder="请输入供应商名称" />
</el-form-item>
<el-form-item label="联系人" prop="contactPerson">
<el-input maxlength="20" v-model.trim="form.contactPerson" placeholder="请输入联系人" />
<el-input v-model.trim="form.contactPerson" maxlength="20" placeholder="请输入联系人" />
</el-form-item>
<el-form-item label="联系电话" prop="contactPhone">
<el-input maxlength="11" v-model.trim="form.contactPhone" placeholder="请输入联系电话" />
<el-input v-model.trim="form.contactPhone" maxlength="11" placeholder="请输入联系电话" />
</el-form-item>
<el-form-item label="邮箱" props="email">
<el-input maxlength="30" v-model.trim="form.email" placeholder="请输入邮箱" />
<el-input v-model.trim="form.email" maxlength="30" placeholder="请输入邮箱" />
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input type="textarea" maxlength="100" show-word-limit :rows="2" v-model.trim="form.address" placeholder="请输入地址" />
<el-input v-model.trim="form.address" :rows="2" maxlength="100" placeholder="请输入地址" show-word-limit type="textarea" />
</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>
@@ -33,7 +33,7 @@
</div>
</template>
<script setup lang="ts">
<script lang="ts" setup>
import { ref } from 'vue';
import PageHeader from '@/components/Pageheader/index.vue';
import { getSupplier, updateSupplier, addSupplier } from '@/api/system/Tsupplier';
@@ -50,6 +50,7 @@ const form = ref({
email: '', // 邮箱
address: '', // 地址
remark: '', // 备注
villageId: '', // 小区id
contactPerson: '' // 联系人
});
const rules = ref({
@@ -88,6 +89,7 @@ if (route.query.id) {
email: res.data.email,
address: res.data.address,
remark: res.data.remark,
villageId: res.data.villageId,
contactPerson: res.data.contactPerson
};
});
@@ -95,6 +97,8 @@ if (route.query.id) {
// !== 提交 =============================================================================
// 提交
const submitForm = () => {
const villageId = localStorage.getItem('villageid') || '';
form.value.villageId = villageId;
formRef.value?.validate(async (valid: boolean) => {
if (valid) {
if (userid.value) {
@@ -117,7 +121,7 @@ const cancelForm = () => {
};
</script>
<style scoped lang="scss">
<style lang="scss" scoped>
.AddBuildingBox {
padding: 15px;
height: 100%;