From 168e8d7c28ef162e28171392a37df09cdc1187c2 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期一, 23 三月 2026 16:59:44 +0800
Subject: [PATCH] Merge branch 'dev_衡阳_鹏创电子' of http://114.132.189.42:9002/r/product-inventory-management into dev_衡阳_鹏创电子

---
 src/views/qualityManagement/productInspectionRecord/index.vue |  258 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 258 insertions(+), 0 deletions(-)

diff --git a/src/views/qualityManagement/productInspectionRecord/index.vue b/src/views/qualityManagement/productInspectionRecord/index.vue
new file mode 100644
index 0000000..f619622
--- /dev/null
+++ b/src/views/qualityManagement/productInspectionRecord/index.vue
@@ -0,0 +1,258 @@
+<template>
+  <div class="app-container">
+    <div class="search_form">
+      <div>
+        <span class="search_title">宸ュ簭锛�</span>
+        <el-input
+            v-model="searchForm.process"
+            style="width: 240px"
+            placeholder="璇疯緭鍏ュ伐搴忔悳绱�"
+            @change="handleQuery"
+            clearable
+        />
+        <span style="margin-left: 10px" class="search_title">宸℃鏃ユ湡锛�</span>
+        <el-date-picker v-model="searchForm.checkDate"
+                        value-format="YYYY-MM-DD HH:mm:ss"
+                        format="YYYY-MM-DD HH:mm:ss"
+                        type="datetimerange"
+                        placeholder="璇烽�夋嫨"
+                        clearable
+                        @change="changeDaterange" />
+        <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
+        >鎼滅储</el-button
+        >
+      </div>
+      <div>
+        <el-button type="primary" @click="openForm('add')">鏂板</el-button>
+        <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+        <el-button type="success" plain @click="handleNotify">閫氱煡</el-button>
+      </div>
+    </div>
+    <div class="table_list">
+      <PIMTable
+          rowKey="id"
+          :column="tableColumn"
+          :tableData="tableData"
+          :page="page"
+          :isSelection="true"
+          @selection-change="handleSelectionChange"
+          :tableLoading="tableLoading"
+          @pagination="pagination"
+          :total="page.total"
+      ></PIMTable>
+    </div>
+    <FormDia ref="formDia" @close="handleQuery"></FormDia>
+  </div>
+</template>
+
+<script setup>
+import { onMounted, ref, reactive, toRefs } from "vue";
+import FormDia from "./components/formDia.vue";
+import {ElMessage, ElMessageBox} from "element-plus";
+import {
+  productInspectionRecordListPage,
+  delProductInspectionRecord,
+  notifyProductInspectionRecord
+} from "@/api/qualityManagement/productInspectionRecord.js";
+
+const data = reactive({
+  searchForm: {
+    keyword: "",
+    checkDate: undefined,
+    checkDateStart: undefined,
+    checkDateEnd: undefined,
+  },
+});
+const { searchForm } = toRefs(data);
+
+const tableData = ref([]);
+const tableLoading = ref(false);
+const page = reactive({
+  current: 1,
+  size: 10,
+  total: 0,
+});
+const ids = ref([]);
+
+const tableColumn = ref([
+  {
+    label: "宸ュ簭",
+    prop: "process",
+  },
+  {
+    label: "妫�娴嬮」",
+    prop: "inspectionItem",
+  },
+  {
+    label: "鏍囧噯瑕佹眰",
+    prop: "standardRequirement",
+  },
+  {
+    label: "瀹炴祴鍊�",
+    prop: "actualValue",
+  },
+  {
+    label: "鍒ゅ畾",
+    prop: "judgement",
+    dataType: "tag",
+    formatData: (params) => {
+      if (params === 'yes') {
+        return "鍚堟牸";
+      } else if (params === 'no') {
+        return "涓嶅悎鏍�";
+      }
+      return params;
+    },
+    formatType: (params) => {
+      if (params === 'yes') {
+        return "success";
+      } else if (params === 'no') {
+        return "danger";
+      }
+      return null;
+    },
+  },
+  {
+    label: "涓嶅悎鏍艰鍗�",
+    prop: "unqualifiedOrder",
+  },
+  {
+    label: "宸℃鏃ユ湡",
+    prop: "inspectionTime",
+    width: 160
+  },
+  {
+    label: "宸℃鍛�",
+    prop: "inspector",
+  },
+  {
+    label: "鍒涘缓浜�",
+    prop: "createUser",
+  },
+  {
+    label: "鍒涘缓鏃堕棿",
+    prop: "createTime",
+    width: 160
+  },
+  {
+    dataType: "action",
+    label: "鎿嶄綔",
+    align: "center",
+    fixed: "right",
+    width: 150,
+    operation: [
+      {
+        name: "缂栬緫",
+        type: "text",
+        clickFun: (row) => {
+          openForm("edit", row);
+        },
+      },
+      {
+        name: "鍒犻櫎",
+        type: "text",
+        clickFun: (row) => {
+          handleDelete(row);
+        },
+      },
+    ],
+  },
+]);
+
+const formDia = ref(null);
+
+const openForm = (type, row) => {
+  formDia.value.open(type, row);
+};
+
+const changeDaterange = (val) => {
+  if (val) {
+    searchForm.value.startTime = val[0];
+    searchForm.value.endTime = val[1];
+  } else {
+    searchForm.value.startTime = undefined;
+    searchForm.value.endTime = undefined;
+  }
+  handleQuery();
+};
+
+const handleQuery = () => {
+  page.current = 1;
+  getList();
+};
+
+const pagination = (obj) => {
+  page.current = obj.page;
+  page.size = obj.limit;
+  getList();
+};
+
+const getList = async () => {
+  tableLoading.value = true;
+  try {
+    const res = await productInspectionRecordListPage({
+      ...searchForm.value,
+      current: page.current,
+      size: page.size,
+    });
+    tableData.value = res.data.records || [];
+    page.total = res.data.total || 0;
+  } finally {
+    tableLoading.value = false;
+  }
+};
+
+const handleSelectionChange = (selection) => {
+  ids.value = selection.map((item) => item.id);
+};
+
+const handleDelete = (row) => {
+  const _ids = row ? [row.id] : ids.value;
+  if (_ids.length === 0) {
+    ElMessage.warning("璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁");
+    return;
+  }
+  ElMessageBox.confirm("鏄惁纭鍒犻櫎閫変腑鐨勬暟鎹紵", "璀﹀憡", {
+    confirmButtonText: "纭畾",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  }).then(async () => {
+    await delProductInspectionRecord(_ids);
+    ElMessage.success("鍒犻櫎鎴愬姛");
+    getList();
+  });
+};
+
+const handleNotify = () => {
+  if (ids.value.length === 0) {
+    ElMessage.warning("璇烽�夋嫨瑕侀�氱煡鐨勬暟鎹�");
+    return;
+  }
+  ElMessageBox.confirm("鏄惁纭鍙戦�侀�氱煡锛�", "璀﹀憡", {
+    confirmButtonText: "纭畾",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  }).then(async () => {
+    await notifyProductInspectionRecord(ids.value);
+    ElMessage.success("鍙戦�侀�氱煡鎴愬姛");
+  })
+};
+
+onMounted(() => {
+  getList();
+});
+</script>
+
+<style scoped lang="scss">
+.search_form {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 16px;
+}
+
+.search_title {
+  font-size: 14px;
+  color: #606266;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3