已修改22个文件
已添加1个文件
1612 ■■■■ 文件已修改
src/api/salesOutbound/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Table/ETable.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/dialog/Descriptions.vue 256 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/production.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/archiveManagement/index.vue 237 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/archiveManagement/mould/archiveDialog.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicInformation/index.vue 452 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicInformation/mould/coal.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicInformation/mould/coalMeiZhiZiDuanWeiHu.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicInformation/mould/coalQualityMaintenance.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicInformation/mould/customer.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicInformation/mould/supplier.vue 225 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inspectionManagement/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inspectionUpload/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procureMent/components/ProductionDialog.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procureMent/index.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/production/components/ProductionDetailsTable.vue 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/production/components/ProductionDialog.vue 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/production/components/useDialog.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/production/index.vue 172 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesOutbound/components/formDia.vue 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesOutbound/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouseManagement/index.vue 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/salesOutbound/index.js
@@ -33,7 +33,7 @@
        params: query
    })
}
// æŸ¥è¯¢ç…¤ç§
// åˆ é™¤é”€å”®å‡ºåº“
export function delSalesRecord(query) {
    return request({
        url: '/salesRecord/delSalesRecord',
src/components/Table/ETable.vue
@@ -2,7 +2,7 @@
    v-loading="loading" 
    :data="tableData" 
    :border="border" 
    :show-selection="showSelection"
    :show-selection="showSelection"
    :max-height="maxHeight"
    :header-cell-style="{ background: '#EBEEF5', color: '#3D3D3D' }" 
    @selection-change="handleSelectionChange"
@@ -15,7 +15,7 @@
    :show-overflow-tooltip="showOverflowTooltip"
    ref="tableRef" 
    :row-key="rowKey"
    style="width: 100%"
    style="width: 100%;"
  >
    <el-table-column v-if="showSelection" type="selection" width="55" align="center" />
    <el-table-column v-if="showIndex" label="序号" width="60" align="center" fixed="left">
@@ -32,20 +32,13 @@
      </el-table-column>
    </template>
    <!-- æ“ä½œåˆ— -->
    <el-table-column v-if="showOperations" :label="operationsLabel" :width="operationsWidth" fixed="right" align="center">
    <el-table-column v-if="showOperations" :label="operationsLabel" :width="operationsWidth" :show-overflow-tooltip="false" fixed="right" align="center">
      <template #default="scope">
        <slot name="operations" :row="scope.row">
          <el-button v-if="operations.includes('edit')" link type="primary" size="small"
            @click="handleEdit(scope.row)">编辑</el-button>
          <el-button v-if="operations.includes('viewFile')" link type="primary" size="small"
          <el-button v-if="operations.includes('viewRow')" link type="primary" size="small"
            @click="handleView(scope.row)">查看附件</el-button>
          <!--            <el-button-->
          <!--              v-if="operations.includes('delete')"-->
          <!--              link-->
          <!--              type="danger"-->
          <!--              size="small"-->
          <!--              @click="handleDelete(scope.row)"-->
          <!--            >删除</el-button>-->
        </slot>
      </template>
    </el-table-column>
@@ -168,7 +161,7 @@
};
// å¤„理选择变化、编辑、删除和导出操作
const emit = defineEmits(['selection-change', 'edit', 'delete', 'export'])
const emit = defineEmits(['selection-change', 'edit', 'delete', 'export', 'viewRow'])
const handleSelectionChange = (selection) => {
  emit('selection-change', selection)
}
@@ -176,7 +169,7 @@
  emit('edit', row)
}
const handleView = (row) => {
  emit('viewFile', row)
  emit('viewRow', row)
}
const handleDelete = (row) => {
  ElMessageBox.confirm(
src/components/dialog/Descriptions.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,256 @@
<template>
  <el-dialog v-model="descriptionsVisible" :title="title" width="60%" :close-on-click-modal="false">
    <el-card>
      <el-descriptions
        class="margin-top"
        :title="descriptionsTitle"
        :column="column"
        :size="size"
        :border="border"
      >
        <template v-if="showOperations" #extra>
          <slot name="extra">
            <el-button type="primary" @click="handleEdit" v-if="!isViewOnly">编辑</el-button>
          </slot>
        </template>        <!-- åŠ¨æ€æ¸²æŸ“æ‰€æœ‰æ•°æ®é¡¹ -->
        <el-descriptions-item
          v-for="(item, key) in filteredData"
          :key="`desc-item-${key}`"
          :label="getFieldLabel(key)"
          :span="getFieldSpan(key)"
        >
          {{ formatValue(item, key) }}
        </el-descriptions-item>
      </el-descriptions>
    </el-card>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="handleClose">关闭</el-button>
        <el-button v-if="!isViewOnly" type="primary" @click="handleEdit">编辑</el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script setup>
import { defineProps, computed } from "vue";
const props = defineProps({
  // å¼¹çª—标题
  title: {
    type: String,
    default: "详情信息"
  },
  // æ•°æ®å¯¹è±¡
  formData: {
    type: Object,
    default: () => ({})
  },
  // æ˜¯å¦ä¸ºæŸ¥çœ‹æ¨¡å¼
  isViewOnly: {
    type: Boolean,
    default: true
  },
  // æè¿°ç»„件标题
  descriptionsTitle: {
    type: String,
    default: ""
  },
  // åˆ—æ•°
  column: {
    type: Number,
    default: 2
  },
  // å°ºå¯¸
  size: {
    type: String,
    default: "default",
    validator: (value) => ["large", "default", "small"].includes(value)
  },
  // æ˜¯å¦æ˜¾ç¤ºè¾¹æ¡†
  border: {
    type: Boolean,
    default: true
  },
  // æ˜¯å¦æ˜¾ç¤ºæ“ä½œæŒ‰é’®
  showOperations: {
    type: Boolean,
    default: true
  },
  // å­—段映射配置 { key: { label: '显示名称', span?: è·¨åˆ—æ•°, formatter?: æ ¼å¼åŒ–函数 } }
  fieldConfig: {
    type: Object,
    default: () => ({})
  },
  // éœ€è¦æŽ’除显示的字段
  excludeFields: {
    type: Array,
    default: () => ['id', 'createTime', 'updateTime', 'deleted']
  },  // éœ€è¦åŒ…含显示的字段(如果设置了,则只显示这些字段)
  includeFields: {
    type: Array,
    default: () => []
  },
  // å­—段标签映射表 { key: '显示名称' }
  fieldLabels: {
    type: Object,
    default: () => ({})
  },
  // å­—段显示顺序
  fieldOrder: {
    type: Array,
    default: () => []
  }
});
const descriptionsVisible = defineModel("descriptionsVisible", {
  type: Boolean,
  default: false,
});
const emit = defineEmits(["update:descriptionsVisible", "edit", "close"]);
// è¿‡æ»¤åŽçš„æ•°æ®
const filteredData = computed(() => {
  if (!props.formData || typeof props.formData !== 'object') {
    return {};
  }
  const data = { ...props.formData };
  let filteredResult = {};
  // å¦‚果指定了包含字段,则只显示这些字段
  if (props.includeFields.length > 0) {
    props.includeFields.forEach(field => {
      if (data.hasOwnProperty(field)) {
        filteredResult[field] = data[field];
      }
    });
  } else {
    // å¦åˆ™æŽ’除指定字段
    Object.keys(data).forEach(key => {
      if (!props.excludeFields.includes(key)) {
        filteredResult[key] = data[key];
      }
    });
  }
  // å¦‚果指定了字段顺序,则按顺序重新组织数据
  if (props.fieldOrder.length > 0) {
    const orderedResult = {};
    // å…ˆæŒ‰æŒ‡å®šé¡ºåºæ·»åŠ å­—æ®µ
    props.fieldOrder.forEach(field => {
      if (filteredResult.hasOwnProperty(field)) {
        orderedResult[field] = filteredResult[field];
      }
    });
    // å†æ·»åŠ æœªåœ¨é¡ºåºä¸­æŒ‡å®šçš„å…¶ä»–å­—æ®µ
    Object.keys(filteredResult).forEach(key => {
      if (!props.fieldOrder.includes(key)) {
        orderedResult[key] = filteredResult[key];
      }
    });
    return orderedResult;
  }
  return filteredResult;
});
// èŽ·å–å­—æ®µæ˜¾ç¤ºæ ‡ç­¾
const getFieldLabel = (key) => {
  // 1. ä¼˜å…ˆä½¿ç”¨ fieldConfig ä¸­çš„æ ‡ç­¾é…ç½®
  if (props.fieldConfig[key]?.label) {
    return props.fieldConfig[key].label;
  }
  // 2. å…¶æ¬¡ä½¿ç”¨ä¼ å…¥çš„字段映射表
  if (props.fieldLabels[key]) {
    return props.fieldLabels[key];
  }
  // 3. æœ€åŽä½¿ç”¨é»˜è®¤çš„字段名转换(驼峰转空格)
  return key.replace(/([A-Z])/g, ' $1').replace(/^./, str => str.toUpperCase());
};
// èŽ·å–å­—æ®µè·¨åˆ—æ•°
const getFieldSpan = (key) => {
  return props.fieldConfig[key]?.span || 1;
};
// æ ¼å¼åŒ–值
const formatValue = (value, key) => {
  // ä¼˜å…ˆä½¿ç”¨é…ç½®çš„æ ¼å¼åŒ–函数
  if (props.fieldConfig[key]?.formatter && typeof props.fieldConfig[key].formatter === 'function') {
    return props.fieldConfig[key].formatter(value);
  }
  // é»˜è®¤æ ¼å¼åŒ–
  if (value === null || value === undefined || value === '') {
    return '--';
  }
  // æ•°ç»„格式化
  if (Array.isArray(value)) {
    return value.join(', ');
  }
  // å¯¹è±¡æ ¼å¼åŒ–
  if (typeof value === 'object') {
    return JSON.stringify(value);
  }
  // æ—¥æœŸæ ¼å¼åŒ–
  if (key.toLowerCase().includes('time') || key.toLowerCase().includes('date')) {
    try {
      const date = new Date(value);
      if (!isNaN(date.getTime())) {
        return date.toLocaleString('zh-CN');
      }
    } catch (e) {
      // å¦‚果不是有效日期,返回原值
    }
  }
  return String(value);
};
// å¤„理编辑按钮点击
const handleEdit = () => {
  emit('edit', props.formData);
};
// å¤„理关闭
const handleClose = () => {
  descriptionsVisible.value = false;
  emit('close');
};
</script>
<style scoped>
.margin-top {
  margin-top: 20px;
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.cell-item {
  display: flex;
  align-items: center;
}
:deep(.el-descriptions__label) {
  font-weight: 600;
}
:deep(.el-descriptions__content) {
  word-break: break-word;
}
</style>
src/utils/production.js
@@ -10,9 +10,7 @@
 */
export function parseCoalArray(coalString) {
  if (!coalString) return [];
  if (Array.isArray(coalString)) return coalString;
  return String(coalString)
    .replace(/^\[|\]$/g, '')
    .split(',')
@@ -61,7 +59,6 @@
  }
  for (let i = 0; i < data.length; i++) {
    console.log(data[i])
    const item = data[i];
    for (const field of requiredFields) {
      if (item[field] === '' || item[field] === null || item[field] === undefined) {
src/views/archiveManagement/index.vue
@@ -40,7 +40,7 @@
              @node-click="handleNodeClick"
          >
            <template #default="{ node, data }">
              <div class="tree-node-content" @dblclick="headerDbClick(data)">
              <div class="tree-node-content" @dblclick="headerDbClick(node,data)">
                <div class="node-icon">
                  <el-icon
                      v-if="!node.isLeaf"
@@ -147,7 +147,7 @@
<script setup>
import {nextTick, onMounted, reactive, ref} from "vue";
import ETable from "@/components/Table/ETable.vue";
import {ElButton, ElIcon, ElInput, ElMessage} from "element-plus";
import {ElButton, ElIcon, ElInput, ElMessage, ElMessageBox} from "element-plus";
import archiveDialog from "./mould/archiveDialog.vue";
import Pagination from "@/components/Pagination/index.vue";
import {Delete, Document, Folder, Plus, Search,} from "@element-plus/icons-vue";
@@ -187,18 +187,28 @@
  return data.name?.toLowerCase().includes(value.toLowerCase());
};
const submitForm = async (res) => {
  if (res && res.code === 200) {
    // åˆ·æ–°åˆ—表数据
    await getArchiveListData();
  } else {
    ElMessage.error("操作失败: " + (res?.message || "未知错误"));
  try {
    if (res && res.code === 200) {
      ElMessage.success("操作成功");
      dialogVisible.value = false;
      // åˆ·æ–°åˆ—表数据
      await getArchiveListData();
    } else {
      ElMessage.error("操作失败: " + (res?.message || res?.msg || "未知错误"));
    }
  } catch (error) {
    console.error("提交表单错误:", error);
    ElMessage.error("操作失败,请稍后重试");
  }
}
};
const centerDialogVisible = (val) => {
  dialogVisible.value = val;
};
const tableSwitch = ref(false);
// å¤„理节点点击
const handleNodeClick = (data) => {
  console.log("点击节点", data);
  tableSwitch.value = true;
  // åˆ‡æ¢èŠ‚ç‚¹æ—¶é‡ç½®åˆ°ç¬¬ä¸€é¡µ
  queryParams.current = 1;
@@ -206,18 +216,37 @@
  getArchiveListData();
};
const archiveDialogs = ref(null); // è¡¨æ ¼ç»„件引用
// add
// æ–°å¢žå½’æ¡£
const add = () => {
  row.value = {}; // æ¸…空行数据,确保是新增模式
  dialogVisible.value = true;
  newName.value = ""; // æ¸…空输入框
  archiveDialogs.value.initForm(); // é‡ç½®è¡¨å•
  try {
    row.value = {}; // æ¸…空行数据,确保是新增模式
    newName.value = ""; // æ¸…空输入框
    dialogVisible.value = true;
    // ç¡®ä¿ç»„件引用存在后再调用方法
    nextTick(() => {
      if (archiveDialogs.value && typeof archiveDialogs.value.initForm === 'function') {
        archiveDialogs.value.initForm(); // é‡ç½®è¡¨å•
      }
    });
  } catch (error) {
    console.error("新增归档错误:", error);
    ElMessage.error("打开新增界面失败");
  }
};
// å¤„理分页变化
const handlePageChange = ({page}) => {
  queryParams.current = page;
  // pageSize å›ºå®šä¸º20,不再从参数中获取
  getArchiveListData();
const handlePageChange = (pagination) => {
  try {
    const { page, limit } = pagination;
    queryParams.current = page;
    if (limit) {
      queryParams.pageSize = limit;
    }
    getArchiveListData();
  } catch (error) {
    console.error("分页处理错误:", error);
    ElMessage.error("分页操作失败");
  }
};
const getArchiveListData = async () => {
@@ -251,31 +280,51 @@
    loading.value = false;
  }
};
// åˆ é™¤é€‰ä¸­çš„归档记录
const delHandler = async () => {
  if (selectedRows.length === 0) {
    ElMessage.warning("请选择要删除的数据");
    return;
  }
  try {
    await ElMessageBox.confirm(
      `确定要删除选中的 ${selectedRows.length} æ¡è®°å½•吗?`,
      '删除确认',
      {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      }
    );
    const ids = selectedRows.map((row) => row.id);
    const {code, msg} = await delArchive(ids);
    const { code, msg } = await delArchive(ids);
    if (code !== 200) {
      ElMessage.warning("删除失败: " + msg);
    } else {
      ElMessage.success("删除成功");
      // åˆ é™¤æˆåŠŸåŽé‡æ–°èŽ·å–æ•°æ®
      await getArchiveListData();
      ElMessage.error("删除失败: " + msg);
      return;
    }
    ElMessage.success("删除成功");
    // åˆ é™¤æˆåŠŸåŽé‡æ–°èŽ·å–æ•°æ®
    await getArchiveListData();
    // æ¸…空选中状态
    selectedRows.splice(0, selectedRows.length);
  } catch (error) {
    ElMessage.error("删除归档失败");
    if (error !== 'cancel') {
      console.error("删除归档失败:", error);
      ElMessage.error("删除操作失败,请稍后重试");
    }
  }
};
// åŒå‡»ç¼–辑节点
const headerDbClick = (comeTreeData) => {
  comeTreeData.isEdit = true;
  newName.value = comeTreeData.name;
const headerDbClick = (node, data) => {
  data.isEdit = true;
  newName.value = data.name;
  nextTick(() => {
    const inputEl = inputRefs.value.get(comeTreeData.id || comeTreeData);
    const inputEl = inputRefs.value.get(data.id || data);
    if (inputEl) {
      inputEl.focus();
      inputEl.select();
@@ -298,33 +347,69 @@
// å¤„理输入框失焦
const handleInputBlur = async (event, comeTreeData, node) => {
  if (!comeTreeData.isEdit) return; // å¦‚果不是编辑状态,直接返回
  console.log("handleInputBlur", event, comeTreeData, node);
  if (event.relatedTarget && event.relatedTarget.tagName === "BUTTON") {
    return;
  }
  comeTreeData.isEdit = false;
  const newValue = newName.value.trim();
  if (comeTreeData.name === newValue) {
    return;
  }
  if (newValue === "") {
    newName.value = comeTreeData.name || "新节点";
    return;
  }
  try {
    comeTreeData.name = newValue;
    if (!comeTreeData.isEdit) return; // å¦‚果不是编辑状态,直接返回
    if (event.relatedTarget && event.relatedTarget.tagName === "BUTTON") {
      return;
    }
    comeTreeData.isEdit = false;
    const newValue = newName.value.trim();
    if (comeTreeData.name === newValue) {
      return;
    }
    if (newValue === "") {
      newName.value = comeTreeData.name || "新节点";
      ElMessage.warning("节点名称不能为空");
      return;
    }
    // èŽ·å–çˆ¶èŠ‚ç‚¹çš„id - é€šè¿‡ node å‚数更准确地获取
    let parentId = null;
    if (node && node.parent && node.parent.data) {
      parentId = node.parent.data.id;
    }
    await addOrEditTree({
    const result = await addOrEditTree({
      name: newValue,
      parentId: parentId || null, // å¦‚果没有父节点,则为 null
      id: comeTreeData.id || null,
    });
      if (result.code === 200) {
      comeTreeData.name = newValue;
      if (!comeTreeData.id && result.data) {
        comeTreeData.id = result.data.id || result.data;
      }
      ElMessage.success("保存成功");
      // åˆ·æ–°æ ‘数据并展开当前节点
      const currentNodeId = comeTreeData.id;
      await getList();
      // ç­‰å¾…DOM更新后展开节点
      nextTick(() => {
        if (currentNodeId && treeRef.value) {
          const targetNode = treeRef.value.getNode(currentNodeId);
          if (targetNode) {
            // å±•开当前节点
            targetNode.expanded = true;
            // å¦‚果有父节点,也展开父节点路径
            expandParentNodes(targetNode);
          }
        }
      });
    } else {
      comeTreeData.name = comeTreeData.name || "新节点";
      ElMessage.error("保存失败: " + (result.msg || "未知错误"));
    }
  } catch (error) {
    console.error("保存节点失败:", error);
    comeTreeData.name = comeTreeData.name || "新节点";
    ElMessage.error("保存失败,请稍后重试");
  }
};
@@ -337,24 +422,55 @@
  isLeaf: "leaf",
};
// å±•开父节点路径
const expandParentNodes = (node) => {
  if (node && node.parent && node.parent.data) {
    // é€’归展开所有父节点
    node.parent.expanded = true;
    expandParentNodes(node.parent);
  }
};
// åˆ é™¤æ ‘节点
const remove = async (node, data) => {
  if (!data || !data.id) {
    ElMessage.warning("无法删除此节点");
    return;
  }
  let {code, msg} = await delTree([data.id]);
  if (code !== 200) {
    ElMessage.warning("删除失败, " + msg);
  } else {
  try {
    await ElMessageBox.confirm(
      `确定要删除节点 "${data.name}" å—?`,
      '删除确认',
      {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      }
    );
    const { code, msg } = await delTree([data.id]);
    if (code !== 200) {
      ElMessage.error("删除失败: " + msg);
      return;
    }
    ElMessage.success("删除成功");
    await getList();
  } catch (error) {
    if (error !== 'cancel') {
      console.error("删除节点失败:", error);
      ElMessage.error("删除失败,请稍后重试");
    }
  }
  await getList();
};
const append = async (data) => {
  if (data === "") {
    // æ–°å¢žæ ¹èŠ‚ç‚¹
    const newNode = {
      id: Date.now(),
      name: "新节点",
      isEdit: true,
    };
@@ -369,7 +485,7 @@
      }
    });
  } else {
    const hasChildren = data.children && data.children.length > 0;
    const hasChildren = data.children;
    const nodeKey = data.id || data;
    const node = treeRef.value?.getNode(nodeKey);
    const isExpanded = node?.expanded; // å¦‚果有子级且未展开,先展开节点
@@ -383,7 +499,6 @@
      }
    }
    const newNode = {
      id: Date.now(),
      name: "新子节点",
      isEdit: true,
    };
@@ -416,10 +531,22 @@
  }
};
// ç¼–辑归档
const handleEdit = (rows) => {
  row.value = rows;
  dialogVisible.value = true;
  archiveDialogs.value.editForm(rows); // è°ƒç”¨ç¼–辑方法
  try {
    row.value = { ...rows }; // ä½¿ç”¨æ·±æ‹·è´é¿å…å¼•用问题
    dialogVisible.value = true;
    // ç¡®ä¿ç»„件引用存在后再调用方法
    nextTick(() => {
      if (archiveDialogs.value && typeof archiveDialogs.value.editForm === 'function') {
        archiveDialogs.value.editForm(rows); // è°ƒç”¨ç¼–辑方法
      }
    });
  } catch (error) {
    console.error("编辑归档错误:", error);
    ElMessage.error("打开编辑界面失败");
  }
};
// ç§»é™¤æ‡’加载,直接获取数据
src/views/archiveManagement/mould/archiveDialog.vue
@@ -68,6 +68,7 @@
};
// åˆå§‹åŒ–表单数据的辅助函数
const initFormData = (rowData) => {
  console.log("rowData", rowData);
  if (rowData && rowData.id) {
    return copyFormData(rowData);
  }
@@ -97,9 +98,12 @@
  type: [{required: true, message: "请选择文档类型", trigger: "blur"}],
  status: [{required: true, message: "请选择文档状态", trigger: "blur"}],
};
const initTreeDataId = ref(null);
const fileUploadRef = ref(null);
const initForm = () => {
const initForm = (val) => {
  initTreeDataId.value = val.value.id || null; // ç¡®ä¿ initTreeDataId åˆå§‹åŒ–为 null
  ruleForm.value = {};
  ruleForm.value.treeId = val.value.id || null; // ç¡®ä¿ treeId åˆå§‹åŒ–为 null
  nextTick(() => {
    fileUploadRef.value.init();
  });
@@ -145,7 +149,6 @@
    // å‘送 emit äº‹ä»¶
    // å…³é—­å¯¹è¯æ¡†
    ElMessage.success("操作成功");
    centerDialogVisible.value = false;
  } catch (error) {
    ElMessage({
src/views/basicInformation/index.vue
@@ -1,8 +1,12 @@
<template>
  <div>
  <div class="app-container">
    <el-form :inline="true" :model="queryParams" class="search-form">
      <el-form-item v-if="shouldShowSearch" label="搜索">
        <el-input v-model="queryParams.searchAll" :placeholder="searchPlaceholder" clearable/>
        <el-input
          v-model="queryParams.searchAll"
          :placeholder="searchPlaceholder"
          clearable
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="search">查询</el-button>
@@ -11,63 +15,150 @@
    </el-form>
    <el-card>
      <!-- æ ‡ç­¾é¡µ -->
      <el-tabs v-model="activeTab" class="info-tabs" @tab-click="handleTabClick">
        <el-tab-pane v-for="tab in tabs" :key="tab.name" :label="tab.label" :name="tab.name"/>
      <el-tabs
        v-model="activeTab"
        class="info-tabs"
        @tab-click="handleTabClick"
      >
        <el-tab-pane
          v-for="tab in tabs"
          :key="tab.name"
          :label="tab.label"
          :name="tab.name"
        />
      </el-tabs>
      <!-- æ“ä½œæŒ‰é’®åŒº -->
      <el-row :gutter="24" class="table-toolbar">
        <el-button :icon="Plus" type="primary" @click="handleAdd">新建</el-button>
        <el-button :icon="Delete" type="danger" @click="handleDelete">删除</el-button>
        <el-button @click="jump">admins</el-button>
        <el-button v-show="canExport" :icon="Download" type="info" @click="handleExport">导出</el-button>
      </el-row> <!-- è¡¨æ ¼ç»„ä»¶ -->
        <el-button :icon="Plus" type="primary" @click="handleAdd"
          >新建</el-button
        >
        <el-button :icon="Delete" type="danger" @click="handleDelete"
          >删除</el-button
        >
        <el-button
          v-show="canExport"
          :icon="Download"
          type="info"
          @click="handleExport"
          >导出</el-button
        >
      </el-row>
      <!-- è¡¨æ ¼ç»„ä»¶ -->
      <div>
        <data-table :border="true" :columns="columns" :loading="loading"
                    :show-selection="true" :table-data="tableData" @edit="handleEdit" @selection-change="handleSelectionChange">
        <data-table
          :border="true"
          :columns="columns"
          :loading="loading"
          style="width: 100%; height: calc(100vh - 29em)"
          :show-selection="true"
          :table-data="tableData"
          @edit="handleEdit"
          @viewRow="handleView"
          @selection-change="handleSelectionChange"
          :operations="['edit', 'viewRow']"
          :operationsWidth="200"
          :show-overflow-tooltip="false"
        >
          <!-- å­—段名称列的自定义插槽 - æ˜¾ç¤ºä¸ºæ ‡ç­¾ -->
          <template v-if="tabName === 'coalQualityMaintenance'" #fieldIds="{ row }">
            <template v-if="typeof row.fieldIds === 'string' && row.fieldIds.includes(',')">
              <el-tag v-for="(field, index) in row.fieldIds.split(',')" :key="index" size="small" style="margin-right: 4px; margin-bottom: 2px;"
                      type="primary">
          <template
            v-if="tabName === 'coalQualityMaintenance'"
            #fieldIds="{ row }"
          >
            <template
              v-if="
                typeof row.fieldIds === 'string' && row.fieldIds.includes(',')
              "
            >
              <el-tag
                v-for="(field, index) in row.fieldIds.split(',')"
                :key="index"
                size="small"
                style="margin-right: 4px; margin-bottom: 2px"
                type="primary"
              >
                {{ getFieldDisplayName(field.trim()) }}
              </el-tag>
            </template>
            <template v-else>
              <el-tag size="small" type="primary">
                {{ getFieldDisplayName(row.fieldIds) || '--' }}
                {{ getFieldDisplayName(row.fieldIds) || "--" }}
              </el-tag>
            </template>
          </template>
        </data-table>
      </div>
      <pagination v-if="total > 0" :layout="'total, prev, pager, next, jumper'" :limit="pageSizes" :page="pageNum" :total="total"
                  @pagination="handPagination"/>
      <Supplier v-if="tabName === 'supplier'" v-model:copyForm="copyForm"
                v-model:supplierDialogFormVisible="dialogFormVisible" :addOrEdit="addOrEdit" :form="form" :title="title"
                @beforeClose="handleBeforeClose" @submit="handleSubmit"
                @update:dialogFormVisible="handleDialogFormVisible"/>
      <Customer v-if="tabName === 'customer'" v-model:copyForm="copyForm"
                v-model:customerDialogFormVisible="dialogFormVisible" :addOrEdit="addOrEdit" :form="form" :title="title"
                @beforeClose="handleBeforeClose" @submit="handleSubmit"/>
      <Coal v-if="tabName === 'coal'" v-model:coalDialogFormVisible="dialogFormVisible" v-model:copyForm="copyForm"
            :addOrEdit="addOrEdit" :form="form" :title="title" @submit="handleSubmit"/>
      <coalQualityMaintenance v-if="tabName === 'coalQualityMaintenance'" v-model:coalQualityMaintenanceDialogFormVisible="dialogFormVisible"
                              v-model:copyForm="copyForm" :addOrEdit="addOrEdit"
                              :form="form"
                              :title="title" @submit="handleSubmit"/>
      <coalMeiZhiZiDuanWeiHu v-if="tabName === 'coalMeiZhiZiDuanWeiHu'" v-model:coalMaintenanceFieldDialogVisible="dialogFormVisible"
                             v-model:copyForm="copyForm" :addOrEdit="addOrEdit" :form="form"
                             :title="title"
                             @submit="handleSubmit"/>
      <pagination
        v-if="total > 0"
        :layout="'total, prev, pager, next, jumper'"
        :limit="pageSizes"
        :page="pageNum"
        :total="total"
        @pagination="handPagination"
      />
      <Supplier
        v-if="tabName === 'supplier'"
        v-model:copyForm="copyForm"
        v-model:supplierDialogFormVisible="dialogFormVisible"
        :addOrEdit="addOrEdit"
        :form="form"
        :title="title"
        @beforeClose="handleBeforeClose"
        @submit="handleSubmit"
        @update:dialogFormVisible="handleDialogFormVisible"
      />
      <Customer
        v-if="tabName === 'customer'"
        v-model:copyForm="copyForm"
        v-model:customerDialogFormVisible="dialogFormVisible"
        :addOrEdit="addOrEdit"
        :form="form"
        :title="title"
        @beforeClose="handleBeforeClose"
        @submit="handleSubmit"
      />
      <Coal
        v-if="tabName === 'coal'"
        v-model:coalDialogFormVisible="dialogFormVisible"
        v-model:copyForm="copyForm"
        :addOrEdit="addOrEdit"
        :form="form"
        :title="title"
        @submit="handleSubmit"
      />
      <coalQualityMaintenance
        v-if="tabName === 'coalQualityMaintenance'"
        v-model:coalQualityMaintenanceDialogFormVisible="dialogFormVisible"
        v-model:copyForm="copyForm"
        :addOrEdit="addOrEdit"
        :form="form"
        :title="title"
        @submit="handleSubmit"
      />
      <coalMeiZhiZiDuanWeiHu
        v-if="tabName === 'coalMeiZhiZiDuanWeiHu'"
        v-model:coalMaintenanceFieldDialogVisible="dialogFormVisible"
        v-model:copyForm="copyForm"
        :addOrEdit="addOrEdit"
        :form="form"
        :title="title"
        @submit="handleSubmit"
      />
    </el-card>
  </div>
</template>
<script setup>
import {computed, getCurrentInstance, onMounted, reactive, ref, nextTick} from "vue";
import {ElMessage, ElMessageBox} from "element-plus";
import {Delete, Download, Plus} from "@element-plus/icons-vue";
import {
  computed,
  getCurrentInstance,
  onMounted,
  reactive,
  ref,
  nextTick,
} from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { Delete, Download, Plus } from "@element-plus/icons-vue";
// ===== ç»„件导入 =====
import DataTable from "@/components/Table/ETable.vue";
@@ -77,23 +168,34 @@
import Coal from "./mould/coal.vue";
import coalQualityMaintenance from "./mould/coalQualityMaintenance.vue";
import coalMeiZhiZiDuanWeiHu from "./mould/coalMeiZhiZiDuanWeiHu.vue";
import Descriptions from "@/components/dialog/Descriptions.vue";
// ===== API æœåС坼入 =====
import {delSupply, getSupply} from "@/api/basicInformation/supplier.js";
import {delCoalInfo, getCoalInfo} from "@/api/basicInformation/coal.js";
import {testUserList} from "@/api/tool/publicInterface.js";
import {getAreaOptions} from "@/api/system/area.js";
import {delCustomer, getCustomerList} from "@/api/basicInformation/customer.js";
import {coalField, deleteCoalField} from "@/api/basicInformation/coalFieldMaintenance.js";
import {getCoalFieldList, getCoalPlanList} from "@/api/basicInformation/coalQualityMaintenance";
import { delSupply, getSupply } from "@/api/basicInformation/supplier.js";
import { delCoalInfo, getCoalInfo } from "@/api/basicInformation/coal.js";
import { testUserList } from "@/api/tool/publicInterface.js";
import { getAreaOptions } from "@/api/system/area.js";
import {
  delCustomer,
  getCustomerList,
} from "@/api/basicInformation/customer.js";
import {
  coalField,
  deleteCoalField,
} from "@/api/basicInformation/coalFieldMaintenance.js";
import {
  getCoalFieldList,
  getCoalPlanList,
} from "@/api/basicInformation/coalQualityMaintenance";
const {proxy} = getCurrentInstance();
import router from "@/router";
const { proxy } = getCurrentInstance();
// ===== å“åº”式状态管理 =====
const jump = () => {
};
// å¼¹çª—控制状态
const showDialog = ref(false);
const currentViewData = ref({}); // å½“前查看的数据
const dialogFormVisible = ref(false);
const form = ref({});
const title = ref("");
@@ -131,11 +233,11 @@
// æ ‡ç­¾é¡µé…ç½®
const tabs = reactive([
  {name: "supplier", label: "供应商信息"},
  {name: "customer", label: "客户信息"},
  {name: "coal", label: "煤种信息"},
  {name: "coalQualityMaintenance", label: "煤质方案"},
  {name: "coalMeiZhiZiDuanWeiHu", label: "煤质字段"}
  { name: "supplier", label: "供应商信息" },
  { name: "customer", label: "客户信息" },
  { name: "coal", label: "煤种信息" },
  { name: "coalQualityMaintenance", label: "煤质方案" },
  { name: "coalMeiZhiZiDuanWeiHu", label: "煤质字段" },
]);
// ===== å·¥å…·å‡½æ•° =====
@@ -153,7 +255,7 @@
      buildAddressMap(res.data);
    }
  } catch (error) {
    console.error('获取地址选项失败:', error);
    console.error("获取地址选项失败:", error);
  }
};
@@ -164,11 +266,11 @@
 */
const buildAddressMap = (areaData) => {
  const buildMap = (list, pathList = []) => {
    list.forEach(item => {
    list.forEach((item) => {
      const currentPath = [...pathList, item.label];
      addressMap.value[item.id] = {
        name: item.label,
        fullPath: currentPath.join(' / ')
        fullPath: currentPath.join(" / "),
      };
      if (item.children && item.children.length > 0) {
        buildMap(item.children, currentPath);
@@ -185,19 +287,26 @@
 * @description å°†åœ°å€ID数组转换为可读的地址字符串
 */
const formatAddressArray = (addressIds) => {
  if (!addressMap.value || Object.keys(addressMap.value).length === 0 ||
      !addressIds || !Array.isArray(addressIds) || addressIds.length === 0 ||
      addressIds.every(id => !id)) {
    return '--';
  if (
    !addressMap.value ||
    Object.keys(addressMap.value).length === 0 ||
    !addressIds ||
    !Array.isArray(addressIds) ||
    addressIds.length === 0 ||
    addressIds.every((id) => !id)
  ) {
    return "--";
  }
  const addressNames = addressIds.map(id => addressMap.value[id]?.name || '--');
  const addressNames = addressIds.map(
    (id) => addressMap.value[id]?.name || "--"
  );
  if (addressNames.every(name => name === '--')) {
    return '--';
  if (addressNames.every((name) => name === "--")) {
    return "--";
  }
  return addressNames.filter(name => name !== '--').join(' / ');
  return addressNames.filter((name) => name !== "--").join(" / ");
};
/**
@@ -209,12 +318,12 @@
    const res = await testUserList();
    if (res && res.data) {
      userList.value = res.data;
      userList.value.forEach(user => {
      userList.value.forEach((user) => {
        userMap.value[user.userId] = user.username;
      });
    }
  } catch (error) {
    console.error('获取用户列表失败:', error);
    console.error("获取用户列表失败:", error);
  }
};
@@ -224,12 +333,12 @@
 */
const coalFieldData = async () => {
  try {
    const {data, code} = await getCoalFieldList();
    const { data, code } = await getCoalFieldList();
    if (code === 200) {
      coalFieldList.value = data;
    }
  } catch (error) {
    console.error('获取煤质字段数据失败:', error);
    console.error("获取煤质字段数据失败:", error);
  }
};
@@ -240,21 +349,19 @@
 * @description é€šè¿‡å­—段ID匹配对应的字段名称
 */
const getFieldDisplayName = (fieldId) => {
  if (!fieldId) return '--';
  if (!fieldId) return "--";
  const numId = parseInt(fieldId);
  const matchedField = coalFieldList.value.find(item => item.id === numId);
  const matchedField = coalFieldList.value.find((item) => item.id === numId);
  return matchedField ? matchedField.fieldName : numId;
};
// ===== è®¡ç®—属性 =====
/**
 * å½“前标签页是否支持导出功能
 */
const canExport = computed(() => {
  return ['supplier', 'customer'].includes(tabName.value);
  return ["supplier", "customer"].includes(tabName.value);
});
/**
@@ -266,7 +373,7 @@
    customer: "供应商/识别码/详细地址",
    coal: "请输入搜索信息",
    coalQualityMaintenance: "请输入搜索信息",
    coalMeiZhiZiDuanWeiHu: "请输入搜索信息"
    coalMeiZhiZiDuanWeiHu: "请输入搜索信息",
  };
  return placeholderMap[tabName.value] || "请输入搜索信息";
});
@@ -275,7 +382,13 @@
 * æ˜¯å¦æ˜¾ç¤ºæœç´¢æ¡†
 */
const shouldShowSearch = computed(() => {
  return ['supplier', 'customer', 'coal', 'coalQualityMaintenance', 'coalMeiZhiZiDuanWeiHu'].includes(tabName.value);
  return [
    "supplier",
    "customer",
    "coal",
    "coalQualityMaintenance",
    "coalMeiZhiZiDuanWeiHu",
  ].includes(tabName.value);
});
/**
@@ -283,19 +396,14 @@
 */
const selectedCount = computed(() => selectedRows.value.length);
/**
 * æ˜¯å¦æœ‰é€‰ä¸­çš„行
 */
const hasSelectedRows = computed(() => selectedCount.value > 0);
// ===== è¡¨æ ¼åˆ—配置 =====
/**
 * ä¾›åº”商表格列配置
 */
const supplierColumns = ref([
  {prop: "supplierName", label: "供应商名称", minWidth: 100},
  {prop: "taxpayerId", label: "统一人识别号", minWidth: 170},
  { prop: "supplierName", label: "供应商名称", minWidth: 100 },
  { prop: "taxpayerId", label: "统一人识别号", minWidth: 170 },
  {
    prop: "bids",
    label: "经营地址",
@@ -304,12 +412,11 @@
    formatter: (row) => {
      const addressIds = [row.bprovinceId, row.bcityId, row.bdistrictId];
      return formatAddressArray(addressIds);
    }
    },
  },
  {prop: "businessAddress", label: "经营详细地址", minWidth: 150},
  {prop: "bankAccount", label: "开户行", minWidth: 120},
  {prop: "bankName", label: "银行账号", minWidth: 150},
  {prop: "contactPerson", label: "联系人", minWidth: 100},
  { prop: "businessAddress", label: "经营详细地址", minWidth: 150 },
  { prop: "bankAccount", label: "开户行", minWidth: 120 },
  { prop: "contactPerson", label: "联系人", minWidth: 100 },
  {
    prop: "cids",
    label: "联系人地址",
@@ -318,33 +425,36 @@
    formatter: (row) => {
      const addressIds = [row.cprovinceId, row.ccityId, row.cdistrictId];
      return formatAddressArray(addressIds);
    }
    },
  },
  {prop: "contactAddress", label: "联系人详细地址", minWidth: 120},
  {prop: "updateTime", label: "维护日期", minWidth: 120},
  { prop: "contactAddress", label: "联系人详细地址", minWidth: 120 },
]);
/**
 * å®¢æˆ·è¡¨æ ¼åˆ—配置
 */
const customerColumns = ref([
  {prop: "customerName", label: "客户名称", minWidth: 100},
  {prop: "taxpayerId", label: "统一人识别号", minWidth: 120},
  { prop: "customerName", label: "客户名称", minWidth: 100 },
  { prop: "taxpayerId", label: "统一人识别号", minWidth: 120 },
  {
    prop: "bids",
    label: "经营地址",
    minWidth: 150,
    showOverflowTooltip: true,
    formatter: (row) => {
      const addressIds = [row.businessProvinceId, row.businessCityId, row.businessDistrictId];
      const addressIds = [
        row.businessProvinceId,
        row.businessCityId,
        row.businessDistrictId,
      ];
      return formatAddressArray(addressIds);
    }
    },
  },
  {prop: "businessAddress", label: "详细地址", minWidth: 150},
  {prop: "bankName", label: "开户行", minWidth: 120},
  {prop: "bankAccount", label: "银行账号", minWidth: 150},
  {prop: "contactPerson", label: "联系人", minWidth: 100},
  {prop: "contactPhone", label: "联系人电话", minWidth: 100},
  { prop: "businessAddress", label: "详细地址", minWidth: 150 },
  { prop: "bankName", label: "开户行", minWidth: 120 },
  { prop: "bankAccount", label: "银行账号", minWidth: 150 },
  { prop: "contactPerson", label: "联系人", minWidth: 100 },
  { prop: "contactPhone", label: "联系人电话", minWidth: 100 },
  {
    prop: "cids",
    label: "联系人地址",
@@ -353,39 +463,39 @@
    formatter: (row) => {
      const addressIds = [row.provinceId, row.cityId, row.districtId];
      return formatAddressArray(addressIds);
    }
    },
  },
  {prop: "contactAddress", label: "联系人详细地址", minWidth: 150},
  {prop: "updateTime", label: "维护日期", minWidth: 100},
  { prop: "contactAddress", label: "联系人详细地址", minWidth: 150 },
  { prop: "updateTime", label: "维护日期", minWidth: 100 },
]);
/**
 * ç…¤ç§è¡¨æ ¼åˆ—配置
 */
const coalColumns = ref([
  {prop: "coal", label: "煤种名称", minWidth: 200},
  { prop: "coal", label: "煤种名称", minWidth: 200 },
  {
    prop: "maintainerId",
    label: "维护人",
    minWidth: 120,
    formatter: (row, column, cellValue) => {
      if (!userMap.value || Object.keys(userMap.value).length === 0) {
        return '--';
        return "--";
      }
      if (cellValue === null || cellValue === undefined || cellValue === '') {
        return '--';
      if (cellValue === null || cellValue === undefined || cellValue === "") {
        return "--";
      }
      return userMap.value[cellValue] || '--';
    }
      return userMap.value[cellValue] || "--";
    },
  },
  {prop: "maintenanceDate", label: "维护日期", minWidth: 150},
  { prop: "maintenanceDate", label: "维护日期", minWidth: 150 },
]);
/**
 * ç…¤è´¨æ–¹æ¡ˆè¡¨æ ¼åˆ—配置
 */
const coalQualityMaintenanceColumns = ref([
  {prop: "plan", label: "方案名称", minWidth: 100},
  { prop: "plan", label: "方案名称", minWidth: 100 },
  {
    prop: "fieldIds",
    label: "字段名称",
@@ -394,20 +504,20 @@
    slot: true,
    formatter: (row, column, cellValue) => {
      if (Array.isArray(cellValue)) {
        return cellValue.map(item => item);
        return cellValue.map((item) => item);
      }
      return cellValue || '--';
    }
      return cellValue || "--";
    },
  },
  {prop: "schemeDesc", label: "字段描述", minWidth: 100},
  { prop: "schemeDesc", label: "字段描述", minWidth: 100 },
]);
/**
 * ç…¤è´¨å­—段表格列配置
 */
const coalMeiZhiZiDuanWeiHuColumns = ref([
  {prop: "fieldName", label: "字段名称", minWidth: 200},
  {prop: "fieldDescription", label: "字段描述", minWidth: 200},
  { prop: "fieldName", label: "字段名称", minWidth: 200 },
  { prop: "fieldDescription", label: "字段描述", minWidth: 200 },
]);
// ===== äº‹ä»¶å¤„理函数 =====
@@ -449,7 +559,7 @@
    coalMeiZhiZiDuanWeiHu: () => {
      columns.value = coalMeiZhiZiDuanWeiHuColumns.value;
      getList();
    }
    },
  };
  // æ‰§è¡Œå¯¹åº”的配置函数
@@ -495,17 +605,22 @@
 * @description æ ¹æ®æ ‡ç­¾é¡µç±»åž‹è®¾ç½®å¼¹çª—标题并打开弹窗
 */
const handleAddEdit = (currentTabName) => {
  const actionText = addOrEdit.value === "add" ? "新增" : "编辑";
  const actionText =
    addOrEdit.value === "add"
      ? "新增"
      : addOrEdit.value === "edit"
      ? "编辑"
      : "查看";
  const tabTitleMap = {
    supplier: "供应商信息",
    customer: "客户信息",
    coal: "煤种信息",
    coalQualityMaintenance: "煤质方案维护",
    coalMeiZhiZiDuanWeiHu: "煤质字段维护"
    coalMeiZhiZiDuanWeiHu: "煤质字段维护",
  };
  title.value = `${actionText}${tabTitleMap[currentTabName] || ''}`;
  title.value = `${actionText}${tabTitleMap[currentTabName] || ""}`;
  openDialog();
};
@@ -514,7 +629,7 @@
 * @description æ ¹æ®ç¼–辑状态决定是否复制表单数据
 */
const openDialog = () => {
  if (addOrEdit.value === "edit") {
  if (addOrEdit.value === "edit" || addOrEdit.value === "viewRow") {
    copyForm.value = JSON.parse(JSON.stringify(form.value));
  } else {
    form.value = {};
@@ -580,8 +695,16 @@
  }
  // æž„建客户业务地址数组
  if (form.value.businessCityId && form.value.businessDistrictId && form.value.businessProvinceId) {
    form.value.bids = [row.businessProvinceId, row.businessCityId, row.businessDistrictId];
  if (
    form.value.businessCityId &&
    form.value.businessDistrictId &&
    form.value.businessProvinceId
  ) {
    form.value.bids = [
      row.businessProvinceId,
      row.businessCityId,
      row.businessDistrictId,
    ];
  }
  // æž„建客户联系地址数组
@@ -593,6 +716,7 @@
  handleAddEdit(tabName.value);
};
/**
 * æ‰¹é‡åˆ é™¤å¤„理
 * @description æ‰¹é‡åˆ é™¤é€‰ä¸­çš„记录
@@ -603,7 +727,7 @@
    return;
  }
  const deleteIds = selectedRows.value.map(item => item.id);
  const deleteIds = selectedRows.value.map((item) => item.id);
  try {
    await ElMessageBox.confirm("确定删除选中的数据吗?", "提示", {
@@ -616,10 +740,10 @@
      supplier: delSupply,
      coal: delCoalInfo,
      coalQualityMaintenance: () => {
        throw new Error('delCoalQuality API not imported');
        throw new Error("delCoalQuality API not imported");
      },
      customer: delCustomer,
      coalMeiZhiZiDuanWeiHu: deleteCoalField
      coalMeiZhiZiDuanWeiHu: deleteCoalField,
    };
    const deleteApi = deleteApiMap[tabName.value];
@@ -627,7 +751,7 @@
      ElMessage.error("删除接口未配置");
      return;
    }
    console.log(deleteIds)
    console.log(deleteIds);
    const res = await deleteApi(deleteIds);
    if (res.code !== 200 && res.msg !== "操作成功") {
@@ -638,8 +762,8 @@
    ElMessage.success("删除成功");
    await getList();
  } catch (error) {
    if (error.message !== 'cancel') {
      console.error('删除操作失败:', error);
    if (error.message !== "cancel") {
      console.error("删除操作失败:", error);
      ElMessage.error("删除失败,请稍后再试");
    } else {
      ElMessage.info("已取消删除操作");
@@ -662,10 +786,10 @@
 */
const handleExport = () => {
  const exportConfig = {
    supplier: {api: "/supply/export", name: "供应商信息"},
    customer: {api: "/customer/export", name: "客户信息"},
    coal: {api: "/supply/export", name: "煤种信息"},
    coalQualityMaintenance: {api: "/supply/export", name: "煤质维护信息"}
    supplier: { api: "/supply/export", name: "供应商信息" },
    customer: { api: "/customer/export", name: "客户信息" },
    coal: { api: "/supply/export", name: "煤种信息" },
    coalQualityMaintenance: { api: "/supply/export", name: "煤质维护信息" },
  };
  const config = exportConfig[tabName.value];
@@ -680,7 +804,11 @@
 * @param {string} name - å¯¼å‡ºæ–‡ä»¶åå‰ç¼€
 */
const exportData = (api, name) => {
  proxy.download(api, {...queryParams}, `${name}${new Date().getTime()}.xlsx`);
  proxy.download(
    api,
    { ...queryParams },
    `${name}${new Date().getTime()}.xlsx`
  );
  ElMessage.success("导出数据:" + name);
};
// ===== æ•°æ®èŽ·å–å‡½æ•° =====
@@ -702,11 +830,13 @@
    customer: () => getCustomerList(apiParams),
    coal: () => getCoalInfo(apiParams),
    coalQualityMaintenance: () => getCoalPlanList(apiParams),
    coalMeiZhiZiDuanWeiHu: () => coalField(apiParams)
    coalMeiZhiZiDuanWeiHu: () => coalField(apiParams),
  };
  const apiFunction = apiMap[tabName.value];
  return apiFunction ? apiFunction() : Promise.reject(new Error('未找到对应的API接口'));
  return apiFunction
    ? apiFunction()
    : Promise.reject(new Error("未找到对应的API接口"));
};
/**
@@ -716,22 +846,56 @@
const getList = async () => {
  try {
    loading.value = true;
    const {data, code} = await selectInterface();
    const { data, code } = await selectInterface();
    if (code !== 200) {
      ElMessage.error("获取数据失败:" + (data?.msg || '未知错误'));
      ElMessage.error("获取数据失败:" + (data?.msg || "未知错误"));
      return;
    }
    tableData.value = data.records || [];
    total.value = data.total || 0;
  } catch (error) {
    console.error('获取列表数据失败:', error);
    console.error("获取列表数据失败:", error);
    ElMessage.error("获取数据失败,请稍后再试");
  } finally {
    loading.value = false;
  }
};
const handleView = (row) => {
  form.value = JSON.parse(JSON.stringify(row));
  // æž„建供应商业务地址数组
  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);
};
// ===== ç”Ÿå‘½å‘¨æœŸé’©å­ =====
@@ -742,12 +906,12 @@
  try {
    // å¹¶è¡Œæ‰§è¡Œåˆå§‹åŒ–操作
    await Promise.all([
      handleTabClick({props: {name: "supplier"}}),
      handleTabClick({ props: { name: "supplier" } }),
      fetchAreaOptions(),
      getUserList()
      getUserList(),
    ]);
  } catch (error) {
    console.error('组件初始化失败:', error);
    console.error("组件初始化失败:", error);
    ElMessage.error("页面初始化失败,请刷新重试");
  }
});
@@ -802,4 +966,4 @@
.main-container {
  background: red !important;
}
</style>
</style>
src/views/basicInformation/mould/coal.vue
@@ -18,6 +18,7 @@
          <el-input
              v-model="formData.coal"
              placeholder="请输入煤种名称"
              :disabled="isViewMode"
          />
        </el-form-item>
        <el-form-item label="维护人姓名" prop="maintainerId">
@@ -73,6 +74,7 @@
    default: ''
  },
})
const isViewMode = computed(() => props.addOrEdit.includes("viewRow"));
const copyForm = defineModel("copyForm", {
  required: true,
  type: Object,
src/views/basicInformation/mould/coalMeiZhiZiDuanWeiHu.vue
@@ -18,10 +18,11 @@
          <el-input
              v-model="formData.fieldName"
              placeholder="请输入字段名称"
              :disabled="isViewMode"
          />
        </el-form-item>
        <el-form-item label="字段描述" prop="fieldDescription">
          <el-input v-model="formData.fieldDescription" type="textarea" placeholder="请输入字段描述"/>
          <el-input v-model="formData.fieldDescription" type="textarea" placeholder="请输入字段描述" :disabled="isViewMode"/>
        </el-form-item>
        <el-form-item class="dialog-footer">
          <el-button v-if="addOrEdit === 'edit'" @click="resetForm"
@@ -57,6 +58,9 @@
    default: "",
  },
});
const isViewMode = computed(() => {
  return props.addOrEdit.includes("view");
});
const copyForm = defineModel("copyForm", {
  required: true,
  type: Object,
src/views/basicInformation/mould/coalQualityMaintenance.vue
@@ -7,20 +7,20 @@
             style="max-width: 400px; margin: 0 auto">
      <!-- æ–¹æ¡ˆåç§°è¾“入框 -->
      <el-form-item label="煤质方案名称" prop="plan">
        <el-input v-model="formData.plan" placeholder="请输入煤质方案名称" clearable/>
        <el-input v-model="formData.plan" placeholder="请输入煤质方案名称" clearable :disabled="isViewMode"/>
      </el-form-item>
      <!-- ç…¤è´¨å­—段多选下拉框 -->
      <el-form-item label="煤质方案类型" prop="coalFieldList">
        <el-select v-model="formData.coalFieldList" placeholder="请选择煤质方案类型" style="width: 100%" clearable
                   multiple>
                   multiple :disabled="isViewMode">
          <el-option v-for="item in fieldOptions" :key="item.id" :label="item.label" :value="item"/>
        </el-select>
      </el-form-item>
      <!-- æ–¹æ¡ˆæè¿°æ–‡æœ¬åŸŸ -->
      <el-form-item label="煤质方案描述" prop="schemeDesc">
        <el-input v-model="formData.schemeDesc" type="textarea" placeholder="请输入煤质方案描述" :rows="3"/>
        <el-input v-model="formData.schemeDesc" type="textarea" placeholder="请输入煤质方案描述" :rows="3" :disabled="isViewMode"/>
      </el-form-item>
      <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
@@ -60,6 +60,7 @@
    default: "",
  },
});
const isViewMode = computed(() => props.addOrEdit.includes("view"));
const copyForm = defineModel("copyForm", {
  required: true,
  type: Object,
src/views/basicInformation/mould/customer.vue
@@ -5,41 +5,41 @@
      <el-form ref="formRef" style="max-width: 400px; margin: 0 auto" :model="formData" :rules="rules"
               label-width="auto">
        <el-form-item label="客户名称" prop="customerName">
          <el-input v-model="formData.customerName" placeholder="请输入客户名称"/>
          <el-input v-model="formData.customerName" placeholder="请输入客户名称" :disabled="isViewMode"/>
        </el-form-item>
        <el-form-item label="纳税人识别号" prop="taxpayerId">
          <el-input v-model="formData.taxpayerId" placeholder="请输入纳税人识别号"/>
          <el-input v-model="formData.taxpayerId" placeholder="请输入纳税人识别号" :disabled="isViewMode"/>
        </el-form-item>
        <el-form-item label="经营地址" prop="bids">
          <el-cascader placeholder="请选择经营地址" size="default" :options="addressSelectOptions"
                       v-model="formData.bids"
                       :props="cascaderProps" @change="handleChange">
                       :props="cascaderProps" @change="handleChange" :disabled="isViewMode">
          </el-cascader>
        </el-form-item>
        <el-form-item label="经营详细地址" prop="businessAddress">
          <el-input v-model="formData.businessAddress" placeholder="请输入经营详细地址"/>
          <el-input v-model="formData.businessAddress" placeholder="请输入经营详细地址" :disabled="isViewMode"/>
        </el-form-item>
        <el-form-item label="开户行" prop="bankName">
          <el-input v-model="formData.bankName" placeholder="请输入开户行"/>
          <el-input v-model="formData.bankName" placeholder="请输入开户行" :disabled="isViewMode"/>
        </el-form-item>
        <el-form-item label="银行账户" prop="bankAccount">
          <el-input v-model="formData.bankAccount" placeholder="请输入银行账户"/>
          <el-input v-model="formData.bankAccount" placeholder="请输入银行账户" :disabled="isViewMode"/>
        </el-form-item>
        <el-form-item label="联系人" prop="contactPerson">
          <el-input v-model="formData.contactPerson" placeholder="请输入联系人"/>
          <el-input v-model="formData.contactPerson" placeholder="请输入联系人" :disabled="isViewMode"/>
        </el-form-item>
        <el-form-item label="联系电话" prop="contactPhone">
          <el-input v-model="formData.contactPhone" placeholder="请输入联系电话"/>
          <el-input v-model="formData.contactPhone" placeholder="请输入联系电话" :disabled="isViewMode"/>
        </el-form-item>
        <el-form-item label="联系人地址" prop="cids">
          <el-cascader placeholder="请选择联系人地址" size="default" :options="addressSelectOptions"
                       v-model="formData.cids"
                       :props="cascaderProps" @change="handleChange">
                       :props="cascaderProps" @change="handleChange" :disabled="isViewMode">
          </el-cascader>
        </el-form-item>
        <el-form-item label="联系人详细" prop="contactAddress">
          <el-input v-model="formData.contactAddress" placeholder="请输入联系人详细地址"/>
          <el-input v-model="formData.contactAddress" placeholder="请输入联系人详细地址" :disabled="isViewMode"/>
        </el-form-item>
        <el-form-item class="dialog-footer">
          <el-button v-if="addOrEdit === 'edit'" @click="resetForm">重置</el-button>
@@ -56,7 +56,6 @@
<script setup>
import {ref, watch, onMounted} from "vue";
import {getAreaOptions} from "@/api/system/area.js";
import addressList from "@/api/jsonApi/areaList.json";
import {addOrEditCustomer} from "@/api/basicInformation/customer";
const props = defineProps({
@@ -78,7 +77,7 @@
    default: "",
  },
});
const isViewMode = computed(() => props.addOrEdit.includes("viewRow"));
const handleChange = (value) => {
  console.log(value);
};
src/views/basicInformation/mould/supplier.vue
@@ -1,48 +1,135 @@
<template>
  <div>
    <el-dialog v-model="dialogVisible" :title="title" width="600" :close-on-click-modal="false"
               :before-close="handleClose">
      <el-form ref="formRef" style="max-width: 400px; margin: 0 auto" :model="formData" :rules="rules"
               label-width="auto">
        <el-form-item label="供应商名称" prop="supplierName">
          <el-input v-model="formData.supplierName" placeholder="请输入供货商名称"/>
    <el-dialog
      v-model="dialogVisible"
      :title="title"
      width="600"
      :close-on-click-modal="false"
      :before-close="handleClose"
    >
      <el-form
        ref="formRef"
        style="max-width: 400px; margin: 0 auto"
        :model="formData"
        :rules="rules"
        label-width="auto"
      >        <el-form-item
          label="供应商名称"
          prop="supplierName"
        >
          <el-input
            v-model="formData.supplierName"
            placeholder="请输入供货商名称"
            :disabled="isViewMode"
          />
        </el-form-item>
        <el-form-item label="纳税人识别号" prop="taxpayerId">
          <el-input v-model="formData.taxpayerId" placeholder="请输入纳税人识别号"/>
        <el-form-item
          label="纳税人识别号"
          prop="taxpayerId"
        >
          <el-input
            v-model="formData.taxpayerId"
            placeholder="请输入纳税人识别号"
            :disabled="isViewMode"
          />
        </el-form-item>
        <el-form-item label="经营地址" prop="bids">
          <el-cascader placeholder="请选择经营地址" size="default" :options="addressSelectOptions"
                       v-model="formData.bids"
                       :props="cascaderProps" @change="handleChange">
        <el-form-item
          label="经营地址"
          prop="bids"
        >
          <el-cascader
            placeholder="请选择经营地址"
            size="default"
            :options="addressSelectOptions"
            v-model="formData.bids"
            :props="cascaderProps"
            @change="handleChange"
            :disabled="isViewMode"
          >
          </el-cascader>
        </el-form-item>
        <el-form-item label="详细地址" prop="businessAddress">
          <el-input v-model="formData.businessAddress" placeholder="请输入客户详细地址"/>
        <el-form-item
          label="详细地址"
          prop="businessAddress"
        >
          <el-input
            v-model="formData.businessAddress"
            placeholder="请输入客户详细地址"
            :disabled="isViewMode"
          />
        </el-form-item>
        <el-form-item label="开户行" prop="bankAccount">
          <el-input v-model="formData.bankAccount" placeholder="请输入开户行"/>
        <el-form-item
          label="开户行"
          prop="bankAccount"
        >
          <el-input
            v-model="formData.bankAccount"
            placeholder="请输入开户行"
            :disabled="isViewMode"
          />
        </el-form-item>
        <el-form-item label="银行账户" prop="bankName">
          <el-input v-model="formData.bankName" placeholder="请输入银行账户"/>
        <el-form-item
          label="银行账户"
          prop="bankName"
        >
          <el-input
            v-model="formData.bankName"
            placeholder="请输入银行账户"
            :disabled="isViewMode"
          />
        </el-form-item>
        <el-form-item label="联系人" prop="contactPerson">
          <el-input v-model="formData.contactPerson" placeholder="请输入联系人"/>
        <el-form-item
          label="联系人"
          prop="contactPerson"
        >
          <el-input
            v-model="formData.contactPerson"
            placeholder="请输入联系人"
            :disabled="isViewMode"
          />
        </el-form-item>
        <el-form-item label="联系人电话" prop="contactPhone">
          <el-input v-model="formData.contactPhone" placeholder="请输入联系人电话"/>
        <el-form-item
          label="联系人电话"
          prop="contactPhone"
        >
          <el-input
            v-model="formData.contactPhone"
            placeholder="请输入联系人电话"
            :disabled="isViewMode"
          />
        </el-form-item>
        <el-form-item label="联系人地址" prop="cids">
          <el-cascader placeholder="请选择联系人地址" size="default" :options="addressSelectOptions"
                       v-model="formData.cids"
                       :props="cascaderProps" @change="handleChange">
        <el-form-item
          label="联系人地址"
          prop="cids"
        >
          <el-cascader
            placeholder="请选择联系人地址"
            size="default"
            :options="addressSelectOptions"
            v-model="formData.cids"
            :props="cascaderProps"
            @change="handleChange"
            :disabled="isViewMode"
          >
          </el-cascader>
        </el-form-item>
        <el-form-item label="联系人详细地址" prop="contactAddress">
          <el-input v-model="formData.contactAddress" placeholder="请输入联系人地址"/>
        <el-form-item
          label="联系人详细地址"
          prop="contactAddress"
        >
          <el-input
            v-model="formData.contactAddress"
            placeholder="请输入联系人地址"
            :disabled="isViewMode"
          />
        </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 v-if="addOrEdit === 'edit'" @click="resetForm"
            >重置</el-button
          >
          <el-button v-if="addOrEdit !== 'edit'" @click="cancelForm"
            >取消</el-button
          >
          <el-button type="primary" @click="submitForm"> ç¡®å®š</el-button>
        </el-form-item>
      </el-form>
@@ -51,15 +138,14 @@
</template>
<script setup>
import {ref, watch, defineProps, onMounted} from "vue";
import {addOrEditSupply} from "@/api/basicInformation/supplier";
import {getAreaOptions} from "@/api/system/area.js";
import { ref, watch, defineProps, onMounted, computed, reactive } from "vue";
import { addOrEditSupply } from "@/api/basicInformation/supplier";
import { getAreaOptions } from "@/api/system/area.js";
const props = defineProps({
  beforeClose: {
    type: Function,
    default: () => {
    },
    default: () => {},
  },
  form: {
    type: Object,
@@ -75,21 +161,24 @@
  },
});
// è®¡ç®—属性:统一控制是否禁用
const isViewMode = computed(() => props.addOrEdit === 'viewRow');
const emit = defineEmits(["submit", "handleBeforeClose"]);
const copyForm = defineModel("copyForm", {
  required: true,
  type: Object,
});
onMounted(() => {
  fetchAreaOptions()
})
  fetchAreaOptions();
});
// ä¿®æ”¹æ ‘形选择的映射
const cascaderProps = ref({
  value: 'id', // æŒ‡å®švalue字段为id
  label: 'label', // æŒ‡å®šlabel字段
  children: 'children' // æŒ‡å®šå­èŠ‚ç‚¹å­—æ®µ
})
  value: "id", // æŒ‡å®švalue字段为id
  label: "label", // æŒ‡å®šlabel字段
  children: "children", // æŒ‡å®šå­èŠ‚ç‚¹å­—æ®µ
});
// åœ°å€é€‰æ‹©æ•°æ®
const addressSelectOptions = ref([]);
@@ -100,21 +189,21 @@
  if (res.code === 200) {
    addressSelectOptions.value = res.data;
  }
}
};
// å¤„理地址数据转换
function mapAddress(list) {
  return list.map(item => ({
  return list.map((item) => ({
    value: item.id,
    label: item.name,
    children: item.children ? mapAddress(item.children) : undefined
    children: item.children ? mapAddress(item.children) : undefined,
  }));
}
// è¡¨å•引用
const formRef = ref(null);
// è¡¨å•数据
const formData = ref({...props.form});
const formData = ref({ ...props.form });
// å¼¹çª—可见性
const dialogVisible = defineModel("supplierDialogFormVisible", {
  required: true,
@@ -122,19 +211,19 @@
});
// ç›‘听外部传入的表单数据变化
watch(
    () => props.form,
    (newVal) => {
      formData.value = {...newVal};
    },
    {deep: true}
  () => props.form,
  (newVal) => {
    formData.value = { ...newVal };
  },
  { deep: true }
);
// ç›‘听内部弹窗状态变化
watch(
    () => dialogVisible.value,
    (newVal) => {
      emit("update:supplierDialogFormVisible", newVal);
    }
  () => dialogVisible.value,
  (newVal) => {
    emit("update:supplierDialogFormVisible", newVal);
  }
);
// å¤„理地址选择变化
const handleChange = (value) => {
@@ -146,23 +235,23 @@
  await formRef.value.validate(async (valid, fields) => {
    if (valid) {
      const obj = ref({});
      if (props.title.includes('新增')) {
      if (props.title.includes("新增")) {
        let result = await addOrEditSupply({
          ...formData.value,
        })
        });
        obj.value = {
          title: "新增",
          ...formData.value,
          result
          result,
        };
      } else {
        let result = await addOrEditSupply({
          ...formData.value,
        })
        });
        obj.value = {
          title: "编辑",
          ...formData.value,
          result
          result,
        };
      }
      emit("submit", obj.value);
@@ -187,11 +276,11 @@
};
const rules = reactive({
  supplierName: [
    {required: true, message: "请输入供货商名称", trigger: "blur"},
    { required: true, message: "请输入供货商名称", trigger: "blur" },
  ],
  taxpayerId: [
    {required: true, message: "请正确输入纳税人识别号", trigger: "blur"},
    {min: 17, max: 20, message: "请输入17-20位纳税人识别号", trigger: "blur"},
    { required: true, message: "请正确输入纳税人识别号", trigger: "blur" },
    { min: 17, max: 20, message: "请输入17-20位纳税人识别号", trigger: "blur" },
  ],
  // bids: [
  //   {
@@ -200,12 +289,12 @@
  //     trigger: "change",
  //   },
  // ],
  bankName: [{required: true, message: "请输入银行账户", trigger: "blur"}],
  bankAccount: [{required: true, message: "请输入开户行", trigger: "blur"}],
  contactPerson: [{required: true, message: "联系人", trigger: "blur"}],
  bankName: [{ required: true, message: "请输入银行账户", trigger: "blur" }],
  bankAccount: [{ required: true, message: "请输入开户行", trigger: "blur" }],
  contactPerson: [{ required: true, message: "联系人", trigger: "blur" }],
  contactPhone: [
    {required: true, message: "请输入联系人", trigger: "blur"},
    {min: 11, max: 11, message: "请输入11位联系人电话", trigger: "blur"},
    { required: true, message: "请输入联系人", trigger: "blur" },
    { min: 11, max: 11, message: "请输入11位联系人电话", trigger: "blur" },
  ],
});
</script>
@@ -216,4 +305,4 @@
  margin-top: 20px;
  flex-direction: column;
}
</style>
</style>
src/views/inspectionManagement/index.vue
@@ -50,14 +50,14 @@
                  @selection-change="handleSelectionChange"
                  :show-selection="true"
                  :border="true"
                  :maxHeight="480"
                  style="width: 100%;height: calc(100vh - 30em)"
                  operationsWidth="130"
                  :operations="operationsArr"
                  @edit="handleAdd"
                  @viewFile="viewFile"
                  v-if="tabName !== 'qrCodeScanRecord'"
          ></ETable>
          <el-table ref="table" :data="tableData" height="480" v-loading="tableLoading" v-else>
          <el-table ref="table" :data="tableData" height="480" v-loading="tableLoading" border v-else style="width: 100%;height: calc(100vh - 27em)">
            <el-table-column label="序号" type="index" width="60" align="center" />
            <el-table-column prop="deviceName" label="设备名称" :show-overflow-tooltip="true">
              <template #default="scope">
src/views/inspectionUpload/index.vue
@@ -54,7 +54,7 @@
          </div>
        </div>
        <div>
          <el-table ref="table" :data="tableData" height="480" v-loading="tableLoading" v-if="activeTab !== 'qrCode'">
          <el-table ref="table" :data="tableData" height="480" v-loading="tableLoading" v-if="activeTab !== 'qrCode'" border style="width: 100%;height: calc(100vh - 20em)">
            <el-table-column label="序号" type="index" width="60" align="center" />
            <el-table-column prop="taskName" label="巡检任务名称" :show-overflow-tooltip="true"></el-table-column>
            <el-table-column prop="port" label="地点" :show-overflow-tooltip="true"></el-table-column>
@@ -66,7 +66,7 @@
              </template>
            </el-table-column>
          </el-table>
          <el-table ref="table" :data="tableData" height="480" v-loading="tableLoading" v-if="activeTab === 'qrCode'">
          <el-table ref="table" :data="tableData" height="480" v-loading="tableLoading" v-if="activeTab === 'qrCode'" border style="width: 100%;height: calc(100vh - 23em)">
            <el-table-column label="序号" type="index" width="60" align="center" />
            <el-table-column prop="deviceName" label="设备名称" :show-overflow-tooltip="true">
              <template #default="scope">
src/views/procureMent/components/ProductionDialog.vue
@@ -17,12 +17,12 @@
          style="max-width: 400px; margin: 0 auto"
      >
        <el-form-item label="供应商名称" prop="supplierId">
          <el-select v-model="form.supplierId" placeholder="请选择供应商">
          <el-select v-model="form.supplierId" placeholder="请选择供应商" :disabled="isViewMode">
            <el-option :label="item.label" v-for="item in supplyList" :key="item.value" :value="item.value"/>
          </el-select>
        </el-form-item>
        <el-form-item label="煤种" prop="coalId">
          <el-select v-model="form.coalId" placeholder="请选择煤种">
          <el-select v-model="form.coalId" placeholder="请选择煤种" :disabled="isViewMode">
            <el-option :label="item.label" v-for="item in coalList" :key="item.value" :value="item.value"/>
          </el-select>
        </el-form-item>
@@ -31,18 +31,19 @@
              v-model.number="form.purchaseQuantity"
              placeholder="请输入"
              @blur="handleQuantityBlur"
              :disabled="isViewMode"
          >
            <template v-slot:suffix>
              <i style="font-style: normal">吨</i>
            </template>
          </el-input>
        </el-form-item
        >
        </el-form-item>
        <el-form-item label="税率" prop="taxRate">
          <el-input
              v-model.number="form.taxRate"
              placeholder="请输入税率"
              @blur="handleTaxRateBlur"
              :disabled="isViewMode"
          >
            <template v-slot:suffix>
              <i style="font-style: normal">%</i>
@@ -54,6 +55,7 @@
              v-model.number="form.priceExcludingTax"
              placeholder="请输入"
              @blur="handlePriceBlur"
              :disabled="isViewMode"
          >
            <template v-slot:suffix>
              <i style="font-style: normal">元</i>
@@ -64,6 +66,7 @@
          <el-input
              v-model.number="form.priceIncludingTax"
              placeholder="自动计算"
              :disabled="isViewMode"
          >
            <template v-slot:suffix>
              <i style="font-style: normal">元</i>
@@ -74,6 +77,7 @@
          <el-input
              v-model.number="form.totalPriceExcludingTax"
              placeholder="自动计算"
              :disabled="isViewMode"
          >
            <template v-slot:suffix>
              <i style="font-style: normal">元</i>
@@ -84,6 +88,7 @@
          <el-input
              v-model.number="form.totalPriceIncludingTax"
              placeholder="自动计算"
              :disabled="isViewMode"
          >
            <template v-slot:suffix>
              <i style="font-style: normal">元</i>
@@ -149,6 +154,7 @@
});
const supplyList = ref([]);
const coalList = ref([]);
const isViewMode = computed(() => props.title.includes("查看"));
// èŽ·å–ä¾›åº”å•†ä¸‹æ‹‰å’Œç…¤ç§ä¸‹æ‹‰
const getDropdownData = async () => {
  try {
src/views/procureMent/index.vue
@@ -35,7 +35,11 @@
        @delete="handleDeleteSuccess"
        :show-selection="true"
        :border="true"
        :maxHeight="440"
        style="width: 100%; height: calc(100vh - 26em)"
        @viewRow="handleView"
        :operations="['edit', 'viewRow']"
        :operationsWidth="200"
        :show-overflow-tooltip="false"
      />
      <pagination
        v-if="total > 0"
@@ -150,7 +154,7 @@
const MatchQuery = (data, name) => {
  const list = name === "supplyRes" ? supplyRes.value.data : coalRes.value.data;
  const item = list.find((items) => items.id == data);
  return item ? item.coal || item.supplierName  : "";
  return item ? item.coal || item.supplierName : "";
};
// èŽ·å–ä¾›åº”å•†åˆ—è¡¨
const supplyRes = ref([]);
@@ -177,13 +181,13 @@
const productionDialogs = ref(null); // æ·»åŠ ref声明
const handleAddEdit = () => {
  addOrEdit.value == "add" ? (title.value = "新增") : (title.value = "编辑");
  addOrEdit.value == "add" ? (title.value = "新增") : addOrEdit.value == "viewRow" ? (title.value = "查看") : (title.value = "编辑");
  title.value = title.value + "采购信息";
  openDialog();
};
// æ‰“开弹窗
const openDialog = () => {
  if (addOrEdit.value === "edit") {
  if (addOrEdit.value === "edit" || addOrEdit.value === "viewRow") {
    // ç¡®ä¿å¤åˆ¶ä¸€ä»½æ•°æ®ï¼Œé¿å…ç›´æŽ¥å¼•用
    copyForm.value = JSON.parse(JSON.stringify(form.value));
    dialogFormVisible.value = true;
@@ -229,6 +233,11 @@
  addOrEdit.value = "edit";
  handleAddEdit();
};
const handleView = (row) => {
  form.value = JSON.parse(JSON.stringify(row));
  addOrEdit.value = "viewRow";
  handleAddEdit();
};
const handleDelete = () => {
  if (selectedRows.value.length === 0) {
    ElMessage.warning("请选择要删除的数据");
src/views/production/components/ProductionDetailsTable.vue
@@ -9,6 +9,7 @@
            @change="(value) => handleCoalSelectChange(row, value)"
            filterable
            :key="`coalId-select-${$index}-${weekList.length}`"
            :disabled="isViewMode"
        >
          <el-option
              v-for="(item, index) of weekList"
@@ -26,6 +27,7 @@
            placeholder="请输入生产数量"
            type="number"
            @input="handleInput('productionQuantity', $index, $event)"
            :disabled="isViewMode"
        />
      </template>
    </el-table-column>
@@ -37,6 +39,7 @@
            placeholder="请输入人工成本"
            type="number"
            @input="handleInput('laborCost', $index, $event)"
            :disabled="isViewMode"
        >
          <template #suffix>
            <i style="font-style: normal">元</i>
@@ -52,6 +55,7 @@
            placeholder="请输入能耗成本"
            type="number"
            @input="handleInput('energyConsumptionCost', $index, $event)"
            :disabled="isViewMode"
        >
          <template #suffix>
            <i style="font-style: normal">元</i>
@@ -67,6 +71,7 @@
            placeholder="请输入设备折旧"
            type="number"
            @input="handleInput('equipmentDepreciation', $index, $event)"
            :disabled="isViewMode"
        >
          <template #suffix>
            <i style="font-style: normal">元</i>
@@ -82,6 +87,7 @@
            placeholder="请输入采购单价"
            type="number"
            @input="handleInput('purchasePrice', $index, $event)"
            :disabled="isViewMode"
        >
          <template #suffix>
            <i style="font-style: normal">元</i>
@@ -99,6 +105,7 @@
            type="number"
            :readonly="autoCalculate"
            @input="handleInput('totalCost', $index, $event)"
        >
          <template #suffix>
            <i style="font-style: normal">元</i>
@@ -110,11 +117,12 @@
      <template #default="{ row, $index }">
        <el-select
            clearable
            :model-value="getUserNameById(row.producer) || row.producer"
            :model-value="getUserNameById(row.producerId) || row.producerId"
            placeholder="请选择生产人"
            @change="(value) => handleUserSelectChange(row, value)"
            filterable
            :key="`producer-select-${$index}-${userList.length}`"
            :disabled="isViewMode"
        >
          <el-option
              v-for="(item, index) of userList"
@@ -126,10 +134,10 @@
      </template>
    </el-table-column>
    <el-table-column
        v-if="showOperations"
        label="操作"
        width="120"
        fixed="right"
        v-if="dialogType !== 'viewRow'"
    >
      <template #default="{ $index }">
        <el-button
@@ -169,8 +177,12 @@
    type: Boolean,
    default: true,
  },
  dialogType:{
    type: String,
    default:'add'
  }
});
const isViewMode = computed(() => props.dialogType === "viewRow");
const emit = defineEmits(["update:modelValue", "input-change", "delete-row"]);
// ä½¿ç”¨ v-model è¿›è¡ŒåŒå‘绑定
@@ -339,12 +351,13 @@
};
// å¤„理用户选择变化(新方法:名称选择转ID)
const handleUserSelectChange = (row, selectedName) => {
  console.log("handleUserSelectChange", row, selectedName);
  // æ ¹æ®é€‰æ‹©çš„名称找到对应的ID
  const userItem = userList.value.find(item => item.value === selectedName);
  if (userItem) {
    row.producer = userItem.key; // è®¾ç½®ä¸ºID
    row.producerId = userItem.key; // è®¾ç½®ä¸ºID
  } else {
    row.producer = ''; // å¦‚果没找到,清空
    row.producerId = ''; // å¦‚果没找到,清空
  }
};
// æš´éœ²æ–¹æ³•给父组件使用
@@ -364,7 +377,7 @@
      equipmentDepreciation: "",
      purchasePrice: "",
      totalCost: "",
      producer: "",
      producerId: "",
      ...rowData,
    };
    tableData.value = [...tableData.value, defaultRow];
src/views/production/components/ProductionDialog.vue
@@ -1,12 +1,12 @@
<template>
  <el-dialog
      v-model="dialogVisible"
      :title="dialogType === 'add' ? '新增生产加工' : '编辑生产加工'"
      :title="dialogType === 'add' ? '新增生产加工' : dialogType === 'viewRow' ? '查看生产加工' : '编辑生产加工'"
      width="1200px"
      :close-on-click-modal="false"
      @close="handleClose"
  >
    <el-row :gutter="10" style="margin-bottom: 10px">
    <el-row :gutter="10" style="margin-bottom: 10px" v-if="dialogType !== 'viewRow'">
      <el-col :span="3">
        <el-button type="primary" @click="handlData"
        >
@@ -40,20 +40,21 @@
    </el-row>
    <ETableModify
        :columns="columns"
        :showOperations="false"
        :showOperations="dialogType !== 'viewRow'"
        height="200"
        @cell-edit="handleCellEdit"
        :tableData="tableData"
        :showOverflowTooltip="false"
        @row-click="handleRowClick"
        :editableColumns="['usedQuantity']"
        :editableColumns="dialogType === 'viewRow' ? [] : ['usedQuantity']"
        :editableCells="dialogType !== 'viewRow'"
        @delete="handleRemoveItem"
    />
    <div class="empty-table">
      <h1>生产明细</h1>
      <el-row :gutter="10">
        <el-col :span="2">
          <el-button type="primary" @click="addNewRow">
          <el-button type="primary" @click="addNewRow" v-if="dialogType !== 'viewRow'">
            <el-icon>
              <Plus/>
            </el-icon>
@@ -72,10 +73,11 @@
      <ProductionDetailsTable
          v-model="detailsTableData"
          :border="false"
          :show-operations="true"
          :show-operations="dialogType !== 'viewRow'"
          :auto-calculate="true"
          @input-change="handleDetailsChange"
          @delete-row="handleDeleteRow"
          :dialogType="dialogType"
      />
    </div>
@@ -83,14 +85,17 @@
      <div class="dialog-footer">
        <el-button
            @click="handleClose"
            v-if="dialogType === 'add' || dialogType === 'edit'"
        >取 æ¶ˆ
        >{{ dialogType === 'viewRow' ? '关 é—­' : '取 æ¶ˆ' }}
        </el-button
        >
        <!-- <el-button @click="handleReset" v-if="dialogType === 'edit'"
          >重 ç½®</el-button
        > -->
        <el-button type="primary" :loading="loading" @click="handleSubmit"
        <el-button
            v-if="dialogType !== 'viewRow'"
            type="primary"
            :loading="loading"
            @click="handleSubmit"
        >ç¡® å®š
        </el-button
        >
@@ -298,11 +303,11 @@
  dialogType.value = "add";
};
const editInitialization = (data) => {
const editInitialization = (type,data) => {
  copyForm.value = deepClone(data);
  tableData.value = data.productionInventoryList || [];
  detailsTableData.value = data.productionList || [];
  dialogType.value = "edit";
  dialogType.value = type;
  const existingOfficialIds = tableData.value
      .map((item) => item.officialId)
      .filter((id) => id);
@@ -396,7 +401,7 @@
  for (let i = 0; i < tableData.value.length; i++) {
    const element = tableData.value[i];
    if (element.usedQuantity == 0 || element.usedQuantity === null) {
      ElMessage.warning(`请填写使用数量: ${element.coal}`);
      ElMessage.warning(`请填写生产加工煤种的使用数量`);
      return;
    }
  }
src/views/production/components/useDialog.js
@@ -20,12 +20,17 @@
        if (dialogRef.value) {
            if (type === 'add') {
                dialogRef.value.Initialization?.();
            } else if (type === 'edit' && rowData) {
                dialogRef.value.editInitialization?.(rowData);
            } else if ((type === 'edit' || type === 'viewRow') && rowData) {
                dialogRef.value.editInitialization?.(type,rowData);
            }
        }
    };
    const viewRow = (type,rowData) => {
        dialogType.value = type;
        currentRowData.value = rowData;
        dialogVisible.value = true;
        openDialog('viewRow', rowData);
    };
    // å…³é—­å¯¹è¯æ¡†
    const closeDialog = () => {
        dialogVisible.value = false;
@@ -51,6 +56,7 @@
        // æ–¹æ³•
        openDialog,
        closeDialog,
        handleDialogSuccess
        handleDialogSuccess,
        viewRow
    };
}
src/views/production/index.vue
@@ -1,12 +1,12 @@
<template>
  <div class="production-container">
  <div>
    <!-- æœç´¢è¡¨å• -->
    <el-form :inline="true" :model="queryParams" class="search-form">
      <el-form-item label="搜索">
        <el-input
            v-model="queryParams.searchAll"
            placeholder="请输入关键词"
            clearable
          v-model="queryParams.searchAll"
          placeholder="请输入关键词"
          clearable
        />
      </el-form-item>
      <el-form-item>
@@ -22,74 +22,97 @@
        <el-button type="success" :icon="Plus" @click="openDialog('add')">
          æ–°å¢žåŠ å·¥
        </el-button>
        <el-button type="danger" :icon="Delete" :disabled="!selectedRows.length" @click="() => deleteSelected(delPM)">
        <el-button
          type="danger"
          :icon="Delete"
          :disabled="!selectedRows.length"
          @click="() => deleteSelected(delPM)"
        >
          åˆ é™¤
        </el-button>
      </div>      <!-- æ•°æ®è¡¨æ ¼ -->
      </div>
      <!-- æ•°æ®è¡¨æ ¼ -->
      <ETable
          :showOverflowTooltip="false"
          :loading="loading"
          :table-data="tableData"
          :columns="columns"
          :current-page="queryParams.current"
          :page-size="queryParams.size"
          @selection-change="handleSelectionChange"
          @edit="row => openDialog('edit', row)"
          :show-selection="true"
          :border="true"
          :maxHeight="480"
        :showOverflowTooltip="false"
        :loading="loading"
        :table-data="tableData"
        :columns="columns"
        :current-page="queryParams.current"
        :page-size="queryParams.size"
        @selection-change="handleSelectionChange"
        @edit="(row) => openDialog('edit', row)"
        :show-selection="true"
        :border="true"
        @viewRow="(row) => (viewRow('viewRow', row))"
        :operations="['edit', 'viewRow']"
        :operationsWidth="200"
        :show-overflow-tooltip="false"
        style="width: 100%; height: calc(100vh - 26em)"
      >
        <template #coal="{ row }">
        <template #coalId="{ row }">
          <div class="coal-tags">
            <el-tag v-for="coal in parseCoalArray(row.coal)" :key="coal" size="small">
              {{ getCoalNameById(coal) }}
            </el-tag>
            <span v-if="!row.coal">--</span>
            <template v-if="row.coalId">
              <el-tag
                v-for="coal in parseCoalArray(row.coalId)"
                :key="coal"
                size="small"
                type="primary"
                class="coal-tag"
              >
                {{ getDisplayCoalName(coal) }}
              </el-tag>
            </template>
            <span v-else class="no-data">--</span>
          </div>
        </template>
      </ETable>      <!-- åˆ†é¡µç»„ä»¶ -->
      </ETable>
      <!-- åˆ†é¡µç»„ä»¶ -->
      <Pagination
          :layout="'total, prev, pager, next, jumper'"
          :total="total"
          v-model:page="queryParams.current"
          :limit="queryParams.size"
          @pagination="handlePageChange"
        :layout="'total, prev, pager, next, jumper'"
        :total="total"
        v-model:page="queryParams.current"
        :limit="queryParams.size"
        @pagination="handlePageChange"
      />
    </el-card>
    <!-- ç”Ÿäº§å¯¹è¯æ¡† -->
    <!-- handleProductionAndProcessing -->
    <ProductionDialog
        v-model:visible="dialogVisible"
        ref="dialogRef"
        :type="dialogType"
        @update:productionAndProcessing="handleProductionAndProcessing"
        @success="handleDialogSuccess"
      v-model:visible="dialogVisible"
      ref="dialogRef"
      :type="dialogType"
      @update:productionAndProcessing="handleProductionAndProcessing"
      @success="handleDialogSuccess"
    />
  </div>
</template>
<script setup>
import {onMounted} from "vue";
import {ElMessage} from "element-plus";
import {Plus, Delete} from "@element-plus/icons-vue";
import { onMounted, ref } from "vue";
import { ElMessage } from "element-plus";
import { Plus, Delete } from "@element-plus/icons-vue";
import ProductionDialog from "./components/ProductionDialog.vue";
import ETable from "@/components/Table/ETable.vue";
import Pagination from "@/components/Pagination/index.vue";
import {getProductionMasterList, delPM} from "@/api/production";
import {parseCoalArray} from "@/utils/production";
import {useTableData} from "./components/useTableData.js";
import {useDialog} from "./components/useDialog.js";
import {useCoalData} from "./components/useCoalData.js";
import { getProductionMasterList, delPM } from "@/api/production";
import { parseCoalArray } from "@/utils/production";
import { useTableData } from "./components/useTableData.js";
import { useDialog } from "./components/useDialog.js";
import { useCoalData } from "./components/useCoalData.js";
import { getCoalInfoList } from "@/api/production";
// ç…¤ç§ä¿¡æ¯åˆ—表
const coalInfoList = ref([]);
// è¡¨æ ¼åˆ—配置
const columns = [
  {prop: "coal", label: "煤种", minWidth: 150, slot: 'coal'},
  {prop: "productionQuantity", label: "生产数量", minWidth: 120},
  {prop: "laborCost", label: "人工成本", minWidth: 150},
  {prop: "energyConsumptionCost", label: "能耗成本", minWidth: 120},
  {prop: "equipmentDepreciation", label: "设备折旧", minWidth: 143},
  {prop: "totalCost", label: "总成本", minWidth: 150},
  { prop: "coalId", label: "煤种", minWidth: 150, slot: true },
  { prop: "productionQuantity", label: "生产数量", minWidth: 120 },
  { prop: "laborCost", label: "人工成本", minWidth: 150 },
  { prop: "energyConsumptionCost", label: "能耗成本", minWidth: 120 },
  { prop: "equipmentDepreciation", label: "设备折旧", minWidth: 143 },
  { prop: "totalCost", label: "总成本", minWidth: 150 },
];
// ä½¿ç”¨è¡¨æ ¼æ•°æ®ç»„合式函数
@@ -104,8 +127,8 @@
  handleReset,
  handlePageChange,
  handleSelectionChange,
  deleteSelected
} = useTableData(getProductionMasterList, {pageSize: 10});
  deleteSelected,
} = useTableData(getProductionMasterList, { pageSize: 10 });
// ä½¿ç”¨å¯¹è¯æ¡†ç»„合式函数
const {
@@ -113,17 +136,32 @@
  dialogType,
  dialogRef,
  openDialog,
  handleDialogSuccess: onDialogSuccess
  viewRow,
  handleDialogSuccess: onDialogSuccess,
} = useDialog();
// ä½¿ç”¨ç…¤ç§æ•°æ®ç»„合式函数
const {getCoalNameById, getCoalData} = useCoalData();
const { getCoalNameById, getCoalData } = useCoalData();
// èŽ·å–ç…¤ç§æ˜¾ç¤ºåç§°ï¼ˆå¸¦å¤‡ç”¨é€»è¾‘ï¼‰
const getDisplayCoalName = (coalId) => {
  // ä¼˜å…ˆä½¿ç”¨ useCoalData çš„æ–¹æ³•
  let name = getCoalNameById(coalId);
  // å¦‚果没有找到,尝试从 coalInfoList ä¸­æŸ¥æ‰¾
  if (name === coalId && coalInfoList.value.length > 0) {
    const found = coalInfoList.value.find((item) => item.id == coalId);
    name = found ? found.coal : coalId;
  }
  return name || coalId;
};
// å¤„理生产数据更新
const handleProductionAndProcessing = (row, rows) => {
  const index = tableData.value.findIndex(item => item.id === rows.id);
  const index = tableData.value.findIndex((item) => item.id === rows.id);
  if (index !== -1) {
    tableData.value[index] = {...tableData.value[index], ...row};
    tableData.value[index] = { ...tableData.value[index], ...row };
  }
};
@@ -134,10 +172,26 @@
    ElMessage.success("操作成功");
  });
};
// ç»„件挂载时加载数据
onMounted(async () => {
  await getCoalData(); // é¢„加载煤种数据
  getList();
  try {
    // å¹¶è¡ŒåŠ è½½ç…¤ç§æ•°æ®å’Œè¡¨æ ¼æ•°æ®
    await Promise.all([
      getCoalData(), // é¢„加载煤种数据
      (async () => {
        const res = await getCoalInfoList();
        if (res.code === 200) {
          coalInfoList.value = res.data;
        }
      })(),
    ]);
    // åŠ è½½è¡¨æ ¼æ•°æ®
    getList();
  } catch (error) {
    ElMessage.error("数据加载失败,请刷新页面重试");
  }
});
</script>
@@ -179,8 +233,9 @@
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  .el-tag {
  .coal-tag {
    margin-right: 4px;
    margin-bottom: 4px;
@@ -188,5 +243,10 @@
      margin-right: 0;
    }
  }
  .no-data {
    color: #999;
    font-style: italic;
  }
}
</style>
src/views/salesOutbound/components/formDia.vue
@@ -22,9 +22,9 @@
              <el-select v-model="form.customerId" placeholder="请选择客户">
                <el-option
                    v-for="item in customerOptions"
                    :key="item.id"
                    :label="item.customerName"
                    :value="item.id"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                />
              </el-select>
            </el-form-item>
@@ -56,14 +56,14 @@
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="单价(含税)" prop="priceIncludingTax">
            <el-form-item label="单价(含税)" prop="priceIncludingTax" @change="mathProfit">
              <el-input v-model="form.priceIncludingTax" placeholder="请输入销售单价(含税)" maxlength="30" type="number" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="销售数量" prop="saleQuantity">
            <el-form-item label="销售数量" prop="saleQuantity" @change="mathProfit">
              <el-input v-model="form.saleQuantity" placeholder="请输入销售数量" maxlength="30" type="number" />
            </el-form-item>
          </el-col>
@@ -122,7 +122,7 @@
<script setup>
import {reactive, ref} from "vue";
import {addOrEditSalesRecord, customerList, officialList} from "../../../api/salesOutbound/index.js";
import {addOrEditSalesRecord, customerList, officialList} from "@/api/salesOutbound/index.js";
import useUserStore from '@/store/modules/user'
const { proxy } = getCurrentInstance()
@@ -160,12 +160,16 @@
const openDialog = async (type, row) => {
  dialogVisitable.value = true
  form.value.saleDate = proxy.getCurrentDate()
  customerList().then((res) => {
    customerOptions.value = res.data
  })
  officialList().then((res) => {
    coalOptions.value = res.data
  })
  const [supplyRes, coalRes] = await Promise.all([
    customerList(),
    officialList(),
  ]);
  let supplyData = supplyRes.data;
  coalOptions.value = coalRes.data;
  customerOptions.value = supplyData.map((item) => ({
    value: item.id,
    label: item.customerName,
  }));
  let res = await userStore.getInfo()
  form.value.registrantId = res.user.userId
  form.value.taxCoal = 13
src/views/salesOutbound/index.vue
@@ -56,7 +56,7 @@
                @selection-change="handleSelectionChange"
                :show-selection="true"
                :border="true"
                :maxHeight="480"
                style="width: 100%;height: calc(100vh - 30em)"
                @edit="openDia"></ETable>
      </div>
      <pagination
src/views/warehouseManagement/index.vue
@@ -43,7 +43,7 @@
        <el-button type="success" plain :icon="Refresh" v-if="activeTab=== 'officialInventory'" @click="mergeRows('merge')">合并</el-button>
      </el-space>
      <div>
        <el-table :data="tableData" border @selection-change="selectionChange" style="width: 100%" show-summary :summary-method="summarizeChildrenTable">
        <el-table :data="tableData" border @selection-change="selectionChange" style="width: 100%;height: calc(100vh - 30em)" show-summary :summary-method="summarizeChildrenTable">
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column label="序号" type="index" width="60" align="center" />
          <el-table-column prop="supplierName" label="供货商名称" width="180" sortable/>
@@ -54,11 +54,11 @@
          <el-table-column prop="totalPriceIncludingTax" label="总价(含税)" width="130" />
          <el-table-column prop="priceExcludingTax" label="单价(不含税)" width="130" />
          <el-table-column prop="totalPriceExcludingTax" label="总价(不含税)" width="130" />
          <el-table-column prop="pendingReplenishment" label="待补库" width="130" />
          <el-table-column prop="pendingReplenishment" label="待补库" width="130" v-if="activeTab=== 'officialInventory'"/>
          <el-table-column label="煤质" align="center" v-if="activeTab=== 'officialInventory'" width="600">
            <el-table-column v-for="col in columnTitle" :key="col.prop" :prop="col.prop" :label="col.label" align="center" sortable min-width="200"/>
          </el-table-column>
          <el-table-column prop="registrantId" label="登记人" width="180"/>
          <el-table-column prop="registrant" label="登记人" width="180"/>
          <el-table-column prop="registrationDate" label="登记日期" width="180"/>
          <el-table-column fixed="right" label="操作" min-width="60" align="center">
            <template #default="scope">
@@ -82,13 +82,17 @@
      <el-form :model="form" :rules="rules" ref="formRef" label-width="180px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="供货商名称" prop="supplierName">
              <el-input v-model="form.supplierName" placeholder="请输入供货商名称" maxlength="30" />
            <el-form-item label="供应商名称" prop="supplierId">
              <el-select v-model="form.supplierId" placeholder="请选择供应商">
                <el-option :label="item.label" v-for="item in supplyList" :key="item.value" :value="item.value"/>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="煤种" prop="coal">
              <el-input v-model="form.coal" placeholder="请输入煤种" maxlength="30" />
            <el-form-item label="煤种" prop="coalId">
              <el-select v-model="form.coalId" placeholder="请选择煤种">
                <el-option :label="item.label" v-for="item in coalList" :key="item.value" :value="item.value"/>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
@@ -163,13 +167,17 @@
      <el-form :model="mergeForm" :rules="mergeRules" ref="mergeRef" label-width="100px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="供货商名称" prop="supplierName">
              <el-input v-model="mergeForm.supplierName" placeholder="请输入供货商名称" maxlength="30" />
            <el-form-item label="供应商名称" prop="supplierId">
              <el-select v-model="mergeForm.supplierId" placeholder="请选择供应商">
                <el-option :label="item.label" v-for="item in supplyList" :key="item.value" :value="item.value"/>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="煤种" prop="coal">
              <el-input v-model="mergeForm.coal" placeholder="请输入煤种" maxlength="30" />
            <el-form-item label="煤种" prop="coalId">
              <el-select v-model="mergeForm.coalId" placeholder="请选择煤种">
                <el-option :label="item.label" v-for="item in coalList" :key="item.value" :value="item.value"/>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
@@ -239,6 +247,8 @@
  pendingInventoryList
} from "@/api/warehouseManagement/index.js";
import {editOfficial, merge} from "../../api/warehouseManagement/index.js";
import {getSupplyList} from "@/api/procureMent/index.js";
import {getCoalInfoList} from "@/api/production/index.js";
const { proxy } = getCurrentInstance()
@@ -273,8 +283,8 @@
    pId: '',
  },
  mergeForm: {
    supplierName: '',
    coal: '',
    supplierId: '',
    coalId: '',
    unit: '',
    inventoryQuantity: '',
    priceIncludingTax: '',
@@ -313,6 +323,33 @@
  coal: "",
})
const columnTitle = ref([])
const supplyList = ref([]);
const coalList = ref([]);
// èŽ·å–ä¾›åº”å•†ä¸‹æ‹‰å’Œç…¤ç§ä¸‹æ‹‰
const getDropdownData = async () => {
  try {
    const [supplyRes, coalRes] = await Promise.all([
      getSupplyList(),
      getCoalInfoList(),
    ]);
    let supplyData = supplyRes.data;
    let coalData = coalRes.data;
    supplyList.value = supplyData.map((item) => ({
      value: item.id,
      label: item.supplierName,
    }));
    coalList.value = coalData.map((item) => ({
      value: item.id,
      label: item.coal,
    }));
  } catch (error) {
    ElMessage.error("获取下拉数据失败,请稍后重试");
  }
};
defineExpose({
  getDropdownData,
});
onMounted(() => {
  handleTabClick({ props: { name: "pendingInbound" } });
});
@@ -386,6 +423,7 @@
  form.value = {...row}
  form.value.pId = row.id
  inventoryQuantity.value = row.inventoryQuantity
  getDropdownData()
  coalPlanListOptions()
}
// æŸ¥è¯¢ç…¤è´¨æ–¹æ¡ˆä¸‹æ‹‰æ¡†