From dd3fbaaeafa135e55ffaa9c7a9a1c08c2530d8d3 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期五, 30 五月 2025 09:58:08 +0800
Subject: [PATCH] 提交表格部分更改
---
src/views/basicInformation/mould/coal.vue | 130 +++++++++++++++++++++++++++++++++++++++++++
src/components/Table/ETable.vue | 32 ++++++++++
2 files changed, 162 insertions(+), 0 deletions(-)
diff --git a/src/components/Table/ETable.vue b/src/components/Table/ETable.vue
index f835e2d..88c6f57 100644
--- a/src/components/Table/ETable.vue
+++ b/src/components/Table/ETable.vue
@@ -7,6 +7,14 @@
:show-selection="showSelection"
:max-height="maxHeight"
@selection-change="handleSelectionChange"
+<<<<<<< HEAD
+=======
+ @row-click="handleRowClick"
+ @row-dblclick="handleRowDblClick"
+ @cell-click="handleCellClick"
+ :max-width="maxWidth"
+ @export="handleExport"
+>>>>>>> master
>
<el-table-column v-if="showSelection" type="selection" width="55" align="center" />
<el-table-column v-if="showIndex" label="搴忓彿" type="index" width="60" align="center" />
@@ -49,6 +57,30 @@
import { ElMessage, ElMessageBox } from 'element-plus'
const props = defineProps({
+<<<<<<< HEAD
+=======
+ // 鏈�澶у搴�
+ maxWidth: {
+ type: [String, Number],
+ default: 'auto'
+ },
+ handleCellClick: {
+ type: Function,
+ default: () => {}
+ },
+ handleRowClick: {
+ type: Function,
+ default: () => {}
+ },
+ handleExport: {
+ type: Function,
+ default: () => {}
+ },
+ handleRowDblClick: {
+ type: Function,
+ default: () => {}
+ },
+>>>>>>> master
// 楂樺害
maxHeight: {
type: [String, Number],
diff --git a/src/views/basicInformation/mould/coal.vue b/src/views/basicInformation/mould/coal.vue
index 59dd4d5..7c8a9c7 100644
--- a/src/views/basicInformation/mould/coal.vue
+++ b/src/views/basicInformation/mould/coal.vue
@@ -1,4 +1,5 @@
<template>
+<<<<<<< HEAD
<div>
<el-dialog
v-model="dialogVisible"
@@ -111,6 +112,135 @@
emit("handleBeforeClose")
emit('update:coalDialogFormVisible', false)
}
+=======
+ <div>
+ <el-dialog
+ v-model="dialogVisible"
+ :title="title"
+ width="800"
+ :close-on-click-modal="false"
+ :before-close="handleClose"
+ >
+ <el-form
+ ref="formRef"
+ style="max-width: 600px; margin: 0 auto"
+ :model="formData"
+ :rules="rules"
+ label-width="auto"
+ >
+ <el-form-item label="鍗¤儭" prop="supplierName">
+ <el-input
+ v-model="formData.supplierName"
+ placeholder="璇疯緭鍏ヤ緵璐у晢鍚嶇О"
+ />
+ </el-form-item>
+ <el-form-item label="绾崇◣浜鸿瘑鍒彿" prop="identifyNumber">
+ <el-input
+ v-model="formData.identifyNumber"
+ placeholder="璇疯緭鍏ョ撼绋庝汉璇嗗埆鍙�"
+ />
+ </el-form-item>
+ <el-form-item label="缁忚惀鍦板潃" prop="address">
+ <el-select v-model="formData.address" placeholder="璇烽�夋嫨缁忚惀鍦板潃">
+ <el-option label="Zone one" value="shanghai" />
+ <el-option label="Zone two" value="beijing" />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="閾惰璐︽埛" prop="bankAccount">
+ <el-input
+ v-model="formData.bankAccount"
+ placeholder="璇疯緭鍏ラ摱琛岃处鎴�"
+ />
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="submitForm"> 纭畾 </el-button>
+ </el-form-item>
+ </el-form>
+ </el-dialog>
+ </div>
+</template>
+
+<script setup>
+import { ref, watch, defineProps } from "vue";
+
+const props = defineProps({
+ beforeClose: {
+ type: Function,
+ default: () => {},
+ },
+ form: {
+ type: Object,
+ default: () => ({}),
+ },
+ addOrEdit: {
+ type: String,
+ default: "add",
+ },
+ title: {
+ type: String,
+ default: "",
+ },
+});
+
+const emit = defineEmits([
+ "submit",
+ "handleBeforeClose",
+ "update:coalDialogFormVisible",
+]);
+
+// 琛ㄥ崟寮曠敤
+const formRef = ref(null);
+// 琛ㄥ崟鏁版嵁
+const formData = ref({ ...props.form });
+// 寮圭獥鍙鎬�
+const dialogVisible = defineModel("coalDialogFormVisible", {
+ required: true,
+ type: Boolean,
+});
+
+// 鐩戝惉澶栭儴浼犲叆鐨勮〃鍗曟暟鎹彉鍖�
+watch(
+ () => props.form,
+ (newVal) => {
+ formData.value = { ...newVal };
+ },
+ { deep: true }
+);
+
+// 鐩戝惉鍐呴儴寮圭獥鐘舵�佸彉鍖�
+watch(
+ () => dialogVisible.value,
+ (newVal) => {
+ emit("update:coalDialogFormVisible", newVal);
+ }
+);
+
+// 鎻愪氦琛ㄥ崟
+const submitForm = async () => {
+ if (!formRef.value) return;
+ await formRef.value.validate((valid, fields) => {
+ if (valid) {
+ emit("submit", formData.value);
+ }
+ });
+};
+// 鍙栨秷琛ㄥ崟
+const cancelForm = () => {
+ emit("update:coalDialogFormVisible", false);
+ formData.value = {};
+};
+// 閲嶇疆琛ㄥ崟
+const resetForm = () => {
+ if (!formRef.value) return;
+ formRef.value.resetFields();
+};
+// 鍏抽棴寮圭獥
+const handleClose = () => {
+ // 瑙﹀彂鐖剁粍浠剁殑鍏抽棴鍑芥暟
+ emit("handleBeforeClose");
+ emit("update:coalDialogFormVisible", false);
+};
+>>>>>>> master
const rules = reactive({
supplierName: [
{ required: true, message: "璇疯緭鍏ヤ緵璐у晢鍚嶇О", trigger: "blur" },
--
Gitblit v1.9.3