已修改6个文件
290 ■■■■ 文件已修改
src/api/inventoryManagement/stockInRecord.js 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/approvalProcess/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/receiptManagement/Record.vue 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.js 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inventoryManagement/stockInRecord.js
@@ -2,26 +2,43 @@
// 查询入库信息列表
export const getStockInRecordListPage = (params) => {
    return request({
        url: "/stockInRecord/listPage",
        method: "get",
        params,
    });
  return request({
    url: "/stockInRecord/listPage",
    method: "get",
    params,
  });
};
// 根据 ID 查询单条入库记录详情
export const getStockInRecordById = (id) => {
  return request({
    url: "/stockInRecord/getById",
    method: "get",
    params: { id },
  });
};
export const updateStockInRecord = (id, data) => {
    return request({
        url: "/stockInRecord/" + id,
        method: "put",
        data: data,
    });
  return request({
    url: "/stockInRecord/" + id,
    method: "put",
    data: data,
  });
};
// 重新提起审批(更新入库记录)
export const updateStockInRecordForReApprove = (data) => {
  return request({
    url: "/stockInRecord/updateStockInRecord",
    method: "post",
    data,
  });
};
export const batchDeleteStockInRecords = (ids) => {
    return request({
        url: "/stockInRecord",
        method: "delete",
        data: ids,
    });
};
  return request({
    url: "/stockInRecord",
    method: "delete",
    data: ids,
  });
};
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
@@ -39,6 +39,59 @@
                        </el-form-item>
                    </el-col>
                </el-row>
        <!-- 入库审批:展示入库信息 -->
        <!-- <el-row v-if="isInventoryApproval">
          <el-col :span="24">
            <el-form-item label="是否入库审核通过:">
              <el-tag :type="form.inventoryReview ? 'success' : 'danger'">
                {{ form.inventoryReview ? '是' : '否' }}
              </el-tag>
            </el-form-item>
          </el-col>
        </el-row> -->
        <el-row v-if="isInventoryApproval">
          <el-col :span="12">
            <el-form-item label="入库类型:">
              <el-tag type="info">
                {{ form.storageType || '-' }}
              </el-tag>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="入库数量:">
              <el-tag type="warning">
                {{ currentStockIn.stockInNum ?? '-' }}
              </el-tag>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 入库审批:展示入库台账明细(字段形式) -->
      <el-row v-if="isInventoryApproval" style="margin-top: 10px">
        <el-col :span="12">
          <el-form-item label="产品名称:">
            <el-tag type="info">
              {{ currentStockIn.productName || '-' }}
            </el-tag>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="规格型号:">
            <el-tag type="info">
              {{ currentStockIn.model || '-' }}
            </el-tag>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row v-if="isInventoryApproval">
        <el-col :span="24">
          <el-form-item label="生产订单号:">
            <el-tag type="info">
              {{ currentStockIn.npsNo || '-' }}
            </el-tag>
          </el-form-item>
        </el-col>
      </el-row>
                <!-- 审批人选择(动态节点) -->
                <el-row :gutter="30">
                    <el-col :span="12">
@@ -168,6 +221,8 @@
        </el-skeleton>
      </div>
      <el-form :model="{ activities }" ref="formRef" label-position="top">
        <el-steps :active="getActiveStep()" finish-status="success" process-status="process" align-center direction="vertical">
          <el-step
@@ -232,6 +287,7 @@
import { WarningFilled, Edit, Check, MoreFilled } from '@element-plus/icons-vue'
import { getQuotationList } from "@/api/salesManagement/salesQuotation.js";
import { getPurchaseByCode } from "@/api/procurementManagement/procurementLedger.js";
import { getStockInRecordById } from "@/api/inventoryManagement/stockInRecord.js";
const emit = defineEmits(['close'])
const { proxy } = getCurrentInstance()
@@ -253,8 +309,11 @@
const currentQuotation = ref({})
const purchaseLoading = ref(false)
const currentPurchase = ref({})
const stockInLoading = ref(false)
const currentStockIn = ref({})
const isQuotationApproval = computed(() => Number(props.approveType) === 6)
const isPurchaseApproval = computed(() => Number(props.approveType) === 5)
const isInventoryApproval = computed(() => Number(props.approveType) === 9)
const data = reactive({
    form: {
@@ -264,6 +323,10 @@
        approveDeptId: "",
        approveReason: "",
        checkResult: "",
    inventoryReview: false,
    storageType: "",
    stockInNum: null,
    recordId: null,
    },
});
const { form } = toRefs(data);
@@ -295,6 +358,7 @@
  dialogFormVisible.value = true;
  currentQuotation.value = {}
  currentPurchase.value = {}
  currentStockIn.value = {}
    userListNoPageByTenantId().then((res) => {
        userList.value = res.data;
    });
@@ -355,6 +419,28 @@
    }
  }
  // 入库审批:根据 recordId 查询入库台账详情
  if (isInventoryApproval.value) {
    const recordId = row?.recordId;
    form.value.recordId = recordId ?? form.value.recordId;
    form.value.inventoryReview = row?.inventoryReview ?? form.value.inventoryReview;
    form.value.storageType = row?.storageType ?? form.value.storageType;
    if (recordId) {
      stockInLoading.value = true;
      getStockInRecordById(recordId)
        .then((res) => {
          currentStockIn.value = res?.data || res || {};
        })
        .catch((err) => {
          console.error("查询入库记录失败:", err);
          proxy.$modal.msgError("查询入库记录失败");
        })
        .finally(() => {
          stockInLoading.value = false;
        });
    }
  }
  approveProcessDetails(row.approveId).then((res) => {
    activities.value = res.data
    // 增加isApproval字段
@@ -392,6 +478,14 @@
    return;
  }
  currentActivity.approveNodeStatus = status;
  // 始终带上当前审批类型(入库审批为 9)
  currentActivity.approveType = Number(props.approveType);
  // 入库审批:把入库相关字段写入当前节点
  if (isInventoryApproval.value) {
    currentActivity.recordId = form.value.recordId;
    currentActivity.storageType = form.value.storageType;
    currentActivity.inventoryReview = status === 1;
  }
  // 判断是否为最后一步
  const isLast = activities.value.findIndex(a => a.isShen) === activities.value.length-1;
  updateApproveNode({ ...currentActivity, isLast }).then(() => {
@@ -407,6 +501,8 @@
  currentQuotation.value = {}
  purchaseLoading.value = false
  currentPurchase.value = {}
  stockInLoading.value = false
  currentStockIn.value = {}
  emit('close')
};
defineExpose({
src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue
@@ -243,7 +243,10 @@
    startDate: "", // 请假开始时间
    endDate: "", // 请假结束时间
    price: null, // 报销金额
    location: "" // 出差地点
    location: "", // 出差地点
    inventoryReview: false, // 入库是否审核通过
    storageType: "",       // 入库类型(合格/不合格)
    recordId: null,        // 入库记录ID
  },
  rules: {
    approveTime: [{ required: false, message: "请输入", trigger: "change" },],
@@ -316,6 +319,10 @@
        currentApproveStatus.value = row.approveStatus
    approveProcessGetInfo({id: row.approveId,approveReason: '1'}).then(res => {
            form.value = {...res.data}
      // 确保入库审批相关字段从列表行透传进来
      form.value.recordId = row.recordId ?? form.value.recordId
      form.value.inventoryReview = row.inventoryReview ?? form.value.inventoryReview
      form.value.storageType = row.storageType ?? form.value.storageType
      // 反显审批人
      if (res.data && res.data.approveUserIds) {
        const userIds = res.data.approveUserIds.split(',')
@@ -365,6 +372,13 @@
  // 收集所有节点的审批人id
  form.value.approveUserIds = approverNodes.value.map(node => node.userId).join(',')
  form.value.approveType = props.approveType
  // 入库审批:直接透传入库相关字段(由外部预先填充)
  if (props.approveType == 9) {
    // 确保布尔类型正确
    form.value.inventoryReview = !!form.value.inventoryReview
    // storageType、recordId 按照查出来的数据原样带给后台
  }
  // 审批人必填校验
  const hasEmptyApprover = approverNodes.value.some(node => !node.userId)
  if (hasEmptyApprover) {
src/views/collaborativeApproval/approvalProcess/index.vue
@@ -9,6 +9,7 @@
      <el-tab-pane label="采购审批" name="5"></el-tab-pane>
      <el-tab-pane label="报价审批" name="6"></el-tab-pane>
      <el-tab-pane label="发货审批" name="7"></el-tab-pane>
      <el-tab-pane label="入库审批" name="9"></el-tab-pane>
    </el-tabs>
    
    <div class="search_form">
@@ -38,14 +39,14 @@
        <el-button
          type="primary"
          @click="openForm('add')"
          v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7"
          v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7 && currentApproveType !== 9"
        >新增</el-button>
        <el-button @click="handleOut">导出</el-button>
        <el-button
          type="danger"
          plain
          @click="handleDelete"
          v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7"
          v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7 && currentApproveType !== 9"
        >删除</el-button>
      </div>
    </div>
@@ -212,6 +213,7 @@
        currentApproveType.value === 5 ||
        currentApproveType.value === 6 ||
        currentApproveType.value === 7 ||
        currentApproveType.value === 9 ||
        row.approveStatus == 2 ||
        row.approveStatus == 1 ||
        row.approveStatus == 4
@@ -310,6 +312,7 @@
    5: "/approveProcess/exportFive",
    6: "/approveProcess/exportSix",
    7: "/approveProcess/exportSeven",
    9: "/approveProcess/exportNine",
  }
  const url = urlMap[type] || urlMap[0]
  const nameMap = {
@@ -321,6 +324,7 @@
    5: "采购申请审批表",
    6: "报价审批表",
    7: "发货审批表",
    9: "入库审批表",
  }
  const fileName = nameMap[type] || nameMap[0]
  proxy.download(url, {}, `${fileName}.xlsx`)
src/views/inventoryManagement/receiptManagement/Record.vue
@@ -73,6 +73,16 @@
        <el-table-column label="入库数量"
                         prop="stockInNum"
                         show-overflow-tooltip/>
        <el-table-column label="审批状态"
                         prop="approveStatus"
                         align="center"
                         width="120">
          <template #default="scope">
            <el-tag :type="getApproveStatusType(scope.row.approveStatus)">
              {{ getApproveStatusText(scope.row.approveStatus) }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column label="入库人"
                         prop="createBy"
                         show-overflow-tooltip/>
@@ -81,6 +91,20 @@
                         show-overflow-tooltip>
          <template #default="scope">
            {{ getRecordType(scope.row.recordType) }}
          </template>
        </el-table-column>
        <el-table-column label="操作"
                         align="center"
                         width="200">
          <template #default="scope">
            <el-button
              v-if="scope.row.approveStatus === 3"
              type="primary"
              link
              @click="handleReApprove(scope.row)"
            >
              重新提起审批
            </el-button>
          </template>
        </el-table-column>
      </el-table>
@@ -107,6 +131,7 @@
import {
  getStockInRecordListPage,
  batchDeleteStockInRecords,
  updateStockInRecordForReApprove,
} from "@/api/inventoryManagement/stockInRecord.js";
import {
  findAllQualifiedStockInRecordTypeOptions, findAllUnQualifiedStockInRecordTypeOptions,
@@ -152,6 +177,24 @@
  return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || ''
}
const getApproveStatusText = (status) => {
  if (status === 0) return "待审核";
  if (status === 1) return "审核中";
  if (status === 2) return "审核完成";
  if (status === 3) return "审核未通过";
  if (status === 4) return "已重新提交";
  return "-";
};
const getApproveStatusType = (status) => {
  if (status === 0) return "warning";
  if (status === 1) return "primary";
  if (status === 2) return "success";
  if (status === 3) return "danger";
  if (status === 4) return "info";
  return "";
};
const pageProductChange = obj => {
  page.current = obj.page;
  page.size = obj.limit;
@@ -195,6 +238,34 @@
const expandedRowKeys = ref([]);
const handleReApprove = (row) => {
  if (!row || !row.id) {
    return;
  }
  ElMessageBox.confirm(
    "该记录审核未通过,是否重新提起入库审批?",
    "重新提起审批",
    {
      confirmButtonText: "确认",
      cancelButtonText: "取消",
      type: "warning",
    }
  )
    .then(() => {
      updateStockInRecordForReApprove({ ...row })
        .then(() => {
          proxy.$modal.msgSuccess("已重新发起审批");
          getList();
        })
        .catch(() => {
          proxy.$modal.msgError("重新发起审批失败");
        });
    })
    .catch(() => {
      proxy.$modal.msg("已取消");
    });
};
// 导出
const handleOut = () => {
  ElMessageBox.confirm("是否确认导出?", "导出", {
vite.config.js
@@ -7,17 +7,17 @@
  const env = loadEnv(mode, process.cwd());
  const { VITE_APP_ENV } = env;
  const baseUrl =
      env.VITE_APP_ENV === "development"
          ? "http://1.15.17.182:9003"
          : env.VITE_BASE_API;
    env.VITE_APP_ENV === "development"
      ? "http://192.168.1.35:9009"
      : env.VITE_BASE_API;
  const javaUrl =
      env.VITE_APP_ENV === "development"
          ? "http://1.15.17.182:9002"
          : env.VITE_JAVA_API;
    env.VITE_APP_ENV === "development"
      ? "http://192.168.1.35:9009"
      : env.VITE_JAVA_API;
  return {
    define:{
      __BASE_API__: JSON.stringify(javaUrl)
    define: {
      __BASE_API__: JSON.stringify(javaUrl),
    },
    base: VITE_APP_ENV === "production" ? "/" : "/",
    plugins: createVitePlugins(env, command === "build"),
@@ -27,18 +27,17 @@
        "@": path.resolve(__dirname, "./src"),
      },
      extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"],
      dedupe: ['vue', 'axios'], // 去重重复依赖
      dedupe: ["vue", "axios"], // 去重重复依赖
    },
    // 全局开启构建缓存(核心)
    cacheDir: '/var/jenkins_home/workspace/客户-鹏创电子前端/node_modules/.vite',
    cacheDir:
      "/var/jenkins_home/workspace/客户-鹏创电子前端/node_modules/.vite",
    // 依赖预构建优化
    optimizeDeps: {
      include: ['vue', 'axios', 'element-plus', 'echarts'], // 根据项目依赖调整
      disabled: false,
      include: ["vue", "axios", "element-plus", "echarts"], // 根据项目依赖调整
      esbuildOptions: {
        target: 'es2020',
        worker: true, // 开启 esbuild 多线程
      }
        target: "es2020",
      },
    },
    // 打包配置(核心优化区)
    build: {
@@ -46,7 +45,7 @@
      outDir: "dist",
      assetsDir: "assets",
      chunkSizeWarningLimit: 2000,
      minify: 'esbuild', // 使用 esbuild 压缩(无需额外依赖)
      minify: "esbuild", // 使用 esbuild 压缩(无需额外依赖)
      reportCompressedSize: false, // 关闭产物体积报告,减少耗时
      commonjsOptions: {
        include: [/node_modules/, /\.commonjs$/],
@@ -58,16 +57,16 @@
          assetFileNames: "static/[ext]/[name]-[hash].[ext]",
          // 分包策略(拆分大依赖)
          manualChunks: {
            vendor: ['vue', 'vue-router', 'pinia', 'axios'],
            ui: ['element-plus'], // 根据实际UI库调整
            charts: ['echarts'], // 有图表库则保留,无则删除
            vendor: ["vue", "vue-router", "pinia", "axios"],
            ui: ["element-plus"], // 根据实际UI库调整
            charts: ["echarts"], // 有图表库则保留,无则删除
          },
        },
        cache: true,
      },
    },
    server: {
      port: 80,
      port: 8001,
      host: true,
      open: true,
      proxy: {
@@ -100,14 +99,17 @@
      // CSS 预编译缓存
      preprocessorOptions: {
        scss: {
          cacheDirectory: path.resolve(__dirname, './node_modules/.vite/scss-cache'),
          cacheDirectory: path.resolve(
            __dirname,
            "./node_modules/.vite/scss-cache"
          ),
        },
      },
    },
    // esbuild 全局配置
    esbuild: {
      logOverride: { 'this-is-undefined-in-esm': 'silent' },
      target: 'es2020',
      logOverride: { "this-is-undefined-in-esm": "silent" },
      target: "es2020",
    },
  };
});
});