| | |
| | | :title="title" |
| | | @submit="handleSubmit" |
| | | /> |
| | | <Descriptions |
| | | v-model:descriptionsVisible="showDialog" |
| | | title="供应商详情" |
| | | :formData="supplierData" |
| | | :fieldLabels="supplierFieldLabels" |
| | | :column="2" |
| | | :isViewOnly="false" |
| | | :border="true" |
| | | :showOperations="true" |
| | | descriptionsTitle="基本信息" |
| | | :fieldConfig="fieldConfig" |
| | | :excludeFields="excludeFields" |
| | | @edit="descriptionsHandleEdit" |
| | | @close="handleClose" |
| | | /> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | |
| | | } from "@/api/basicInformation/coalQualityMaintenance"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | import router from "@/router"; |
| | | |
| | | // ===== 响应式状态管理 ===== |
| | | // 弹窗控制状态 |
| | | const showDialog = ref(false) |
| | | const supplierFieldLabels = { |
| | | supplierName: '供应商名称', |
| | | taxpayerId: '统一社会信用代码', |
| | | } |
| | | // 数据对象 |
| | | const supplierData = ref({ |
| | | supplierName: "测试供应商", |
| | | taxpayerId: "91320000MA1N2P3Q4R", |
| | | contactPerson: "张三", |
| | | contactPhone: "13800138000", |
| | | bankAccount: "6222024200019999999", |
| | | bankName: "中国工商银行", |
| | | businessAddress: "江苏省苏州市工业园区星湖街328号", |
| | | contactAddress: "江苏省苏州市姑苏区观前街100号", |
| | | createTime: "2024-01-15T10:30:00", |
| | | updateTime: "2024-06-25T14:20:00", |
| | | id: 123, |
| | | }) |
| | | // 字段配置 |
| | | const fieldConfig = ref({ |
| | | supplierName: { |
| | | label: '供应商名称', |
| | | span: 2 // 跨2列显示 |
| | | }, |
| | | taxpayerId: { |
| | | label: '统一社会信用代码' |
| | | }, |
| | | contactPhone: { |
| | | label: '联系电话', |
| | | formatter: (value) => value || '暂无联系方式' |
| | | }, |
| | | createTime: { |
| | | label: '创建时间', |
| | | formatter: (value) => new Date(value).toLocaleDateString('zh-CN') |
| | | }, |
| | | businessAddress: { |
| | | label: '详细经营地址', |
| | | span: 2 |
| | | }, |
| | | contactAddress: { |
| | | label: '详细联系地址', |
| | | span: 2 |
| | | } |
| | | }) |
| | | // 排除不显示的字段 |
| | | const excludeFields = ref(["id", "updateTime", "deleted"]); |
| | | const showDialog = ref(false); |
| | | const currentViewData = ref({}); // 当前查看的数据 |
| | | |
| | | // 事件处理 |
| | | const descriptionsHandleEdit = (data) => { |
| | | console.log("编辑数据:", data); |
| | | // 跳转到编辑页面或打开编辑弹窗 |
| | | }; |
| | | |
| | | const handleClose = () => { |
| | | console.log("弹窗关闭"); |
| | | }; |
| | | |
| | | const dialogFormVisible = ref(false); |
| | | const form = ref({}); |
| | | const title = ref(""); |
| | | const copyForm = ref({}); |
| | | const addOrEdit = ref("add"); |
| | | const descriptionsVisible = ref(false); |
| | | |
| | | // 数据缓存映射 |
| | | const userList = ref([]); |
| | |
| | | return matchedField ? matchedField.fieldName : numId; |
| | | }; |
| | | |
| | | // ===== 计算属性 ===== |
| | | |
| | | /** |
| | | * 当前标签页是否支持导出功能 |
| | | */ |
| | |
| | | * 当前选中行数量 |
| | | */ |
| | | const selectedCount = computed(() => selectedRows.value.length); |
| | | |
| | | /** |
| | | * 是否有选中的行 |
| | | */ |
| | | const hasSelectedRows = computed(() => selectedCount.value > 0); |
| | | |
| | | // ===== 表格列配置 ===== |
| | | |
| | |
| | | handleAddEdit(tabName.value); |
| | | }; |
| | | |
| | | /** |
| | | * 查看按钮点击处理 |
| | | * @param {Object} row - 行数据 |
| | | * @description 处理查看操作,构建地址数组并打开查看弹窗 |
| | | */ |
| | | const handleView = (row) => { |
| | | console.log("查看行数据:", row); |
| | | // 拿到所有的keys |
| | | const keys = Object.keys(row); |
| | | console.log("所有keys:", keys); |
| | | showDialog.value = true; |
| | | // form.value = JSON.parse(JSON.stringify(row)); |
| | | // console.log("查看行数据:", form.value); |
| | | // // 构建供应商业务地址数组 |
| | | // if (form.value.bprovinceId && form.value.bdistrictId && form.value.bcityId) { |
| | | // form.value.bids = [row.bprovinceId, row.bcityId, row.bdistrictId]; |
| | | // } |
| | | // // 构建供应商联系地址数组 |
| | | // if (form.value.cprovinceId && form.value.cdistrictId && form.value.ccityId) { |
| | | // form.value.cids = [row.cprovinceId, row.ccityId, row.cdistrictId]; |
| | | // } |
| | | // // 构建客户业务地址数组 |
| | | // if ( |
| | | // form.value.businessCityId && |
| | | // form.value.businessDistrictId && |
| | | // form.value.businessProvinceId |
| | | // ) { |
| | | // form.value.bids = [ |
| | | // row.businessProvinceId, |
| | | // row.businessCityId, |
| | | // row.businessDistrictId, |
| | | // ]; |
| | | // } |
| | | |
| | | // // 构建客户联系地址数组 |
| | | // if (form.value.cityId && form.value.districtId && form.value.provinceId) { |
| | | // form.value.cids = [row.provinceId, row.cityId, row.districtId]; |
| | | // } |
| | | |
| | | // addOrEdit.value = "viewRow"; |
| | | // handleAddEdit(tabName.value); |
| | | }; |
| | | |
| | | /** |
| | | * 批量删除处理 |