From 06bdd4c6c598f5d5c4696bfebab8d8fd0eda25b6 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 03 七月 2025 17:09:11 +0800
Subject: [PATCH] 指标维护页面开发联调、原材料检验开发联调
---
src/views/qualityManagement/rawMaterialInspection/components/inspectionFormDia.vue | 140 +++++++++++
src/api/qualityManagement/qualityInspectParam.js | 27 ++
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue | 208 +++++++++++++---
src/api/qualityManagement/rawMaterialInspection.js | 34 ++
src/views/qualityManagement/metricMaintenance/index.vue | 13
src/views/qualityManagement/rawMaterialInspection/index.vue | 83 ++++--
src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue | 163 +++++++++++++
src/api/qualityManagement/qualityInspectFile.js | 26 ++
8 files changed, 609 insertions(+), 85 deletions(-)
diff --git a/src/api/qualityManagement/qualityInspectFile.js b/src/api/qualityManagement/qualityInspectFile.js
new file mode 100644
index 0000000..1039755
--- /dev/null
+++ b/src/api/qualityManagement/qualityInspectFile.js
@@ -0,0 +1,26 @@
+import request from '@/utils/request'
+
+// 鏌ヨ闄勪欢鍒楄〃
+export function qualityInspectFileListPage(query) {
+ return request({
+ url: '/quality/qualityInspectFile/listPage',
+ method: 'get',
+ params: query,
+ })
+}
+// 鏌ヨ闄勪欢鍒楄〃
+export function qualityInspectFileAdd(query) {
+ return request({
+ url: '/quality/qualityInspectFile/add',
+ method: 'post',
+ data: query,
+ })
+}
+// 鏌ヨ闄勪欢鍒楄〃
+export function qualityInspectFileDel(query) {
+ return request({
+ url: '/quality/qualityInspectFile/del',
+ method: 'delete',
+ data: query,
+ })
+}
\ No newline at end of file
diff --git a/src/api/qualityManagement/qualityInspectParam.js b/src/api/qualityManagement/qualityInspectParam.js
new file mode 100644
index 0000000..4618820
--- /dev/null
+++ b/src/api/qualityManagement/qualityInspectParam.js
@@ -0,0 +1,27 @@
+import request from '@/utils/request'
+
+// 鏌ヨ妫�楠屾寚鏍�
+export function qualityInspectParamInfo(query) {
+ return request({
+ url: '/quality/qualityInspectParam/' + query,
+ method: 'get',
+ data: query,
+ })
+}
+// 鎻愪氦妫�楠�
+export function qualityInspectParamUpdate(query) {
+ return request({
+ url: '/quality/qualityInspectParam/update',
+ method: 'post',
+ data: query,
+ })
+}
+
+// 鍒犻櫎妫�楠岃褰�
+export function qualityInspectParamDel(query) {
+ return request({
+ url: '/quality/qualityInspectParam/del',
+ method: 'delete',
+ data: query,
+ })
+}
\ No newline at end of file
diff --git a/src/api/qualityManagement/rawMaterialInspection.js b/src/api/qualityManagement/rawMaterialInspection.js
new file mode 100644
index 0000000..e909d1a
--- /dev/null
+++ b/src/api/qualityManagement/rawMaterialInspection.js
@@ -0,0 +1,34 @@
+import request from '@/utils/request'
+
+// 鏌ヨ鍘熸潗鏂欐楠屽垪琛�
+export function qualityInspectListPage(query) {
+ return request({
+ url: '/quality/qualityInspect/listPage',
+ method: 'get',
+ params: query,
+ })
+}
+// 鏂板鍘熸潗鏂欐楠�
+export function qualityInspectAdd(query) {
+ return request({
+ url: '/quality/qualityInspect/add',
+ method: 'post',
+ data: query,
+ })
+}
+// 淇敼鍘熸潗鏂欐楠�
+export function qualityInspectUpdate(query) {
+ return request({
+ url: '/quality/qualityInspect/update',
+ method: 'post',
+ data: query,
+ })
+}
+// 鍒犻櫎鍘熸潗鏂欐楠�
+export function qualityInspectDel(query) {
+ return request({
+ url: '/quality/qualityInspect/del',
+ method: 'delete',
+ data: query,
+ })
+}
diff --git a/src/views/qualityManagement/metricMaintenance/index.vue b/src/views/qualityManagement/metricMaintenance/index.vue
index bdc672d..016a4c1 100644
--- a/src/views/qualityManagement/metricMaintenance/index.vue
+++ b/src/views/qualityManagement/metricMaintenance/index.vue
@@ -317,14 +317,13 @@
confirmButtonText: "纭",
cancelButtonText: "鍙栨秷",
type: "warning",
- })
- .then(() => {
- proxy.download("/quality/qualityTestStandard/export", {}, "妫�娴嬫寚鏍�.xlsx");
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
+ }).then(() => {
+ proxy.download("/quality/qualityTestStandard/export", {}, "妫�娴嬫寚鏍�.xlsx");
+ }).catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
};
+
// 鍒犻櫎鎸囨爣
const handleDelete = () => {
let ids = [];
diff --git a/src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue b/src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue
index e573db8..efed304 100644
--- a/src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue
+++ b/src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue
@@ -1,9 +1,170 @@
<template>
- <div></div>
+ <div>
+ <el-dialog
+ v-model="dialogFormVisible"
+ title="涓婁紶闄勪欢"
+ width="70%"
+ @close="closeDia"
+ >
+ <div style="margin-bottom: 10px;text-align: right">
+ <el-upload
+ v-model:file-list="fileList"
+ class="upload-demo"
+ :action="uploadUrl"
+ :on-success="handleUploadSuccess"
+ :on-error="handleUploadError"
+ name="file"
+ :show-file-list="false"
+ :headers="headers"
+ style="display: inline;margin-right: 10px"
+ >
+ <el-button type="primary">涓婁紶闄勪欢</el-button>
+ </el-upload>
+ <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+ </div>
+ <PIMTable
+ rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :tableLoading="tableLoading"
+ :isSelection="true"
+ @selection-change="handleSelectionChange"
+ height="600"
+ >
+ </PIMTable>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button @click="closeDia">鍙栨秷</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ </div>
</template>
<script setup>
+import {ref} from "vue";
+import {getStaffJoinInfo, staffJoinAdd, staffJoinUpdate} from "@/api/personnelManagement/onboarding.js";
+import {Search} from "@element-plus/icons-vue";
+import {
+ qualityInspectParamDel,
+ qualityInspectParamInfo,
+ qualityInspectParamUpdate
+} from "@/api/qualityManagement/qualityInspectParam.js";
+import {ElMessageBox} from "element-plus";
+import {getToken} from "@/utils/auth.js";
+import {
+ qualityInspectFileAdd,
+ qualityInspectFileDel,
+ qualityInspectFileListPage
+} from "@/api/qualityManagement/qualityInspectFile.js";
+const { proxy } = getCurrentInstance()
+const emit = defineEmits(['close'])
+const dialogFormVisible = ref(false);
+const currentId = ref('')
+const selectedRows = ref([]);
+const tableColumn = ref([
+ {
+ label: "鏂囦欢鍚嶇О",
+ prop: "name",
+ },
+ {
+ label: "涓婁紶浜�",
+ prop: "unit",
+ },
+ {
+ label: "涓婁紶鏃堕棿",
+ prop: "standardValue",
+ },
+ {
+ dataType: "action",
+ label: "鎿嶄綔",
+ align: "center",
+ operation: [
+ {
+ name: "涓嬭浇",
+ type: "text",
+ clickFun: (row) => {
+ openForm("edit", row);
+ },
+ }
+ ],
+ },
+]);
+const tableData = ref([]);
+const fileList = ref([]);
+const tableLoading = ref(false);
+const headers = ref({
+ Authorization: "Bearer " + getToken(),
+});
+const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 涓婁紶鐨勫浘鐗囨湇鍔″櫒鍦板潃
+
+// 鎵撳紑寮规
+const openDialog = (row) => {
+ dialogFormVisible.value = true;
+ currentId.value = row.id;
+ getList()
+}
+const getList = () => {
+ qualityInspectFileListPage(currentId.value).then(res => {
+ tableData.value = res.data.records;
+ })
+}
+// 琛ㄦ牸閫夋嫨鏁版嵁
+const handleSelectionChange = (selection) => {
+ selectedRows.value = selection;
+};
+
+// 鍏抽棴寮规
+const closeDia = () => {
+ dialogFormVisible.value = false;
+ emit('close')
+};
+// 涓婁紶鎴愬姛澶勭悊
+function handleUploadSuccess(res, file) {
+ // 濡傛灉涓婁紶鎴愬姛
+ if (res.code == 200) {
+ uploadFile(res)
+ } else {
+ proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
+ }
+}
+function uploadFile(file) {
+ file.inspectId = currentId.value;
+ qualityInspectFileAdd(file).then(res => {
+ proxy.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛");
+ getList()
+ })
+}
+// 涓婁紶澶辫触澶勭悊
+function handleUploadError() {
+ proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
+}
+// 鍒犻櫎
+const handleDelete = () => {
+ let ids = [];
+ if (selectedRows.value.length > 0) {
+ ids = selectedRows.value.map((item) => item.id);
+ } else {
+ proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+ return;
+ }
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ }).then(() => {
+ qualityInspectFileDel(ids).then((res) => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getList();
+ });
+ }).catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+};
+defineExpose({
+ openDialog,
+});
</script>
<style scoped>
diff --git a/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue b/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
index 5d2bcbc..32192c0 100644
--- a/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
+++ b/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
@@ -2,21 +2,99 @@
<div>
<el-dialog
v-model="dialogFormVisible"
- :title="operationType === 'add' ? '鏂板鍏ヨ亴' : '缂栬緫浜哄憳'"
+ :title="operationType === 'add' ? '鏂板鍘熸潗鏂欐楠�' : '缂栬緫鍘熸潗鏂欐楠�'"
width="70%"
@close="closeDia"
>
- <PIMTable
- rowKey="id"
- :column="tableColumn"
- :tableData="tableData"
- :tableLoading="tableLoading"
- height="600"
- >
- <template #slot="{ row }">
- <el-input v-model="row.staffName" clearable/>
- </template>
- </PIMTable>
+ <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="渚涘簲鍟嗭細" prop="supplier">
+ <el-select
+ v-model="form.supplier"
+ placeholder="璇烽�夋嫨"
+ clearable
+ >
+ <el-option
+ v-for="item in supplierList"
+ :key="item.id"
+ :label="item.supplierName"
+ :value="item.supplierName"
+ />
+ </el-select>
+ </el-form-item>
+ </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-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>
+ </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 v-model="form.quantity" placeholder="璇疯緭鍏�" clearable/>
+ </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-row>
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="妫�楠屽憳锛�" prop="checkName">
+ <el-input v-model="form.checkName" placeholder="璇疯緭鍏�" clearable/>
+
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="妫�娴嬫棩鏈燂細" prop="checkTime">
+ <el-date-picker
+ v-model="form.checkTime"
+ type="date"
+ placeholder="璇烽�夋嫨鏃ユ湡"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ clearable
+ style="width: 100%"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm">纭</el-button>
@@ -29,62 +107,103 @@
<script setup>
import {ref} from "vue";
-import {getStaffJoinInfo, staffJoinAdd, staffJoinUpdate} from "@/api/personnelManagement/onboarding.js";
-import {Search} from "@element-plus/icons-vue";
+import {getOptions} from "@/api/procurementManagement/procurementLedger.js";
+import {productTreeList} from "@/api/basicData/product.js";
+import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
const operationType = ref('')
-const tableColumn = ref([
- {
- label: "鎸囨爣",
- prop: "contractTerm",
+const data = reactive({
+ form: {
+ checkTime: "",
+ supplier: "",
+ checkName: "",
+ productName: "",
+ productId: "",
+ model: "",
+ unit: "",
+ quantity: "",
+ checkCompany: "",
+ checkResult: "",
},
- {
- label: "鍗曚綅",
- prop: "contractStartTime",
+ rules: {
+ checkTime: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" },],
+ supplier: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ checkName: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
+ productId: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ model: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
+ unit: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
+ quantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ checkCompany: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
+ checkResult: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
},
- {
- label: "鏍囧噯鍊�",
- prop: "contractEndTime",
- },
- {
- label: "鍐呮帶鍊�",
- prop: "contractEndTime",
- },
- {
- label: "妫�楠屽��",
- prop: "contractEndTime",
- dataType: 'slot',
- slot: 'slot',
- },
-]);
-const tableData = ref([]);
-const tableLoading = ref(false);
+});
+const { form, rules } = toRefs(data);
+const supplierList = ref([]);
+const productOptions = ref([]);
// 鎵撳紑寮规
const openDialog = (type, row) => {
operationType.value = type;
dialogFormVisible.value = true;
+ getOptions().then((res) => {
+ supplierList.value = res.data;
+ });
+ getProductOptions();
if (operationType.value === 'edit') {
- getStaffJoinInfo(row.id).then(res => {
- // tableData.value = res.data
- })
+ form.value = {...row}
}
+}
+const getProductOptions = () => {
+ productTreeList().then((res) => {
+ productOptions.value = convertIdToValue(res);
+ });
+};
+const getModels = (value) => {
+ form.value.productName = findNodeById(productOptions.value, value);
+};
+const findNodeById = (nodes, productId) => {
+ for (let i = 0; i < nodes.length; i++) {
+ if (nodes[i].value === productId) {
+ return nodes[i].label; // 鎵惧埌鑺傜偣锛岃繑鍥炶鑺傜偣
+ }
+ if (nodes[i].children && nodes[i].children.length > 0) {
+ const foundNode = findNodeById(nodes[i].children, productId);
+ if (foundNode) {
+ return foundNode; // 鍦ㄥ瓙鑺傜偣涓壘鍒帮紝杩斿洖璇ヨ妭鐐�
+ }
+ }
+ }
+ return null; // 娌℃湁鎵惧埌鑺傜偣锛岃繑鍥瀗ull
+};
+function convertIdToValue(data) {
+ return data.map((item) => {
+ const { id, children, ...rest } = item;
+ const newItem = {
+ ...rest,
+ value: id, // 灏� id 鏀逛负 value
+ };
+ if (children && children.length > 0) {
+ newItem.children = convertIdToValue(children);
+ }
+
+ return newItem;
+ });
}
// 鎻愪氦浜у搧琛ㄥ崟
const submitForm = () => {
proxy.$refs.formRef.validate(valid => {
if (valid) {
- form.value.staffState = 0
+ form.value.inspectType = 0
if (operationType.value === "add") {
- staffJoinAdd(form.value).then(res => {
+ qualityInspectAdd(form.value).then(res => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
})
} else {
- staffJoinUpdate(form.value).then(res => {
+ qualityInspectUpdate(form.value).then(res => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
})
@@ -94,6 +213,7 @@
}
// 鍏抽棴寮规
const closeDia = () => {
+ proxy.resetForm("formRef");
dialogFormVisible.value = false;
emit('close')
};
diff --git a/src/views/qualityManagement/rawMaterialInspection/components/inspectionFormDia.vue b/src/views/qualityManagement/rawMaterialInspection/components/inspectionFormDia.vue
new file mode 100644
index 0000000..32a36fa
--- /dev/null
+++ b/src/views/qualityManagement/rawMaterialInspection/components/inspectionFormDia.vue
@@ -0,0 +1,140 @@
+<template>
+ <div>
+ <el-dialog
+ v-model="dialogFormVisible"
+ title="濉啓妫�楠岃褰�"
+ width="70%"
+ @close="closeDia"
+ >
+ <div style="margin-bottom: 10px;text-align: right">
+ <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+ </div>
+ <PIMTable
+ rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :tableLoading="tableLoading"
+ :isSelection="true"
+ @selection-change="handleSelectionChange"
+ height="600"
+ >
+ <template #slot="{ row }">
+ <el-input v-model="row.testValue" clearable/>
+ </template>
+ </PIMTable>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary" @click="submitForm">纭</el-button>
+ <el-button @click="closeDia">鍙栨秷</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ </div>
+</template>
+
+<script setup>
+import {ref} from "vue";
+import {getStaffJoinInfo, staffJoinAdd, staffJoinUpdate} from "@/api/personnelManagement/onboarding.js";
+import {Search} from "@element-plus/icons-vue";
+import {
+ qualityInspectParamDel,
+ qualityInspectParamInfo,
+ qualityInspectParamUpdate
+} from "@/api/qualityManagement/qualityInspectParam.js";
+import {ElMessageBox} from "element-plus";
+const { proxy } = getCurrentInstance()
+const emit = defineEmits(['close'])
+
+const dialogFormVisible = ref(false);
+const operationType = ref('')
+const currentId = ref('')
+const selectedRows = ref([]);
+const tableColumn = ref([
+ {
+ label: "鎸囨爣",
+ prop: "parameterItem",
+ },
+ {
+ label: "鍗曚綅",
+ prop: "unit",
+ },
+ {
+ label: "鏍囧噯鍊�",
+ prop: "standardValue",
+ },
+ {
+ label: "鍐呮帶鍊�",
+ prop: "controlValue",
+ },
+ {
+ label: "妫�楠屽��",
+ prop: "testValue",
+ dataType: 'slot',
+ slot: 'slot',
+ },
+]);
+const tableData = ref([]);
+const tableLoading = ref(false);
+
+// 鎵撳紑寮规
+const openDialog = (type, row) => {
+ operationType.value = type;
+ dialogFormVisible.value = true;
+ if (operationType.value === 'edit') {
+ currentId.value = row.id;
+ getList()
+ }
+}
+const getList = () => {
+ qualityInspectParamInfo(currentId.value).then(res => {
+ tableData.value = res.data;
+ })
+}
+// 琛ㄦ牸閫夋嫨鏁版嵁
+const handleSelectionChange = (selection) => {
+ selectedRows.value = selection;
+};
+// 鎻愪氦浜у搧琛ㄥ崟
+const submitForm = () => {
+ qualityInspectParamUpdate(tableData.value).then(res => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeDia();
+ })
+}
+// 鍏抽棴寮规
+const closeDia = () => {
+ dialogFormVisible.value = false;
+ emit('close')
+};
+// 鍒犻櫎
+const handleDelete = () => {
+ let ids = [];
+ if (selectedRows.value.length > 0) {
+ ids = selectedRows.value.map((item) => item.id);
+ } else {
+ proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+ return;
+ }
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ qualityInspectParamDel(ids).then((res) => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getList();
+ });
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+};
+defineExpose({
+ openDialog,
+});
+</script>
+
+<style scoped>
+
+</style>
\ No newline at end of file
diff --git a/src/views/qualityManagement/rawMaterialInspection/index.vue b/src/views/qualityManagement/rawMaterialInspection/index.vue
index 29e52df..78d09b8 100644
--- a/src/views/qualityManagement/rawMaterialInspection/index.vue
+++ b/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("宸插彇娑�");
--
Gitblit v1.9.3