gaoluyang
10 天以前 06bdd4c6c598f5d5c4696bfebab8d8fd0eda25b6
src/views/qualityManagement/rawMaterialInspection/index.vue
@@ -2,9 +2,9 @@
  <div class="app-container">
    <div class="search_form">
      <div>
        <span class="search_title">姓名:</span>
        <span class="search_title">供应商:</span>
        <el-input
            v-model="searchForm.staffName"
            v-model="searchForm.supplier"
            style="width: 240px"
            placeholder="请输入姓名搜索"
            @change="handleQuery"
@@ -34,76 +34,73 @@
          :total="page.total"
      ></PIMTable>
    </div>
    <form-dia ref="formDia" @close="handleQuery"></form-dia>
    <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia>
    <FormDia ref="formDia" @close="handleQuery"></FormDia>
    <files-dia ref="filesDia" @close="handleQuery"></files-dia>
  </div>
</template>
<script setup>
import { Search } from "@element-plus/icons-vue";
import {onMounted, ref} from "vue";
import InspectionFormDia from "@/views/qualityManagement/rawMaterialInspection/components/inspectionFormDia.vue";
import FormDia from "@/views/qualityManagement/rawMaterialInspection/components/formDia.vue";
import {staffJoinDel, staffJoinListPage} from "@/api/personnelManagement/onboarding.js";
import {ElMessageBox} from "element-plus";
import {qualityInspectDel, qualityInspectListPage} from "@/api/qualityManagement/rawMaterialInspection.js";
import FilesDia from "@/views/qualityManagement/rawMaterialInspection/components/filesDia.vue";
const data = reactive({
  searchForm: {
    staffName: "",
    supplier: "",
  },
});
const { searchForm } = toRefs(data);
const tableColumn = ref([
  {
    label: "检测日期",
    prop: "staffNo",
    prop: "checkTime",
    width: 120
  },
  {
    label: "供应商",
    prop: "staffName",
    prop: "supplier",
    width: 230
  },
  {
    label: "检验员",
    prop: "sex",
    prop: "checkName",
  },
  {
    label: "产品名称",
    prop: "nativePlace",
    prop: "productName",
  },
  {
    label: "规格型号",
    prop: "nativePlace",
    prop: "model",
  },
  {
    label: "单位",
    prop: "nativePlace",
    prop: "unit",
  },
  {
    label: "数量",
    prop: "contractStartTime",
    prop: "quantity",
    width: 120
  },
  {
    label: "检测单位",
    prop: "contractEndTime",
    prop: "checkCompany",
    width: 120
  },
  {
    label: "检测结果",
    prop: "staffState",
    prop: "checkResult",
    dataType: "tag",
    formatData: (params) => {
      if (params == 0) {
        return "离职";
      } else if (params == 1) {
        return "在职";
      } else {
        return null;
      }
    },
    formatType: (params) => {
      if (params == 0) {
      if (params == '不合格') {
        return "danger";
      } else if (params == 1) {
        return "primary";
      } else if (params == '合格') {
        return "success";
      } else {
        return null;
      }
@@ -114,20 +111,27 @@
    label: "操作",
    align: "center",
    fixed: "right",
    width: 160,
    width: 190,
    operation: [
      {
        name: "新增检验记录",
        name: "编辑",
        type: "text",
        clickFun: (row) => {
          openForm("edit", row);
        },
      },
      {
        name: "新增检验记录",
        type: "text",
        clickFun: (row) => {
          openInspectionForm("edit", row);
        },
      },
      {
        name: "附件",
        type: "text",
        clickFun: (row) => {
          openForm("edit", row);
          openFilesFormDia(row);
        },
      },
    ],
@@ -142,6 +146,8 @@
  total: 0
});
const formDia = ref()
const filesDia = ref()
const inspectionFormDia = ref()
const { proxy } = getCurrentInstance()
// 查询列表
@@ -157,11 +163,10 @@
};
const getList = () => {
  tableLoading.value = true;
  staffJoinListPage({...page, ...searchForm.value, staffState: 0}).then(res => {
  qualityInspectListPage({...page, ...searchForm.value, inspectType: 0}).then(res => {
    tableLoading.value = false;
    tableData.value = res.data.records
    page.total = res.data.total;
    console.log(page)
  }).catch(err => {
    tableLoading.value = false;
  })
@@ -175,6 +180,18 @@
const openForm = (type, row) => {
  nextTick(() => {
    formDia.value?.openDialog(type, row)
  })
};
// 打开新增检验弹框
const openInspectionForm = (type, row) => {
  nextTick(() => {
    inspectionFormDia.value?.openDialog(type, row)
  })
};
// 打开附件弹框
const openFilesFormDia = (type, row) => {
  nextTick(() => {
    filesDia.value?.openDialog(type, row)
  })
};
@@ -193,7 +210,7 @@
    type: "warning",
  })
      .then(() => {
        staffJoinDel(ids).then((res) => {
        qualityInspectDel(ids).then((res) => {
          proxy.$modal.msgSuccess("删除成功");
          getList();
        });
@@ -210,7 +227,7 @@
    type: "warning",
  })
      .then(() => {
        proxy.download("/staff/staffJoinLeaveRecord/export", {staffState: 0}, "人员离职.xlsx");
        proxy.download("/quality/qualityInspect/export", {inspectType: 0}, "原材料检验.xlsx");
      })
      .catch(() => {
        proxy.$modal.msg("已取消");