chenhj
2026-04-15 a3695db3102da2fb5b2f309578afe27f58b926d8
成品检测编辑增加送检车间
已修改2个文件
50 ■■■■ 文件已修改
src/views/qualityManagement/finalInspection/components/formDia.vue 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/finalInspection/index.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -25,7 +25,8 @@
          </el-col>
          <el-col :span="12">
            <el-form-item label="规格型号:" prop="productModelId">
              <el-select v-model="form.productModelId" placeholder="请选择" clearable :disabled="operationType === 'edit'"
              <el-select v-model="form.productModelId" placeholder="请选择" clearable
                         :disabled="operationType === 'edit'"
                         filterable readonly @change="handleChangeModel">
                <el-option v-for="item in modelOptions" :key="item.id" :label="item.model" :value="item.id" />
              </el-select>
@@ -75,17 +76,18 @@
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检品数量:" prop="inspectedQuantity">
              <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.inspectedQuantity" placeholder="请输入" clearable :precision="2"/>
              <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.inspectedQuantity"
                               placeholder="请输入" clearable :precision="2"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="总数量:" prop="quantity">
              <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="请输入" clearable :precision="2" :disabled="quantityDisabled"/>
              <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="请输入"
                               clearable :precision="2" :disabled="quantityDisabled"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="生产日期:" prop="productionDate">
              <el-date-picker
@@ -234,6 +236,11 @@
              <el-input v-model="form.inspectValidityDate" placeholder="自动计算" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="请检部门:" prop="manufacturingTeam">
              <el-input v-model="form.manufacturingTeam" placeholder="请输入" clearable/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
            <PIMTable
@@ -306,9 +313,13 @@
import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js";
import {userListNoPage} from "@/api/system/user.js";
import { getStockInventoryAll } from "@/api/inventoryManagement/stockInventory.js";
import {qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId} from "@/api/qualityManagement/metricMaintenance.js";
import {
  qualityInspectDetailByProductId,
  getQualityTestStandardParamByTestStandardId
} from "@/api/qualityManagement/metricMaintenance.js";
import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
import {deviceList as qualityInspectParamDeviceList} from "@/api/energyManagement/index.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
@@ -353,6 +364,7 @@
    inspectProductionDate: "",
    inspectValidityDate: "",
    inspectValidityPeriod: "",
    manufacturingTeam: "",
  },
  rules: {
    checkTime: [{ required: true, message: "请输入", trigger: "blur" },],
@@ -575,6 +587,7 @@
    if (currentProductId.value) {
      // 设置产品名称
      form.value.productName = findNodeById(productOptions.value, currentProductId.value);
      syncInspectDeptByProductName(form.value.productName);
      // 并行加载规格型号和指标选项
      const params = {
@@ -643,6 +656,23 @@
  inspectProductOptions.value = filterInspectTreeForPowderSelect(inspectStockInventoryAllTree);
  return inspectProductOptions.value;
};
const getInspectDeptByProductName = (productName) => {
  const name = String(productName ?? "").trim();
  if (!name) return "";
  const match = name.match(/^成品-([一三])类产品-/);
  if (!match) return "";
  return `${match[1]}类车间`;
};
const syncInspectDeptByProductName = (productName, force = false) => {
  const dept = getInspectDeptByProductName(productName);
  if (!dept) return;
  if (force || !String(form.value.inspectDept ?? "").trim()) {
    form.value.inspectDept = dept;
  }
};
const getModels = (value) => {
  form.value.productModelId = undefined;
  form.value.unit = undefined;
@@ -651,6 +681,7 @@
  modelOptions.value = [];
  currentProductId.value = value
  form.value.productName = findNodeById(productOptions.value, value);
  syncInspectDeptByProductName(form.value.productName, true);
  modelList({ id: value }).then((res) => {
    modelOptions.value = res;
  })
@@ -683,6 +714,7 @@
  }
  return null; // 没有找到节点,返回null
};
function convertIdToValue(data) {
  return data.map((item) => {
    const { id, children, ...rest } = item;
@@ -697,6 +729,7 @@
    return newItem;
  });
}
// 提交产品表单
const submitForm = () => {
  proxy.$refs.formRef.validate(valid => {
src/views/qualityManagement/finalInspection/index.vue
@@ -15,7 +15,8 @@
        <el-date-picker  v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
                         placeholder="请选择" clearable @change="changeDaterange" />
        <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
        >搜索</el-button
        >搜索
        </el-button
        >
      </div>
      <div>
@@ -144,6 +145,10 @@
    width: 120
  },
  {
    label: "请检部门",
    prop: "manufacturingTeam",
  },
  {
    label: "检测结果",
    prop: "checkResult",
    dataType: "tag",