已添加3个文件
已修改13个文件
688 ■■■■ 文件已修改
src/components/PIMTable/PIMTable.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/upkeep/index.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/issueManagement/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/operationScheduling/components/formDia.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionReporting/components/formDia.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/finalInspection/components/detailDia.vue 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/finalInspection/components/formDia.vue 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/finalInspection/index.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/nonconformingManagement/components/inspectionFormDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/processInspection/components/detailDia.vue 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/processInspection/components/formDia.vue 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/processInspection/index.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/rawMaterialInspection/components/detailDia.vue 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue 107 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/rawMaterialInspection/index.vue 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/PIMTable/PIMTable.vue
@@ -40,7 +40,7 @@
      :fixed="item.fixed"
      :label="item.label"
      :prop="item.prop"
      show-overflow-tooltip
      :show-overflow-tooltip="item.dataType !== 'action'"
      :align="item.align"
      :sortable="!!item.sortable"
      :type="item.type"
src/views/equipmentManagement/upkeep/index.vue
@@ -244,7 +244,7 @@
})
const dataList = ref([])
const pagination = reactive({
const pagination = ref({
  currentPage: 1,
  pageSize: 10,
  total: 0,
@@ -422,8 +422,8 @@
}
const changeScheduledPage = (page) => {
  scheduledPagination.currentPage = page.current
  scheduledPagination.pageSize = page.size
  scheduledPagination.currentPage = page.page
  scheduledPagination.pageSize = page.limit
  getScheduledTableData()
}
@@ -463,8 +463,8 @@
const getTableData = async () => {
  try {
    const params = {
      current: pagination.currentPage,
      size: pagination.pageSize,
      current: pagination.value.currentPage,
      size: pagination.value.pageSize,
      deviceName: filters.deviceName || undefined,
      maintenancePlanTime: filters.maintenancePlanTime ? dayjs(filters.maintenancePlanTime).format('YYYY-MM-DD') : undefined,
      maintenanceActuallyTime: filters.maintenanceActuallyTime ? dayjs(filters.maintenanceActuallyTime).format('YYYY-MM-DD') : undefined,
@@ -474,7 +474,7 @@
    const { code, data } = await getUpkeepPage(params)
    if (code === 200) {
      dataList.value = data.records
      pagination.total = data.total
      pagination.value.total = data.total
    }
  } catch (error) {
    console.log(error);
@@ -495,8 +495,8 @@
}
const changePage = (page) => {
  pagination.currentPage = page.current
  pagination.pageSize = page.size
  pagination.value.currentPage = page.page
  pagination.value.pageSize = page.limit
  getTableData()
}
src/views/inventoryManagement/issueManagement/index.vue
@@ -187,7 +187,7 @@
    nickName: '',
    userId: '',
    productCategory:'',
    timeStr: getCurrentDate(),
    // timeStr: getCurrentDate(),
  },
  form: {
    productrecordId: '',
@@ -216,10 +216,10 @@
  const params = { ...page }
  if (activeTab.value === 'production') {
    params.customerName = searchForm.value.customerName
    params.timeStr = searchForm.value.timeStr
    // params.timeStr = searchForm.value.timeStr
  } else {
    params.supplierName = searchForm.value.supplierName
    params.timeStr = searchForm.value.timeStr
    // params.timeStr = searchForm.value.timeStr
  }
  params.productCategory = searchForm.value.productCategory
  params.flag = true
@@ -244,7 +244,7 @@
  page.current = 1
  searchForm.value.supplierName = ''
  searchForm.value.customerName = ''
  searchForm.value.timeStr = ''
  // searchForm.value.timeStr = ''
  selectedRows.value = []
  searchForm.value.productCategory = ''
  getList()
src/views/productionManagement/operationScheduling/components/formDia.vue
@@ -127,6 +127,7 @@
import {userListNoPageByTenantId} from "@/api/system/user.js";
import {processScheduling} from "@/api/productionManagement/operationScheduling.js";
const { proxy } = getCurrentInstance()
import dayjs from "dayjs";
const { work_step } = proxy.useDict("work_step")
const emit = defineEmits(['close'])
@@ -165,15 +166,22 @@
            sunqianUserId.value = sunqianUser.userId;
        }
        // åœ¨ç”¨æˆ·åˆ—表加载完成后创建行数据,并将产线数据带入
        tableData.value = [createRow(row)];
        tableData.value = [createRow(row, { defaultNum: pendingNum.value })];
    });
}
const createRow = (row) => ({
const getToday = () => dayjs().format("YYYY-MM-DD");
const getRemaining = () => {
    const used = tableData.value.reduce((sum, row) => sum + Number(row.schedulingNum || 0), 0);
    const remain = Number(pendingNum.value || 0) - used;
    return remain > 0 ? remain : 0;
};
const createRow = (row, options = {}) => ({
    id: idFromRow.value,
    process: '包装',
    schedulingDate: '',
    schedulingNum: null,
    schedulingDate: getToday(), // é»˜è®¤å½“天
    schedulingNum: options.defaultNum ?? null, // é»˜è®¤ç”¨å‰©ä½™æ•°é‡å¡«æ»¡
    schedulingUserId: sunqianUserId.value, // é»˜è®¤è®¾ç½®ä¸ºå­™å€©çš„用户ID
    workHours: null,
    unit: unitFromRow.value,
@@ -239,7 +247,12 @@
});
const addRow = () => {
  tableData.value.push(createRow());
    const remaining = getRemaining();
    if (remaining <= 0) {
        proxy.$modal.msgWarning('已排满,无剩余数量');
        return;
    }
  tableData.value.push(createRow({}, { defaultNum: remaining }));
};
const removeRow = (index) => {
  tableData.value.splice(index, 1);
src/views/productionManagement/productionReporting/components/formDia.vue
@@ -107,6 +107,7 @@
  form: {
        successNum: "",
        schedulingNum: "",
    pendingNum: "",
        finishedNum: "",
        schedulingUserId: "",
        schedulingDate: "",
@@ -127,6 +128,12 @@
        userList.value = res.data;
    });
    form.value = {...row}
  const total = Number(row?.schedulingNum ?? 0);
  const pendingFinish = Number(row?.pendingFinishNum ?? 0);
  const autoFill = pendingFinish > 0 ? Math.min(pendingFinish, total) : total;
  form.value.finishedNum = autoFill;
  form.value.pendingNum = Math.max(total - autoFill, 0);
  changeNum(form.value.finishedNum);
}
const changeNum = (value) => {
src/views/qualityManagement/finalInspection/components/detailDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,83 @@
<template>
  <div>
    <el-dialog
        v-model="dialogVisible"
        title="出厂检验详情"
        width="70%"
        @close="closeDialog"
    >
      <el-descriptions :column="2" border>
        <el-descriptions-item label="检测日期">{{ detailData.checkTime || '-' }}</el-descriptions-item>
        <el-descriptions-item label="产品名称">{{ detailData.productName || '-' }}</el-descriptions-item>
        <el-descriptions-item label="规格型号">{{ detailData.model || '-' }}</el-descriptions-item>
        <el-descriptions-item label="单位">{{ detailData.unit || '-' }}</el-descriptions-item>
        <el-descriptions-item label="数量">{{ detailData.quantity ?? '-' }}</el-descriptions-item>
        <el-descriptions-item label="检测结果">{{ detailData.checkResult || '-' }}</el-descriptions-item>
        <el-descriptions-item label="检验员">{{ detailData.checkName || '-' }}</el-descriptions-item>
      </el-descriptions>
      <div style="margin-top: 20px">
        <el-table :data="tableData" v-loading="tableLoading" border style="width: 100%" height="400">
          <el-table-column label="指标" prop="parameterItem" />
          <el-table-column label="单位" prop="unit" />
          <el-table-column label="标准值" prop="standardValue" />
          <el-table-column label="内控值" prop="controlValue" />
          <el-table-column label="检验值" prop="testValue" />
        </el-table>
      </div>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="closeDialog">关闭</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import {ref} from "vue";
import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
const emit = defineEmits(["close"]);
const dialogVisible = ref(false);
const detailData = ref({});
const tableData = ref([]);
const tableLoading = ref(false);
const openDialog = (row) => {
  detailData.value = row || {};
  dialogVisible.value = true;
  loadParams(row?.id);
};
const loadParams = (id) => {
  if (!id) {
    tableData.value = [];
    return;
  }
  tableLoading.value = true;
  qualityInspectParamInfo(id)
      .then((res) => {
        tableData.value = res.data || [];
      })
      .finally(() => {
        tableLoading.value = false;
      });
};
const closeDialog = () => {
  dialogVisible.value = false;
  tableData.value = [];
  emit("close");
};
defineExpose({
  openDialog,
});
</script>
<style scoped>
</style>
src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -24,7 +24,7 @@
          </el-col>
          <el-col :span="12">
            <el-form-item label="规格型号:" prop="model">
              <el-input v-model="form.model" placeholder="请输入" clearable/>
                            <el-input v-model="form.model" placeholder="请输入" clearable/>
            </el-form-item>
          </el-col>
        </el-row>
@@ -42,11 +42,6 @@
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检测单位:" prop="checkCompany">
              <el-input v-model="form.checkCompany" placeholder="请输入" clearable/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检测结果:" prop="checkResult">
              <el-select v-model="form.checkResult">
                <el-option label="合格" value="合格" />
@@ -54,18 +49,18 @@
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检验员:" prop="checkName">
                    <el-col :span="12">
                        <el-form-item label="检验员:" prop="checkName">
                            <el-select v-model="form.checkName"               filterable
                         default-first-option
                         :reserve-keyword="false" placeholder="请选择" clearable>
                                                 default-first-option
                                                 :reserve-keyword="false" placeholder="请选择" clearable>
                                <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName"
                                                     :value="item.nickName"/>
                            </el-select>
            </el-form-item>
          </el-col>
                        </el-form-item>
                    </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检测日期:" prop="checkTime">
              <el-date-picker
@@ -103,15 +98,20 @@
</template>
<script setup>
import {ref} from "vue";
import {ref, computed} from "vue";
import dayjs from "dayjs";
import useUserStore from "@/store/modules/user.js";
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} from "@/api/qualityManagement/metricMaintenance.js";
import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
const userStore = useUserStore()
const currentUserName = computed(() => userStore.nickName || userStore.name || "")
const getToday = () => dayjs().format("YYYY-MM-DD")
const dialogFormVisible = ref(false);
const operationType = ref('')
@@ -171,6 +171,7 @@
const tableLoading = ref(false);
const userList = ref([]);
const currentProductId = ref(0);
const modelOptions = ref([]);
// æ‰“开弹框
const openDialog = async (type, row) => {
@@ -186,21 +187,50 @@
  if (operationType.value === 'edit') {
    form.value = {...row}
        currentProductId.value = row.productId || 0
        // åŠ è½½å½“å‰äº§å“ä¸‹çš„è§„æ ¼åˆ—è¡¨ï¼Œå¹¶æ ¹æ®åŽç«¯è¿”å›žçš„ model åæŸ¥å¹¶è®¾ç½® modelId,实现规格下拉框反显
        if (currentProductId.value) {
            modelList({ id: currentProductId.value }).then((res) => {
                modelOptions.value = res;
                const target = res.find((item) => item.model === row.model);
                if (target) {
                    form.value.modelId = target.id;
                }
            });
        }
        getQualityInspectParamList(row.id)
  }
    // é»˜è®¤æ£€éªŒå‘˜ä¸ºå½“前登录人,检测日期默认为当天(空时填充)
    if (currentUserName.value && !form.value.checkName) {
        form.value.checkName = currentUserName.value;
    }
    if (!form.value.checkTime) {
        form.value.checkTime = getToday();
    }
}
const getProductOptions = () => {
  productTreeList().then((res) => {
  productTreeList({productName: '质量'}).then((res) => {
    productOptions.value = convertIdToValue(res);
  });
};
const getModels = (value) => {
    currentProductId.value = value
  form.value.productName = findNodeById(productOptions.value, value);
    modelList({ id: value }).then((res) => {
        modelOptions.value = res;
    });
    if (currentProductId) {
        getList();
    }
};
const getProductModel = (value) => {
    const index = modelOptions.value.findIndex((item) => item.id === value);
    if (index !== -1) {
        form.value.unit = modelOptions.value[index].unit;
        form.value.model = modelOptions.value[index].model;
    } else {
        form.value.unit = null;
    }
};
const findNodeById = (nodes, productId) => {
  for (let i = 0; i < nodes.length; i++) {
    if (nodes[i].value === productId) {
src/views/qualityManagement/finalInspection/index.vue
@@ -39,6 +39,7 @@
    </div>
    <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia>
    <FormDia ref="formDia" @close="handleQuery"></FormDia>
    <DetailDia ref="detailDia"></DetailDia>
    <files-dia ref="filesDia" @close="handleQuery"></files-dia>
        <el-dialog v-model="dialogFormVisible" title="编辑检验员" width="30%"
                             @close="closeDia">
@@ -65,6 +66,7 @@
import {onMounted, ref} from "vue";
import InspectionFormDia from "@/views/qualityManagement/finalInspection/components/inspectionFormDia.vue";
import FormDia from "@/views/qualityManagement/finalInspection/components/formDia.vue";
import DetailDia from "@/views/qualityManagement/finalInspection/components/detailDia.vue";
import {ElMessageBox} from "element-plus";
import {
    downloadQualityInspect,
@@ -116,11 +118,6 @@
    width: 100
  },
  {
    label: "检测单位",
    prop: "checkCompany",
    width: 120
  },
  {
    label: "检测结果",
    prop: "checkResult",
    dataType: "tag",
@@ -150,11 +147,10 @@
    label: "操作",
    align: "center",
    fixed: "right",
    width: 300,
    width: 260,
    operation: [
      {
        name: "编辑",
        type: "text",
        clickFun: (row) => {
          openForm("edit", row);
        },
@@ -162,16 +158,8 @@
                    return row.inspectState == 1;
                }
      },
      {
        name: "附件",
        type: "text",
        clickFun: (row) => {
          openFilesFormDia(row);
        },
      },
            {
                name: "提交",
                type: "text",
                clickFun: (row) => {
                    submit(row.id);
                },
@@ -179,23 +167,14 @@
                    return row.inspectState == 1;
                }
            },
            {
                name: "分配检验员",
                type: "text",
                clickFun: (row) => {
                    if (!row.checkName) {
                        open(row)
                    } else {
                        proxy.$modal.msgError("检验员已存在");
                    }
                },
                disabled: (row) => {
                    return row.inspectState == 1 || row.checkName;
                }
            },
      {
        name: "查看",
        clickFun: (row) => {
          openDetail(row);
        },
      },
            {
                name: "下载",
                type: "text",
                clickFun: (row) => {
                    downLoadFile(row);
                },
@@ -215,6 +194,7 @@
const formDia = ref()
const filesDia = ref()
const inspectionFormDia = ref()
const detailDia = ref()
const { proxy } = getCurrentInstance()
const userList = ref([]);
const form = ref({
@@ -265,6 +245,11 @@
    formDia.value?.openDialog(type, row)
  })
};
const openDetail = (row) => {
  nextTick(() => {
    detailDia.value?.openDialog(row)
  })
};
// æ‰“开新增检验弹框
const openInspectionForm = (type, row) => {
  nextTick(() => {
src/views/qualityManagement/nonconformingManagement/components/inspectionFormDia.vue
@@ -149,7 +149,7 @@
    quantity: "",
    checkCompany: "",
    checkResult: "",
    inspectState: '',
    inspectState: 1,
    inspectType: '',
    defectivePhenomena: '',
    dealResult: '',
src/views/qualityManagement/processInspection/components/detailDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,84 @@
<template>
  <div>
    <el-dialog
        v-model="dialogVisible"
        title="过程检验详情"
        width="70%"
        @close="closeDialog"
    >
      <el-descriptions :column="2" border>
        <el-descriptions-item label="检测日期">{{ detailData.checkTime || '-' }}</el-descriptions-item>
        <el-descriptions-item label="工序">{{ detailData.process || '-' }}</el-descriptions-item>
        <el-descriptions-item label="产品名称">{{ detailData.productName || '-' }}</el-descriptions-item>
        <el-descriptions-item label="规格型号">{{ detailData.model || '-' }}</el-descriptions-item>
        <el-descriptions-item label="单位">{{ detailData.unit || '-' }}</el-descriptions-item>
        <el-descriptions-item label="数量">{{ detailData.quantity ?? '-' }}</el-descriptions-item>
        <el-descriptions-item label="检测结果">{{ detailData.checkResult || '-' }}</el-descriptions-item>
        <el-descriptions-item label="检验员">{{ detailData.checkName || '-' }}</el-descriptions-item>
      </el-descriptions>
      <div style="margin-top: 20px">
        <el-table :data="tableData" v-loading="tableLoading" border style="width: 100%" height="400">
          <el-table-column label="指标" prop="parameterItem" />
          <el-table-column label="单位" prop="unit" />
          <el-table-column label="标准值" prop="standardValue" />
          <el-table-column label="内控值" prop="controlValue" />
          <el-table-column label="检验值" prop="testValue" />
        </el-table>
      </div>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="closeDialog">关闭</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import {ref} from "vue";
import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
const emit = defineEmits(["close"]);
const dialogVisible = ref(false);
const detailData = ref({});
const tableData = ref([]);
const tableLoading = ref(false);
const openDialog = (row) => {
  detailData.value = row || {};
  dialogVisible.value = true;
  loadParams(row?.id);
};
const loadParams = (id) => {
  if (!id) {
    tableData.value = [];
    return;
  }
  tableLoading.value = true;
  qualityInspectParamInfo(id)
      .then((res) => {
        tableData.value = res.data || [];
      })
      .finally(() => {
        tableLoading.value = false;
      });
};
const closeDialog = () => {
  dialogVisible.value = false;
  tableData.value = [];
  emit("close");
};
defineExpose({
  openDialog,
});
</script>
<style scoped>
</style>
src/views/qualityManagement/processInspection/components/formDia.vue
@@ -31,41 +31,35 @@
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="规格型号:" prop="model">
              <el-input v-model="form.model" placeholder="请输入" clearable/>
                            <el-input v-model="form.model" placeholder="请输入" clearable/>
            </el-form-item>
          </el-col>
                    <el-col :span="12">
                        <el-form-item label="单位:" prop="unit">
                            <el-input v-model="form.unit" placeholder="请输入" clearable/>
                        </el-form-item>
                    </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="单位:" prop="unit">
              <el-input v-model="form.unit" placeholder="请输入" clearable/>
            </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"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检测单位:" prop="checkCompany">
              <el-input v-model="form.checkCompany" placeholder="请输入" clearable/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检测结果:" prop="checkResult">
              <el-select v-model="form.checkResult">
                <el-option label="合格" value="合格" />
                <el-option label="不合格" value="不合格" />
              </el-select>
            </el-form-item>
          </el-col>
                    <el-col :span="12">
                        <el-form-item label="检测结果:" prop="checkResult">
                            <el-select v-model="form.checkResult">
                                <el-option label="合格" value="合格" />
                                <el-option label="不合格" value="不合格" />
                            </el-select>
                        </el-form-item>
                    </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检验员:" prop="checkName">
                            <el-select v-model="form.checkName"               filterable
                            <el-select v-model="form.checkName"
                                                 filterable
                         default-first-option
                         :reserve-keyword="false" placeholder="请选择" clearable>
                                <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName"
@@ -110,15 +104,20 @@
</template>
<script setup>
import {ref} from "vue";
import {ref, computed} 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 {qualityInspectDetailByProductId} from "@/api/qualityManagement/metricMaintenance.js";
import {userListNoPage} from "@/api/system/user.js";
import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
import dayjs from "dayjs";
import useUserStore from "@/store/modules/user.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
const userStore = useUserStore()
const currentUserName = computed(() => userStore.nickName || userStore.name || "")
const getToday = () => dayjs().format("YYYY-MM-DD")
const dialogFormVisible = ref(false);
const operationType = ref('')
@@ -138,7 +137,7 @@
  rules: {
    checkTime: [{ required: true, message: "请输入", trigger: "blur" },],
    process: [{ required: true, message: "请输入", trigger: "blur" }],
    checkName: [{ required: false, message: "请输入", trigger: "blur" }],
    checkName: [{ required: true, message: "请输入", trigger: "blur" }],
    productId: [{ required: true, message: "请输入", trigger: "blur" }],
    model: [{ required: false, message: "请输入", trigger: "blur" }],
    unit: [{ required: false, message: "请输入", trigger: "blur" }],
@@ -178,6 +177,7 @@
const tableData = ref([]);
const tableLoading = ref(false);
const currentProductId = ref(0);
const modelOptions = ref([]);
// æ‰“开弹框
const openDialog = async (type, row) => {
@@ -193,21 +193,50 @@
    if (operationType.value === 'edit') {
        form.value = {...row}
        currentProductId.value = row.productId || 0
        // åŠ è½½å½“å‰äº§å“ä¸‹çš„è§„æ ¼åˆ—è¡¨ï¼Œå¹¶æ ¹æ®åŽç«¯è¿”å›žçš„ model åæŸ¥å¹¶è®¾ç½® modelId,实现规格下拉框反显
        if (currentProductId.value) {
            modelList({ id: currentProductId.value }).then((res) => {
                modelOptions.value = res;
                const target = res.find((item) => item.model === row.model);
                if (target) {
                    form.value.modelId = target.id;
                }
            });
        }
        getQualityInspectParamList(row.id)
    }
    // é»˜è®¤æ£€éªŒå‘˜ä¸ºå½“前登录人,检测日期默认为当天(空时填充)
    if (currentUserName.value && !form.value.checkName) {
        form.value.checkName = currentUserName.value;
    }
    if (!form.value.checkTime) {
        form.value.checkTime = getToday();
    }
}
const getProductOptions = () => {
  productTreeList().then((res) => {
  productTreeList({productName: '质量'}).then((res) => {
    productOptions.value = convertIdToValue(res);
  });
};
const getModels = (value) => {
    currentProductId.value = value
  form.value.productName = findNodeById(productOptions.value, value);
    modelList({ id: value }).then((res) => {
        modelOptions.value = res;
    });
    if (currentProductId) {
        getList();
    }
};
const getProductModel = (value) => {
    const index = modelOptions.value.findIndex((item) => item.id === value);
    if (index !== -1) {
        form.value.unit = modelOptions.value[index].unit;
        form.value.model = modelOptions.value[index].model;
    } else {
        form.value.unit = null;
    }
};
const findNodeById = (nodes, productId) => {
  for (let i = 0; i < nodes.length; i++) {
    if (nodes[i].value === productId) {
src/views/qualityManagement/processInspection/index.vue
@@ -39,6 +39,7 @@
    </div>
    <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia>
    <FormDia ref="formDia" @close="handleQuery"></FormDia>
    <DetailDia ref="detailDia"></DetailDia>
    <files-dia ref="filesDia" @close="handleQuery"></files-dia>
        <el-dialog v-model="dialogFormVisible" title="编辑检验员" width="30%"
                             @close="closeDia">
@@ -65,6 +66,7 @@
import {onMounted, ref} from "vue";
import InspectionFormDia from "@/views/qualityManagement/processInspection/components/inspectionFormDia.vue";
import FormDia from "@/views/qualityManagement/processInspection/components/formDia.vue";
import DetailDia from "@/views/qualityManagement/processInspection/components/detailDia.vue";
import {ElMessageBox} from "element-plus";
import {
    downloadQualityInspect,
@@ -121,11 +123,6 @@
    width: 100
  },
  {
    label: "检测单位",
    prop: "checkCompany",
    width: 120
  },
  {
    label: "检测结果",
    prop: "checkResult",
    dataType: "tag",
@@ -155,11 +152,10 @@
    label: "操作",
    align: "center",
    fixed: "right",
    width: 300,
    width: 260,
    operation: [
      {
        name: "编辑",
        type: "text",
        clickFun: (row) => {
          openForm("edit", row);
        },
@@ -167,16 +163,8 @@
                    return row.inspectState == 1;
                }
      },
      {
        name: "附件",
        type: "text",
        clickFun: (row) => {
          openFilesFormDia(row);
        },
      },
            {
                name: "提交",
                type: "text",
                clickFun: (row) => {
                    submit(row.id);
                },
@@ -184,23 +172,14 @@
                    return row.inspectState == 1;
                }
            },
            {
                name: "分配检验员",
                type: "text",
                clickFun: (row) => {
                    if (!row.checkName) {
                        open(row)
                    } else {
                        proxy.$modal.msgError("检验员已存在");
                    }
                },
                disabled: (row) => {
                    return row.inspectState == 1 || row.checkName;
                }
            },
      {
        name: "查看",
        clickFun: (row) => {
          openDetail(row);
        },
      },
            {
                name: "下载",
                type: "text",
                clickFun: (row) => {
                    downLoadFile(row);
                },
@@ -225,6 +204,7 @@
const formDia = ref()
const filesDia = ref()
const inspectionFormDia = ref()
const detailDia = ref()
const { proxy } = getCurrentInstance()
const changeDaterange = (value) => {
  searchForm.value.entryDateStart = undefined;
@@ -269,6 +249,11 @@
    formDia.value?.openDialog(type, row)
  })
};
const openDetail = (row) => {
  nextTick(() => {
    detailDia.value?.openDialog(row)
  })
};
// æ‰“开新增检验弹框
const openInspectionForm = (type, row) => {
  nextTick(() => {
src/views/qualityManagement/rawMaterialInspection/components/detailDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,83 @@
<template>
  <div>
    <el-dialog
        v-model="dialogVisible"
        title="原材料检验详情"
        width="70%"
        @close="closeDialog"
    >
      <el-descriptions :column="2" border>
        <el-descriptions-item label="检测日期">{{ detailData.checkTime || '-' }}</el-descriptions-item>
        <el-descriptions-item label="供应商">{{ detailData.supplier || '-' }}</el-descriptions-item>
        <el-descriptions-item label="产品名称">{{ detailData.productName || '-' }}</el-descriptions-item>
        <el-descriptions-item label="规格型号">{{ detailData.model || '-' }}</el-descriptions-item>
        <el-descriptions-item label="单位">{{ detailData.unit || '-' }}</el-descriptions-item>
        <el-descriptions-item label="数量">{{ detailData.quantity ?? '-' }}</el-descriptions-item>
        <el-descriptions-item label="检测结果">{{ detailData.checkResult || '-' }}</el-descriptions-item>
        <el-descriptions-item label="检验员">{{ detailData.checkName || '-' }}</el-descriptions-item>
      </el-descriptions>
      <div style="margin-top: 20px">
        <el-table :data="tableData" v-loading="tableLoading" border style="width: 100%" height="400">
          <el-table-column label="指标" prop="parameterItem" />
          <el-table-column label="单位" prop="unit" />
          <el-table-column label="标准值" prop="standardValue" />
          <el-table-column label="内控值" prop="controlValue" />
          <el-table-column label="检验值" prop="testValue" />
        </el-table>
      </div>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="closeDialog">关闭</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import {ref} from "vue";
import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
const emit = defineEmits(["close"]);
const dialogVisible = ref(false);
const detailData = ref({});
const tableData = ref([]);
const tableLoading = ref(false);
const openDialog = (row) => {
  detailData.value = row || {};
  dialogVisible.value = true;
  loadParams(row?.id);
};
const loadParams = (id) => {
  if (!id) {
    tableData.value = [];
    return;
  }
  tableLoading.value = true;
  qualityInspectParamInfo(id)
      .then((res) => {
        tableData.value = res.data || [];
      })
      .finally(() => {
        tableLoading.value = false;
      });
};
const closeDialog = () => {
  dialogVisible.value = false;
  tableData.value = [];
  emit("close");
};
defineExpose({
  openDialog,
});
</script>
<style scoped>
</style>
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
@@ -14,6 +14,7 @@
                  v-model="form.supplier"
                  placeholder="请选择"
                  clearable
                                    filterable
              >
                <el-option
                    v-for="item in supplierList"
@@ -42,43 +43,48 @@
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="规格型号:" prop="model">
              <el-input v-model="form.model" placeholder="请输入" clearable/>
                            <el-input v-model="form.model" placeholder="请输入" clearable/>
            </el-form-item>
          </el-col>
                    <el-col :span="12">
                        <el-form-item label="单位:" prop="unit">
                            <el-input v-model="form.unit" placeholder="请输入" clearable/>
                        </el-form-item>
                    </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="单位:" prop="unit">
              <el-input v-model="form.unit" placeholder="请输入" clearable/>
            </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"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检测单位:" prop="checkCompany">
              <el-input v-model="form.checkCompany" placeholder="请输入" clearable/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检测结果:" prop="checkResult">
              <el-select v-model="form.checkResult">
                <el-option label="合格" value="合格"/>
                <el-option label="不合格" value="不合格"/>
              </el-select>
            </el-form-item>
          </el-col>
                    <el-col :span="12">
                        <el-form-item label="检测结果:" prop="checkResult">
                            <el-select v-model="form.checkResult">
                                <el-option label="合格" value="合格"/>
                                <el-option label="不合格" value="不合格"/>
                            </el-select>
                        </el-form-item>
                    </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检验员:" prop="checkName">
              <el-input v-model="form.checkName" placeholder="请输入" clearable/>
                            <el-select
                                v-model="form.checkName"
                                placeholder="选择人员"
                                style="width: 100%;"
                                filterable
                                clearable
                            >
                                <el-option
                                    v-for="user in userList"
                                    :key="user.nickName"
                                    :label="user.nickName"
                                    :value="user.nickName"
                                />
                            </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
@@ -96,9 +102,6 @@
          </el-col>
        </el-row>
      </el-form>
<!--      <div style="margin-bottom: 10px;text-align: right">-->
<!--        <el-button type="danger" plain @click="handleDelete">删除</el-button>-->
<!--      </div>-->
      <PIMTable
          rowKey="id"
          :column="tableColumn"
@@ -121,17 +124,23 @@
</template>
<script setup>
import {ref} from "vue";
import {ref, computed} 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";
import {qualityInspectDetailByProductId} from "@/api/qualityManagement/metricMaintenance.js";
import {userListNoPageByTenantId} from "@/api/system/user.js";
import dayjs from "dayjs";
import useUserStore from "@/store/modules/user.js";
const {proxy} = getCurrentInstance()
const emit = defineEmits(['close'])
const userList = ref([])
const userStore = useUserStore()
const currentUserName = computed(() => userStore.nickName || userStore.name || "")
const getToday = () => dayjs().format("YYYY-MM-DD")
const dialogFormVisible = ref(false);
const operationType = ref('')
const data = reactive({
@@ -142,6 +151,7 @@
    productName: "",
    productId: "",
    model: "",
        modelId: "",
    unit: "",
    quantity: "",
    checkCompany: "",
@@ -150,7 +160,7 @@
  rules: {
    checkTime: [{required: true, message: "请输入", trigger: "blur"},],
    supplier: [{required: true, message: "请输入", trigger: "blur"}],
    checkName: [{required: false, message: "请输入", trigger: "blur"}],
    checkName: [{required: true, message: "请输入", trigger: "blur"}],
    productId: [{required: true, message: "请输入", trigger: "blur"}],
    model: [{required: false, message: "请输入", trigger: "blur"}],
    unit: [{required: false, message: "请输入", trigger: "blur"}],
@@ -185,6 +195,7 @@
]);
const tableData = ref([]);
const tableLoading = ref(false);
const modelOptions = ref([]);
const {form, rules} = toRefs(data);
const supplierList = ref([]);
@@ -198,26 +209,58 @@
  getOptions().then((res) => {
    supplierList.value = res.data;
  });
    userListNoPageByTenantId().then((res) => {
        userList.value = res.data;
    });
    form.value = {}
  getProductOptions();
  if (operationType.value === 'edit') {
  if (operationType.value === 'edit' && row) {
    form.value = {...row}
    currentProductId.value = row.productId || 0
    // åŠ è½½å½“å‰äº§å“ä¸‹çš„è§„æ ¼åˆ—è¡¨ï¼Œå¹¶æ ¹æ®åŽç«¯è¿”å›žçš„ model åæŸ¥å¹¶è®¾ç½® modelId,实现规格下拉框反显
    if (currentProductId.value) {
      modelList({ id: currentProductId.value }).then((res) => {
        modelOptions.value = res;
        const target = res.find((item) => item.model === row.model);
        if (target) {
          form.value.modelId = target.id;
        }
      });
    }
    getQualityInspectParamList(row.id)
  }
  // é»˜è®¤æ£€éªŒå‘˜ä¸ºå½“前登录人,检测日期默认为当天(空时填充)
  if (currentUserName.value && !form.value.checkName) {
    form.value.checkName = currentUserName.value;
  }
  if (!form.value.checkTime) {
    form.value.checkTime = getToday();
  }
}
const getProductOptions = () => {
  productTreeList().then((res) => {
  productTreeList({productName: '质量'}).then((res) => {
    productOptions.value = convertIdToValue(res);
  });
};
const getModels = (value) => {
  currentProductId.value = value
  form.value.productName = findNodeById(productOptions.value, value);
    modelList({ id: value }).then((res) => {
        modelOptions.value = res;
    });
  if (currentProductId) {
    getList();
  }
};
const getProductModel = (value) => {
    const index = modelOptions.value.findIndex((item) => item.id === value);
    if (index !== -1) {
        form.value.unit = modelOptions.value[index].unit;
        form.value.model = modelOptions.value[index].model;
    } else {
        form.value.unit = null;
    }
};
const findNodeById = (nodes, productId) => {
  for (let i = 0; i < nodes.length; i++) {
    if (nodes[i].value === productId) {
src/views/qualityManagement/rawMaterialInspection/index.vue
@@ -40,6 +40,7 @@
    </div>
    <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia>
    <FormDia ref="formDia" @close="handleQuery"></FormDia>
    <DetailDia ref="detailDia"></DetailDia>
    <files-dia ref="filesDia" @close="handleQuery"></files-dia>
    <el-dialog v-model="dialogFormVisible" title="编辑检验员" width="30%"
               @close="closeDia">
@@ -67,6 +68,7 @@
import {onMounted, ref} from "vue";
import InspectionFormDia from "@/views/qualityManagement/rawMaterialInspection/components/inspectionFormDia.vue";
import FormDia from "@/views/qualityManagement/rawMaterialInspection/components/formDia.vue";
import DetailDia from "@/views/qualityManagement/rawMaterialInspection/components/detailDia.vue";
import {ElMessageBox} from "element-plus";
import {
  downloadQualityInspect,
@@ -123,11 +125,6 @@
    width: 120
  },
  {
    label: "检测单位",
    prop: "checkCompany",
    width: 120
  },
  {
    label: "检测结果",
    prop: "checkResult",
    dataType: "tag",
@@ -157,11 +154,10 @@
    label: "操作",
    align: "center",
    fixed: "right",
    width: 300,
    width: 250,
    operation: [
      {
        name: "编辑",
        type: "text",
        clickFun: (row) => {
          openForm("edit", row);
        },
@@ -170,15 +166,7 @@
                }
      },
      {
        name: "附件",
        type: "text",
        clickFun: (row) => {
          openFilesFormDia(row);
        },
      },
      {
        name: "提交",
        type: "text",
        clickFun: (row) => {
          submit(row.id);
        },
@@ -187,22 +175,13 @@
                }
      },
      {
        name: "分配检验员",
        type: "text",
        name: "查看",
        clickFun: (row) => {
          if (!row.checkName) {
            open(row)
          } else {
            proxy.$modal.msgError("检验员已存在");
          }
          openDetail(row);
        },
                disabled: (row) => {
                    return row.inspectState == 1 || row.checkName;
                }
      },
      {
        name: "下载",
        type: "text",
        clickFun: (row) => {
          downLoadFile(row);
        },
@@ -227,6 +206,7 @@
const formDia = ref()
const filesDia = ref()
const inspectionFormDia = ref()
const detailDia = ref()
const {proxy} = getCurrentInstance()
const changeDaterange = (value) => {
  searchForm.value.entryDateStart = undefined;
@@ -271,6 +251,11 @@
    formDia.value?.openDialog(type, row)
  })
};
const openDetail = (row) => {
  nextTick(() => {
    detailDia.value?.openDialog(row)
  })
};
// æ‰“开附件弹框
const openFilesFormDia = (type, row) => {
  nextTick(() => {
src/views/salesManagement/salesLedger/index.vue
@@ -673,7 +673,6 @@
  });
};
const getProductModel = (value) => {
  console.log("value", value);
  const index = modelOptions.value.findIndex((item) => item.id === value);
  if (index !== -1) {
    productForm.value.specificationModel = modelOptions.value[index].model;