ZN
13 小时以前 129bd0cd4df6f12dd576c262710b1fd9902c363e
fix(qualityManagement): 修复质检表单规格型号选择逻辑和员工列表排序问题

- 将质检表单中的规格型号输入框改为下拉选择,并关联产品型号数据
- 修复员工列表排序时 postName 可能为空导致的错误
- 修复会议申请表单中图标未使用 markRaw 包装的问题
- 修复指标绑定解绑时使用错误 ID 字段的问题
已修改5个文件
153 ■■■■ 文件已修改
src/views/collaborativeApproval/notificationManagement/meetApplication/index.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/finalInspection/components/formDia.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/metricBinding/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/processInspection/components/formDia.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/notificationManagement/meetApplication/index.vue
@@ -127,7 +127,7 @@
            <el-option
                v-for="person in employees"
                :key="person.id"
                :label="`${person.staffName} (${person.postName})`"
                :label="person.postName ? `${person.staffName} (${person.postName})` : person.staffName"
                :value="person.id"
            />
          </el-select>
@@ -152,9 +152,9 @@
</template>
<script setup>
import {ref, reactive, onMounted} from 'vue'
import {ref, reactive, onMounted, markRaw} from 'vue'
import {ElMessage} from 'element-plus'
import {Plus, Document, Promotion, Bell} from '@element-plus/icons-vue'
import {Document, Promotion, Bell} from '@element-plus/icons-vue'
import {getRoomEnum, saveMeetingApplication} from '@/api/collaborativeApproval/meeting.js'
import {staffOnJobListPage} from "@/api/personnelManagement/staffOnJob.js";
@@ -167,19 +167,19 @@
    value: 'approval',
    name: '审批流程会议',
    desc: '需要经过多级审批的会议申请',
    icon: Document
    icon: markRaw(Document)
  },
  {
    value: 'department',
    name: '部门级会议',
    desc: '部门内部会议申请流程',
    icon: Promotion
    icon: markRaw(Promotion)
  },
  {
    value: 'notification',
    name: '会议通知',
    desc: '无需审批直接发布的会议通知',
    icon: Bell
    icon: markRaw(Bell)
  }
])
@@ -307,7 +307,12 @@
    size: -1,
    staffState: 1
  }).then(res => {
    employees.value = res.data.records.sort((a, b) => a.postName.localeCompare(b.postName))
    console.log(res.data.records,"这个是返回的数据地址")
    employees.value = res.data.records.sort((a, b) => {
      const nameA = a.postName || ''
      const nameB = b.postName?.trim() || ''
      return nameA.localeCompare(nameB)
    })
  })
})
</script>
src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -23,8 +23,21 @@
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="规格型号:" prop="model">
              <el-input v-model="form.model" placeholder="请输入" clearable/>
            <el-form-item label="规格型号:" prop="productModelId">
              <el-select
                v-model="form.productModelId"
                placeholder="请选择"
                clearable
                @change="getProductModel"
                style="width: 100%"
              >
                <el-option
                  v-for="item in modelOptions"
                  :key="item.id"
                  :label="item.model"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
@@ -121,7 +134,7 @@
<script setup>
import {ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
import {getOptions} from "@/api/procurementManagement/procurementLedger.js";
import {productTreeList} from "@/api/basicData/product.js";
import {modelList, productTreeList} from "@/api/basicData/product.js";
import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js";
import {userListNoPage} from "@/api/system/user.js";
import {qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId} from "@/api/qualityManagement/metricMaintenance.js";
@@ -138,6 +151,7 @@
    checkName: "",
    productName: "",
    productId: "",
    productModelId: "",
    model: "",
    testStandardId: "",
    unit: "",
@@ -150,6 +164,7 @@
    process: [{ required: true, message: "请输入", trigger: "blur" }],
    checkName: [{ required: false, message: "请输入", trigger: "blur" }],
    productId: [{ required: true, message: "请输入", trigger: "blur" }],
    productModelId: [{required: true, message: "请选择规格型号", trigger: "change"}],
    model: [{ required: false, message: "请输入", trigger: "blur" }],
    testStandardId: [{required: true, message: "请选择指标", trigger: "change"}],
    unit: [{ required: false, message: "请输入", trigger: "blur" }],
@@ -188,6 +203,7 @@
const tableData = ref([]);
const tableLoading = ref(false);
const userList = ref([]);
const modelOptions = ref([]); // 规格型号下拉框数据
const currentProductId = ref(0);
const testStandardOptions = ref([]); // 指标选择下拉框数据
@@ -203,6 +219,7 @@
    form.value = {}
  testStandardOptions.value = [];
  tableData.value = [];
  modelOptions.value = [];
  getProductOptions();
  if (operationType.value === 'edit') {
    // 先保存 testStandardId,避免被清空
@@ -212,6 +229,10 @@
        currentProductId.value = row.productId || 0
        // 编辑模式下,先加载指标选项,然后加载参数列表
        if (currentProductId.value) {
      // 加载规格型号选项
      modelList({ id: currentProductId.value }).then((res) => {
        modelOptions.value = res;
      });
            // 先加载指标选项
            let params = {
                productId: currentProductId.value,
@@ -259,10 +280,26 @@
const getModels = (value) => {
    currentProductId.value = value
  form.value.productName = findNodeById(productOptions.value, value);
  modelOptions.value = [];
  form.value.productModelId = "";
  form.value.model = "";
    if (currentProductId.value) {
    modelList({ id: value }).then((res) => {
      modelOptions.value = res;
    });
        getList();
    }
};
const getProductModel = (value) => {
  const index = modelOptions.value.findIndex((item) => item.id === value);
  if (index !== -1) {
    form.value.model = modelOptions.value[index].model;
    form.value.unit = modelOptions.value[index].unit;
  } else {
    form.value.model = "";
    form.value.unit = "";
  }
};
const findNodeById = (nodes, productId) => {
  for (let i = 0; i < nodes.length; i++) {
    if (nodes[i].value === productId) {
src/views/qualityManagement/metricBinding/index.vue
@@ -375,7 +375,7 @@
}
const handleUnbind = async (row) => {
  if (!row?.id) return
  if (!row?.processId) return
  try {
    await ElMessageBox.confirm('确认删除该绑定?', '提示', { type: 'warning' })
  } catch {
src/views/qualityManagement/processInspection/components/formDia.vue
@@ -43,8 +43,21 @@
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="规格型号:" prop="model">
              <el-input v-model="form.model" placeholder="请输入" clearable/>
            <el-form-item label="规格型号:" prop="productModelId">
              <el-select
                v-model="form.productModelId"
                placeholder="请选择"
                clearable
                @change="getProductModel"
                style="width: 100%"
              >
                <el-option
                  v-for="item in modelOptions"
                  :key="item.id"
                  :label="item.model"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
@@ -141,7 +154,7 @@
<script setup>
import {ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
import {getOptions} from "@/api/procurementManagement/procurementLedger.js";
import {productTreeList} from "@/api/basicData/product.js";
import {modelList, productTreeList} from "@/api/basicData/product.js";
import {productProcessListPage} from "@/api/basicData/productProcess.js";
import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js";
import {qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId} from "@/api/qualityManagement/metricMaintenance.js";
@@ -159,6 +172,7 @@
    checkName: "",
    productName: "",
    productId: "",
    productModelId: "",
    model: "",
    testStandardId: "",
    unit: "",
@@ -171,6 +185,7 @@
    processId: [{ required: true, message: "请选择工序", trigger: "change" }],
    checkName: [{ required: false, message: "请输入", trigger: "blur" }],
    productId: [{ required: true, message: "请输入", trigger: "blur" }],
    productModelId: [{required: true, message: "请选择规格型号", trigger: "change"}],
    model: [{ required: false, message: "请输入", trigger: "blur" }],
    testStandardId: [{required: true, message: "请选择指标", trigger: "change"}],
    unit: [{ required: false, message: "请输入", trigger: "blur" }],
@@ -211,6 +226,7 @@
const tableLoading = ref(false);
const currentProductId = ref(0);
const processOptions = ref([]); // 工序下拉框数据
const modelOptions = ref([]); // 规格型号下拉框数据
const testStandardOptions = ref([]); // 指标选择下拉框数据
// 获取工序列表
@@ -241,6 +257,7 @@
    form.value = {}
    testStandardOptions.value = [];
    tableData.value = [];
    modelOptions.value = [];
    getProductOptions();
    // 先加载工序列表
    await getProcessList();
@@ -260,6 +277,10 @@
        currentProductId.value = row.productId || 0
        // 编辑模式下,先加载指标选项,然后加载参数列表
        if (currentProductId.value) {
            // 加载规格型号选项
            modelList({ id: currentProductId.value }).then((res) => {
                modelOptions.value = res;
            });
            // 先加载指标选项
            let params = {
                productId: currentProductId.value,
@@ -307,10 +328,26 @@
const getModels = (value) => {
    currentProductId.value = value
  form.value.productName = findNodeById(productOptions.value, value);
    modelOptions.value = [];
    form.value.productModelId = "";
    form.value.model = "";
    if (currentProductId.value) {
        modelList({ id: value }).then((res) => {
            modelOptions.value = res;
        });
        getList();
    }
};
const getProductModel = (value) => {
    const index = modelOptions.value.findIndex((item) => item.id === value);
    if (index !== -1) {
        form.value.model = modelOptions.value[index].model;
        form.value.unit = modelOptions.value[index].unit;
    } else {
        form.value.model = "";
        form.value.unit = "";
    }
};
const findNodeById = (nodes, productId) => {
  for (let i = 0; i < nodes.length; i++) {
    if (nodes[i].value === productId) {
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
@@ -26,23 +26,15 @@
          </el-col>
          <el-col :span="12">
            <el-form-item label="产品名称:" prop="productId">
              <el-tree-select
                  v-model="form.productId"
                  placeholder="请选择"
                  clearable
                  check-strictly
                  @change="getModels"
                  :data="productOptions"
                  :render-after-expand="false"
                  style="width: 100%"
              />
              <el-tree-select v-model="form.productId" placeholder="请选择" clearable check-strictly
                @change="getModels" :data="productOptions" :render-after-expand="false" style="width: 100%" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="规格型号:" prop="model">
              <el-input v-model="form.model" placeholder="请输入" clearable/>
            <el-form-item label="规格型号:" prop="productModelId">
              <el-select v-model="form.productModelId" placeholder="请选择" clearable @change="getProductModel" style="width: 100%">
                <el-option v-for="item in modelOptions" :key="item.id" :label="item.model" :value="item.id" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
@@ -141,7 +133,7 @@
<script setup>
import {ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
import {getOptions} from "@/api/procurementManagement/procurementLedger.js";
import {productTreeList} from "@/api/basicData/product.js";
import {modelList, productTreeList} from "@/api/basicData/product.js";
import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js";
import {ElMessageBox} from "element-plus";
import {qualityInspectParamDel, qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
@@ -159,6 +151,7 @@
    checkName: "",
    productName: "",
    productId: "",
    productModelId: "",
    model: "",
    testStandardId: "",
    unit: "",
@@ -171,6 +164,7 @@
    supplier: [{required: true, message: "请输入", trigger: "blur"}],
    checkName: [{required: false, message: "请输入", trigger: "blur"}],
    productId: [{required: true, message: "请输入", trigger: "blur"}],
    productModelId: [{required: true, message: "请选择规格型号", trigger: "change"}],
    model: [{required: false, message: "请输入", trigger: "blur"}],
    testStandardId: [{required: true, message: "请选择指标", trigger: "change"}],
    unit: [{required: false, message: "请输入", trigger: "blur"}],
@@ -209,6 +203,7 @@
const {form, rules} = toRefs(data);
const supplierList = ref([]);
const productOptions = ref([]);
const modelOptions = ref([]);
const currentProductId = ref(0);
const testStandardOptions = ref([]); // 指标选择下拉框数据
@@ -222,6 +217,7 @@
    form.value = {}
  testStandardOptions.value = [];
  tableData.value = [];
  modelOptions.value = [];
  getProductOptions();
  if (operationType.value === 'edit') {
    // 先保存 testStandardId,避免被清空
@@ -230,6 +226,10 @@
    currentProductId.value = row.productId || 0
    // 编辑模式下,先加载指标选项,然后加载参数列表
    if (currentProductId.value) {
      // 加载规格型号选项
      modelList({ id: currentProductId.value }).then((res) => {
        modelOptions.value = res;
      });
      // 先加载指标选项
      let params = {
        productId: currentProductId.value,
@@ -276,10 +276,26 @@
const getModels = (value) => {
  currentProductId.value = value
  form.value.productName = findNodeById(productOptions.value, value);
  modelOptions.value = [];
  form.value.productModelId = "";
  form.value.model = "";
  if (currentProductId.value) {
    modelList({ id: value }).then((res) => {
      modelOptions.value = res;
    });
    getList();
  }
};
const getProductModel = (value) => {
  const index = modelOptions.value.findIndex((item) => item.id === value);
  if (index !== -1) {
    form.value.model = modelOptions.value[index].model;
    form.value.unit = modelOptions.value[index].unit;
  } else {
    form.value.model = "";
    form.value.unit = "";
  }
};
const findNodeById = (nodes, productId) => {
  for (let i = 0; i < nodes.length; i++) {
    if (nodes[i].value === productId) {