已修改8个文件
65 ■■■■■ 文件已修改
src/views/basicData/product/ImportExcel/index.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/product/index.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/processRoute/processRouteItem/index.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productStructure/Detail/index.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productStructure/DetailNew/MaterialCard.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productStructure/DetailNew/index.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productStructure/StructureEdit.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/product/ImportExcel/index.vue
@@ -26,36 +26,21 @@
  name: "产品维护导入",
});
const props = defineProps({
  productId: { type: [String, Number], default: "" },
});
const emits = defineEmits(["uploadSuccess"]);
const fileUploadRef = ref();
const upload = reactive({
  // 是否显示弹出层(供应商导入)
  open: false,
  // 弹出层标题(供应商导入)
  title: "",
  title: "产品导入",
  // 是否禁用上传
  isUploading: false,
  // 设置上传的请求头部
  headers: { Authorization: "Bearer " + getToken() },
});
// 上传的地址(携带 productId 参数,传给后端的 importProduct 接口)
const uploadUrl = computed(
  () =>
    import.meta.env.VITE_APP_BASE_API +
    "/basic/product/import" +
    (props.productId ? `?productId=${props.productId}` : "")
);
// 上传的地址
const uploadUrl = computed(() => import.meta.env.VITE_APP_BASE_API + "/basic/product/import");
// 点击导入
const handleImport = () => {
  if (!props.productId) {
    ElMessage({ message: "请先选择产品", type: "warning" });
    return;
  }
  upload.open = true;
  upload.title = "产品导入";
};
const submitFileForm = () => {
src/views/basicData/product/index.vue
@@ -9,6 +9,9 @@
                  @clear="searchFilter"
                  clearable
                  prefix-icon="Search" />
        <span style="margin-left: 12px">
          <ImportExcel @uploadSuccess="handleImportSuccess" />
        </span>
        <el-button v-if="false"
                   type="primary"
                   @click="openProDia('addOne')"
@@ -72,8 +75,6 @@
                   @click="openModelDia('add')">
          新增规格型号
        </el-button>
        <ImportExcel :product-id="currentId"
                     @uploadSuccess="getModelList" />
        <el-button type="danger"
                   @click="handleDelete"
                   style="margin-left: 10px"
@@ -536,6 +537,13 @@
      tableLoading.value = false;
    });
  };
  // 导入完成后刷新产品树与右侧规格列表
  const handleImportSuccess = () => {
    getProductTreeList();
    if (currentId.value) {
      getModelList();
    }
  };
  // 删除规格型号
  const handleDelete = () => {
    let ids = [];
src/views/productionManagement/processRoute/processRouteItem/index.vue
@@ -340,7 +340,7 @@
                                style="margin: 0">
                    <el-input-number v-model="row.unitQuantity"
                                     :min="0"
                                     :precision="2"
                                     :precision="8"
                                     :step="1"
                                     controls-position="right"
                                     style="width: 100%"
@@ -1198,19 +1198,19 @@
    });
  };
  const toQuantityNumber = value => {
  const toQuantityNumber = (value, scale = 2) => {
    const numberValue = Number(value);
    if (!Number.isFinite(numberValue)) {
      return 0;
    }
    return Number(numberValue.toFixed(2));
    return Number(numberValue.toFixed(scale));
  };
  const syncDemandedQuantityTree = (items, parentDemandedQuantity = null) => {
    items.forEach(item => {
      if (parentDemandedQuantity !== null) {
        item.demandedQuantity = toQuantityNumber(
          parentDemandedQuantity * toQuantityNumber(item.unitQuantity)
          parentDemandedQuantity * toQuantityNumber(item.unitQuantity, 8)
        );
      }
src/views/productionManagement/productStructure/Detail/index.vue
@@ -82,7 +82,7 @@
                                style="margin: 0">
                    <el-input-number v-model="row.unitQuantity"
                                     :min="0"
                                     :precision="2"
                                     :precision="8"
                                     :step="1"
                                     controls-position="right"
                                     style="width: 100%"
@@ -269,12 +269,12 @@
    });
  };
  const toQuantityNumber = (value: any) => {
  const toQuantityNumber = (value: any, scale: number = 2) => {
    const numberValue = Number(value);
    if (!Number.isFinite(numberValue)) {
      return 0;
    }
    return Number(numberValue.toFixed(2));
    return Number(numberValue.toFixed(scale));
  };
  const syncDemandedQuantityTree = (
@@ -284,7 +284,7 @@
    items.forEach((item: any) => {
      if (parentDemandedQuantity !== null) {
        item.demandedQuantity = toQuantityNumber(
          parentDemandedQuantity * toQuantityNumber(item.unitQuantity)
          parentDemandedQuantity * toQuantityNumber(item.unitQuantity, 8)
        );
      }
@@ -384,7 +384,7 @@
  };
  const fetchProcessOptions = async () => {
    const { data } = await list({});
    const { data } = await list({size: -1});
    console.log(data, "dataValue.dataList");
    dataValue.processOptions = normalizeListData(data);
  };
src/views/productionManagement/productStructure/DetailNew/MaterialCard.vue
@@ -82,7 +82,7 @@
            <el-form-item label="数量" :rules="[{ required: true, message: '请填写数量' }]" style="margin:0">
              <el-input-number v-model="row.unitQuantity"
                               :min="0"
                               :precision="2"
                               :precision="8"
                               :step="1"
                               controls-position="right"
                               style="width:100%"
src/views/productionManagement/productStructure/DetailNew/index.vue
@@ -201,12 +201,12 @@
    });
  };
  const toQuantityNumber = (value: any) => {
  const toQuantityNumber = (value: any, scale: number = 2) => {
    const numberValue = Number(value);
    if (!Number.isFinite(numberValue)) {
      return 0;
    }
    return Number(numberValue.toFixed(2));
    return Number(numberValue.toFixed(scale));
  };
  const syncDemandedQuantityTree = (
@@ -216,7 +216,7 @@
    items.forEach((item: any) => {
      if (parentDemandedQuantity !== null) {
        item.demandedQuantity = toQuantityNumber(
          parentDemandedQuantity * toQuantityNumber(item.unitQuantity)
          parentDemandedQuantity * toQuantityNumber(item.unitQuantity, 8)
        );
      }
@@ -316,7 +316,7 @@
  };
  const fetchProcessOptions = async () => {
    const { data } = await list({});
    const { data } = await list({size: -1});
    console.log(data, "dataValue.dataList");
    dataValue.processOptions = normalizeListData(data);
  };
src/views/productionManagement/productStructure/StructureEdit.vue
@@ -86,7 +86,7 @@
                                style="margin: 0">
                    <el-input-number v-model="row.unitQuantity"
                                     :min="0"
                                     :precision="2"
                                     :precision="8"
                                     :step="1"
                                     controls-position="right"
                                     style="width: 100%"
src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue
@@ -90,7 +90,7 @@
          <template #default="{ row }">
            <el-input-number v-model="row.pickQty"
                             :min="0"
                             :precision="3"
                             :precision="8"
                             :step="1"
                             controls-position="right"
                             style="width: 100%;" />