| | |
| | | <el-form-item label="联系人详细" prop="contactAddress"> |
| | | <el-input v-model="formData.contactAddress" placeholder="请输入联系人详细地址" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-form-item class="dialog-footer"> |
| | | <el-button v-if="addOrEdit === 'edit'" @click="resetForm">重置</el-button> |
| | | <el-button v-if="addOrEdit === 'add'" @click="cancelForm">取消</el-button> |
| | | <el-button type="primary" @click="submitForm"> |
| | | 确定 |
| | | </el-button> |
| | | <el-button v-if="addOrEdit === 'edit'" @click="resetForm">重置</el-button> |
| | | <el-button v-if="addOrEdit === 'add'" @click="cancelForm">取消</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-dialog> |
| | |
| | | "handleBeforeClose", |
| | | "update:customerDialogFormVisible", |
| | | ]); |
| | | const copyForm = defineModel("copyForm", { |
| | | required: true, |
| | | type: Object, |
| | | }); |
| | | onMounted(() => { |
| | | fetchAreaOptions() |
| | | }) |
| | |
| | | let result = await addOrEditCustomer({ |
| | | ...formData.value, |
| | | }) |
| | | console.log(result); |
| | | obj.value = { |
| | | title: "编辑", |
| | | ...formData.value, |
| | |
| | | // 重置表单 |
| | | const resetForm = () => { |
| | | if (!formRef.value) return; |
| | | formRef.value.resetFields(); |
| | | formData.value = JSON.parse(JSON.stringify(copyForm.value)); |
| | | |
| | | // formRef.value.resetFields(); |
| | | }; |
| | | // 关闭弹窗 |
| | | const handleClose = () => { |
| | |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="sass" scoped> |
| | | <style lang="scss" scoped> |
| | | .dialog-footer { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | margin-top: 20px; |
| | | flex-direction: column; |
| | | } |
| | | </style> |