From 11e1de7bb345bc937cce53a2ac7672476b5b4db3 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期一, 02 二月 2026 16:17:19 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_New' into dev_New
---
src/views/qualityManagement/processInspection/components/formDia.vue | 42 ++
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue | 44 +++
src/views/salesManagement/salesLedger/index.vue | 29 ++
src/views/equipmentManagement/inspectionManagement/index.vue | 600 ++++++++++++++++++++++++---------------------
src/views/safeProduction/dangerInvestigation/index.vue | 16
5 files changed, 436 insertions(+), 295 deletions(-)
diff --git a/src/views/equipmentManagement/inspectionManagement/index.vue b/src/views/equipmentManagement/inspectionManagement/index.vue
index f4975e6..35f82d5 100644
--- a/src/views/equipmentManagement/inspectionManagement/index.vue
+++ b/src/views/equipmentManagement/inspectionManagement/index.vue
@@ -1,31 +1,37 @@
<template>
<div class="app-container">
- <el-form :inline="true" :model="queryParams" class="search-form">
+ <el-form :inline="true"
+ :model="queryParams"
+ class="search-form">
<el-form-item label="宸℃浠诲姟鍚嶇О">
- <el-input
- v-model="queryParams.taskName"
- placeholder="璇疯緭鍏ュ贰妫�浠诲姟鍚嶇О"
- clearable
- style="width: 200px "
- />
+ <el-input v-model="queryParams.taskName"
+ placeholder="璇疯緭鍏ュ贰妫�浠诲姟鍚嶇О"
+ clearable
+ style="width: 200px " />
</el-form-item>
<el-form-item>
- <el-button type="primary" @click="handleQuery">鏌ヨ</el-button>
+ <el-button type="primary"
+ @click="handleQuery">鏌ヨ</el-button>
<el-button @click="resetQuery">閲嶇疆</el-button>
</el-form-item>
</el-form>
<el-card>
<div style="display: flex;flex-direction: row;justify-content: space-between;margin-bottom: 10px;">
- <el-radio-group v-model="activeRadio" @change="radioChange">
+ <el-radio-group v-model="activeRadio"
+ @change="radioChange">
<el-radio-button v-for="tab in radios"
:key="tab.name"
:label="tab.label"
- :value="tab.name"/>
+ :value="tab.name" />
</el-radio-group>
<!-- 鎿嶄綔鎸夐挳鍖� -->
<el-space v-if="activeRadio !== 'task'">
- <el-button type="primary" :icon="Plus" @click="handleAdd(undefined)">鏂板缓</el-button>
- <el-button type="danger" :icon="Delete" @click="handleDelete">鍒犻櫎</el-button>
+ <el-button type="primary"
+ :icon="Plus"
+ @click="handleAdd(undefined)">鏂板缓</el-button>
+ <el-button type="danger"
+ :icon="Delete"
+ @click="handleDelete">鍒犻櫎</el-button>
<el-button @click="handleOut">瀵煎嚭</el-button>
</el-space>
<el-space v-else>
@@ -34,320 +40,354 @@
</div>
<div>
<PIMTable :table-loading="tableLoading"
- :table-data="tableData"
- :column="tableColumns"
- @selection-change="handleSelectionChange"
- @pagination="handlePagination"
- :is-selection="true"
- :border="true"
- :page="{
+ :table-data="tableData"
+ :column="tableColumns"
+ @selection-change="handleSelectionChange"
+ @pagination="handlePagination"
+ :is-selection="true"
+ :border="true"
+ :page="{
current: pageNum,
size: pageSize,
total: total,
layout: 'total, sizes, prev, pager, next, jumper'
}"
- :table-style="{ width: '100%', height: 'calc(100vh - 23em)' }"
- >
+ :table-style="{ width: '100%', height: 'calc(100vh - 23em)' }">
<template #inspector="{ row }">
<div class="person-tags">
<!-- 璋冭瘯淇℃伅锛屼笂绾挎椂鍒犻櫎 -->
<!-- {{ console.log('inspector data:', row.inspector) }} -->
<template v-if="row.inspector && row.inspector.length > 0">
- <el-tag
- v-for="(person, index) in row.inspector"
- :key="index"
- size="small"
- type="primary"
- class="person-tag"
- >
+ <el-tag v-for="(person, index) in row.inspector"
+ :key="index"
+ size="small"
+ type="primary"
+ class="person-tag">
{{ person }}
</el-tag>
</template>
- <span v-else class="no-data">--</span>
+ <span v-else
+ class="no-data">--</span>
</div>
</template>
</PIMTable>
</div>
</el-card>
- <form-dia ref="formDia" @closeDia="handleQuery"></form-dia>
+ <form-dia ref="formDia"
+ @closeDia="handleQuery"></form-dia>
<view-files ref="viewFiles"></view-files>
</div>
</template>
<script setup>
-import { Delete, Plus } from "@element-plus/icons-vue";
-import { onMounted, ref, reactive, getCurrentInstance, nextTick } from "vue";
-import { ElMessageBox } from "element-plus";
+ import { Delete, Plus } from "@element-plus/icons-vue";
+ import { onMounted, ref, reactive, getCurrentInstance, nextTick } from "vue";
+ import { ElMessageBox } from "element-plus";
-// 缁勪欢寮曞叆
-import PIMTable from "@/components/PIMTable/PIMTable.vue";
-import FormDia from "@/views/equipmentManagement/inspectionManagement/components/formDia.vue";
-import ViewFiles from "@/views/equipmentManagement/inspectionManagement/components/viewFiles.vue";
+ // 缁勪欢寮曞叆
+ import PIMTable from "@/components/PIMTable/PIMTable.vue";
+ import FormDia from "@/views/equipmentManagement/inspectionManagement/components/formDia.vue";
+ import ViewFiles from "@/views/equipmentManagement/inspectionManagement/components/viewFiles.vue";
-// 鎺ュ彛寮曞叆
-import {
- delTimingTask,
- inspectionTaskList,
- timingTaskList
-} from "@/api/inspectionManagement/index.js";
+ // 鎺ュ彛寮曞叆
+ import {
+ delTimingTask,
+ inspectionTaskList,
+ timingTaskList,
+ } from "@/api/inspectionManagement/index.js";
-// 鍏ㄥ眬鍙橀噺
-const { proxy } = getCurrentInstance();
-const formDia = ref();
-const viewFiles = ref();
+ // 鍏ㄥ眬鍙橀噺
+ const { proxy } = getCurrentInstance();
+ const formDia = ref();
+ const viewFiles = ref();
-// 鏌ヨ鍙傛暟
-const queryParams = reactive({
- taskName: "",
-});
+ // 鏌ヨ鍙傛暟
+ const queryParams = reactive({
+ taskName: "",
+ });
-// 鍗曢�夋閰嶇疆
-const activeRadio = ref("taskManage");
-const radios = reactive([
- { name: "taskManage", label: "瀹氭椂浠诲姟绠$悊" },
- { name: "task", label: "瀹氭椂浠诲姟璁板綍" },
-]);
+ // 鍗曢�夋閰嶇疆
+ const activeRadio = ref("taskManage");
+ const radios = reactive([
+ { name: "taskManage", label: "瀹氭椂浠诲姟绠$悊" },
+ { name: "task", label: "瀹氭椂浠诲姟璁板綍" },
+ ]);
-// 琛ㄦ牸鏁版嵁
-const selectedRows = ref([]);
-const tableData = ref([]);
-const operationsArr = ref([]);
-const tableColumns = ref([]);
-const tableLoading = ref(false);
-const total = ref(0);
-const pageNum = ref(1);
-const pageSize = ref(10);
+ // 琛ㄦ牸鏁版嵁
+ const selectedRows = ref([]);
+ const tableData = ref([]);
+ const operationsArr = ref([]);
+ const tableColumns = ref([]);
+ const tableLoading = ref(false);
+ const total = ref(0);
+ const pageNum = ref(1);
+ const pageSize = ref(10);
-// 鍒楅厤缃�
-const columns = ref([
- { prop: "taskName", label: "宸℃浠诲姟鍚嶇О", minWidth: 160 },
- { prop: "remarks", label: "澶囨敞", minWidth: 150 },
- { prop: "inspector", label: "鎵ц宸℃浜�", minWidth: 150, slot: "inspector" },
- {
- prop: "frequencyType",
- label: "棰戞",
- minWidth: 150,
- formatter: (_, __, val) => ({
- DAILY: "姣忔棩",
- WEEKLY: "姣忓懆",
- MONTHLY: "姣忔湀",
- QUARTERLY: "瀛e害"
- }[val] || "")
- },
- {
- prop: "frequencyDetail",
- label: "寮�濮嬫棩鏈熶笌鏃堕棿",
- minWidth: 150,
- formatter: (row, column, cellValue) => {
- // 鍏堝垽鏂槸鍚︽槸瀛楃涓�
- if (typeof cellValue !== 'string') return '';
- let val = cellValue;
- const replacements = {
- MON: '鍛ㄤ竴',
- TUE: '鍛ㄤ簩',
- WED: '鍛ㄤ笁',
- THU: '鍛ㄥ洓',
- FRI: '鍛ㄤ簲',
- SAT: '鍛ㄥ叚',
- SUN: '鍛ㄦ棩'
- };
- // 浣跨敤姝e垯涓�娆℃�ф浛鎹㈡墍鏈夊尮閰嶉」
- return val.replace(/MON|TUE|WED|THU|FRI|SAT|SUN/g, match => replacements[match]);
- }
- },
- { prop: "registrant", label: "鐧昏浜�", minWidth: 100 },
- { prop: "createTime", label: "鐧昏鏃ユ湡", minWidth: 100 },
-]);
+ // 鍒楅厤缃�
+ const columns = ref([
+ { prop: "taskName", label: "宸℃浠诲姟鍚嶇О", minWidth: 160 },
+ { prop: "remarks", label: "澶囨敞", minWidth: 150 },
+ { prop: "inspector", label: "鎵ц宸℃浜�", minWidth: 150, slot: "inspector" },
+ {
+ prop: "frequencyType",
+ label: "棰戞",
+ minWidth: 150,
+ // formatter: (_, __, val) => ({
+ // DAILY: "姣忔棩",
+ // WEEKLY: "姣忓懆",
+ // MONTHLY: "姣忔湀",
+ // QUARTERLY: "瀛e害"
+ // }[val] || "")
+ formatData: params => {
+ return params === "DAILY"
+ ? "姣忔棩"
+ : params === "WEEKLY"
+ ? "姣忓懆"
+ : params === "MONTHLY"
+ ? "姣忔湀"
+ : params === "QUARTERLY"
+ ? "瀛e害"
+ : "";
+ },
+ },
+ {
+ prop: "frequencyDetail",
+ label: "寮�濮嬫棩鏈熶笌鏃堕棿",
+ minWidth: 150,
+ formatter: (row, column, cellValue) => {
+ // 鍏堝垽鏂槸鍚︽槸瀛楃涓�
+ if (typeof cellValue !== "string") return "";
+ let val = cellValue;
+ const replacements = {
+ MON: "鍛ㄤ竴",
+ TUE: "鍛ㄤ簩",
+ WED: "鍛ㄤ笁",
+ THU: "鍛ㄥ洓",
+ FRI: "鍛ㄤ簲",
+ SAT: "鍛ㄥ叚",
+ SUN: "鍛ㄦ棩",
+ };
+ // 浣跨敤姝e垯涓�娆℃�ф浛鎹㈡墍鏈夊尮閰嶉」
+ return val.replace(
+ /MON|TUE|WED|THU|FRI|SAT|SUN/g,
+ match => replacements[match]
+ );
+ },
+ },
+ { prop: "registrant", label: "鐧昏浜�", minWidth: 100 },
+ { prop: "createTime", label: "鐧昏鏃ユ湡", minWidth: 100 },
+ ]);
-// 鎿嶄綔鍒楅厤缃�
-const getOperationColumn = (operations) => {
- if (!operations || operations.length === 0) return null;
-
- const operationConfig = {
- label: "鎿嶄綔",
- width: 130,
- fixed: "right",
- dataType: "action",
- operation: operations.map(op => {
- switch (op) {
- case 'edit':
- return {
- name: "缂栬緫",
- clickFun: handleAdd,
- color: "#409EFF"
- };
- case 'viewFile':
- return {
- name: "鏌ョ湅闄勪欢",
- clickFun: viewFile,
- color: "#67C23A"
- };
- default:
- return null;
- }
- }).filter(Boolean)
+ // 鎿嶄綔鍒楅厤缃�
+ const getOperationColumn = operations => {
+ if (!operations || operations.length === 0) return null;
+
+ const operationConfig = {
+ label: "鎿嶄綔",
+ width: 130,
+ fixed: "right",
+ dataType: "action",
+ operation: operations
+ .map(op => {
+ switch (op) {
+ case "edit":
+ return {
+ name: "缂栬緫",
+ clickFun: handleAdd,
+ color: "#409EFF",
+ };
+ case "viewFile":
+ return {
+ name: "鏌ョ湅闄勪欢",
+ clickFun: viewFile,
+ color: "#67C23A",
+ };
+ default:
+ return null;
+ }
+ })
+ .filter(Boolean),
+ };
+
+ return operationConfig;
};
-
- return operationConfig;
-};
-onMounted(() => {
- radioChange('taskManage');
-});
-
-// 鍗曢�夊彉鍖�
-const radioChange = (value) => {
- if (value === "taskManage") {
- const operationColumn = getOperationColumn(['edit']);
- tableColumns.value = [...columns.value, ...(operationColumn ? [operationColumn] : [])];
- operationsArr.value = ['edit'];
- } else if (value === "task") {
- const operationColumn = getOperationColumn(['viewFile']);
- tableColumns.value = [...columns.value, ...(operationColumn ? [operationColumn] : [])];
- operationsArr.value = ['viewFile'];
- }
- pageNum.value = 1;
- pageSize.value = 10;
- getList();
-};
-
-// 鏌ヨ鎿嶄綔
-const handleQuery = () => {
- pageNum.value = 1;
- pageSize.value = 10;
- getList();
-};
-// 鍒嗛〉澶勭悊
-const handlePagination = (val) => {
- pageNum.value = val.page;
- pageSize.value = val.limit;
- getList();
-};
-// 鑾峰彇鍒楄〃鏁版嵁
-const getList = () => {
- tableLoading.value = true;
-
- const params = { ...queryParams, size: pageSize.value, current: pageNum.value };
-
- let apiCall;
- if (activeRadio.value === "task") {
- apiCall = inspectionTaskList(params);
- } else {
- apiCall = timingTaskList(params);
- }
-
- apiCall.then(res => {
- const rawData = res.data.records || [];
- // 澶勭悊 inspector 瀛楁锛屽皢瀛楃涓茶浆鎹负鏁扮粍锛堥�傜敤浜庢墍鏈夋儏鍐碉級
- tableData.value = rawData.map(item => {
- const processedItem = { ...item };
-
- // 澶勭悊 inspector 瀛楁
- if (processedItem.inspector) {
- if (typeof processedItem.inspector === 'string') {
- // 瀛楃涓叉寜閫楀彿鍒嗗壊
- processedItem.inspector = processedItem.inspector.split(',').map(s => s.trim()).filter(s => s);
- } else if (!Array.isArray(processedItem.inspector)) {
- // 闈炴暟缁勮浆涓烘暟缁�
- processedItem.inspector = [processedItem.inspector];
- }
- } else {
- // 绌哄�艰涓虹┖鏁扮粍
- processedItem.inspector = [];
- }
-
- return processedItem;
- });
- total.value = res.data.total || 0;
- }).finally(() => {
- tableLoading.value = false;
+ onMounted(() => {
+ radioChange("taskManage");
});
-};
-// 閲嶇疆鏌ヨ
-const resetQuery = () => {
- for (const key in queryParams) {
- if (!["pageNum", "pageSize"].includes(key)) {
- queryParams[key] = "";
+ // 鍗曢�夊彉鍖�
+ const radioChange = value => {
+ if (value === "taskManage") {
+ const operationColumn = getOperationColumn(["edit"]);
+ tableColumns.value = [
+ ...columns.value,
+ ...(operationColumn ? [operationColumn] : []),
+ ];
+ operationsArr.value = ["edit"];
+ } else if (value === "task") {
+ const operationColumn = getOperationColumn(["viewFile"]);
+ tableColumns.value = [
+ ...columns.value,
+ ...(operationColumn ? [operationColumn] : []),
+ ];
+ operationsArr.value = ["viewFile"];
}
- }
- handleQuery();
-};
+ pageNum.value = 1;
+ pageSize.value = 10;
+ getList();
+ };
-// 鏂板 / 缂栬緫
-const handleAdd = (row) => {
- const type = row ? 'edit' : 'add';
- nextTick(() => {
- formDia.value?.openDialog(type, row);
- });
-};
+ // 鏌ヨ鎿嶄綔
+ const handleQuery = () => {
+ pageNum.value = 1;
+ pageSize.value = 10;
+ getList();
+ };
+ // 鍒嗛〉澶勭悊
+ const handlePagination = val => {
+ pageNum.value = val.page;
+ pageSize.value = val.limit;
+ getList();
+ };
+ // 鑾峰彇鍒楄〃鏁版嵁
+ const getList = () => {
+ tableLoading.value = true;
-// 鏌ョ湅闄勪欢
-const viewFile = (row) => {
- nextTick(() => {
- viewFiles.value?.openDialog(row);
- });
-};
+ const params = {
+ ...queryParams,
+ size: pageSize.value,
+ current: pageNum.value,
+ };
-// 鍒犻櫎鎿嶄綔
-const handleDelete = () => {
- if (!selectedRows.value.length) {
- proxy.$modal.msgWarning("璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁");
- return;
- }
-
- const deleteIds = selectedRows.value.map(item => item.id);
-
- proxy.$modal.confirm('鏄惁纭鍒犻櫎鎵�閫夋暟鎹」锛�').then(() => {
- return delTimingTask(deleteIds);
- }).then(() => {
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- handleQuery();
- }).catch(() => {});
-};
+ let apiCall;
+ if (activeRadio.value === "task") {
+ apiCall = inspectionTaskList(params);
+ } else {
+ apiCall = timingTaskList(params);
+ }
-// 澶氶�夊彉鏇�
-const handleSelectionChange = (selection) => {
- selectedRows.value = selection;
-};
+ apiCall
+ .then(res => {
+ const rawData = res.data.records || [];
+ // 澶勭悊 inspector 瀛楁锛屽皢瀛楃涓茶浆鎹负鏁扮粍锛堥�傜敤浜庢墍鏈夋儏鍐碉級
+ tableData.value = rawData.map(item => {
+ const processedItem = { ...item };
-// 瀵煎嚭
-const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- // 鏍规嵁褰撳墠閫変腑鐨勬爣绛鹃〉璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
- if (activeRadio.value === "taskManage") {
- // 瀹氭椂浠诲姟绠$悊
- proxy.download("/timingTask/export", {}, "瀹氭椂浠诲姟绠$悊.xlsx");
- } else if (activeRadio.value === "task") {
- // 瀹氭椂浠诲姟璁板綍
- proxy.download("/inspectionTask/export", {}, "瀹氭椂浠诲姟璁板綍.xlsx");
+ // 澶勭悊 inspector 瀛楁
+ if (processedItem.inspector) {
+ if (typeof processedItem.inspector === "string") {
+ // 瀛楃涓叉寜閫楀彿鍒嗗壊
+ processedItem.inspector = processedItem.inspector
+ .split(",")
+ .map(s => s.trim())
+ .filter(s => s);
+ } else if (!Array.isArray(processedItem.inspector)) {
+ // 闈炴暟缁勮浆涓烘暟缁�
+ processedItem.inspector = [processedItem.inspector];
+ }
+ } else {
+ // 绌哄�艰涓虹┖鏁扮粍
+ processedItem.inspector = [];
+ }
+
+ return processedItem;
+ });
+ total.value = res.data.total || 0;
+ })
+ .finally(() => {
+ tableLoading.value = false;
+ });
+ };
+
+ // 閲嶇疆鏌ヨ
+ const resetQuery = () => {
+ for (const key in queryParams) {
+ if (!["pageNum", "pageSize"].includes(key)) {
+ queryParams[key] = "";
}
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
+ }
+ handleQuery();
+ };
+
+ // 鏂板 / 缂栬緫
+ const handleAdd = row => {
+ const type = row ? "edit" : "add";
+ nextTick(() => {
+ formDia.value?.openDialog(type, row);
});
-};
+ };
+
+ // 鏌ョ湅闄勪欢
+ const viewFile = row => {
+ nextTick(() => {
+ viewFiles.value?.openDialog(row);
+ });
+ };
+
+ // 鍒犻櫎鎿嶄綔
+ const handleDelete = () => {
+ if (!selectedRows.value.length) {
+ proxy.$modal.msgWarning("璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁");
+ return;
+ }
+
+ const deleteIds = selectedRows.value.map(item => item.id);
+
+ proxy.$modal
+ .confirm("鏄惁纭鍒犻櫎鎵�閫夋暟鎹」锛�")
+ .then(() => {
+ return delTimingTask(deleteIds);
+ })
+ .then(() => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ handleQuery();
+ })
+ .catch(() => {});
+ };
+
+ // 澶氶�夊彉鏇�
+ const handleSelectionChange = selection => {
+ selectedRows.value = selection;
+ };
+
+ // 瀵煎嚭
+ const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ // 鏍规嵁褰撳墠閫変腑鐨勬爣绛鹃〉璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
+ if (activeRadio.value === "taskManage") {
+ // 瀹氭椂浠诲姟绠$悊
+ proxy.download("/timingTask/export", {}, "瀹氭椂浠诲姟绠$悊.xlsx");
+ } else if (activeRadio.value === "task") {
+ // 瀹氭椂浠诲姟璁板綍
+ proxy.download("/inspectionTask/export", {}, "瀹氭椂浠诲姟璁板綍.xlsx");
+ }
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
</script>
<style scoped>
-.person-tags {
- display: flex;
- flex-wrap: wrap;
- gap: 4px;
-}
+ .person-tags {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 4px;
+ }
-.person-tag {
- margin-right: 4px;
- margin-bottom: 2px;
-}
+ .person-tag {
+ margin-right: 4px;
+ margin-bottom: 2px;
+ }
-.no-data {
- color: #909399;
- font-size: 14px;
-}
+ .no-data {
+ color: #909399;
+ font-size: 14px;
+ }
</style>
\ No newline at end of file
diff --git a/src/views/qualityManagement/processInspection/components/formDia.vue b/src/views/qualityManagement/processInspection/components/formDia.vue
index e0aea52..1b943e2 100644
--- a/src/views/qualityManagement/processInspection/components/formDia.vue
+++ b/src/views/qualityManagement/processInspection/components/formDia.vue
@@ -207,22 +207,50 @@
// 鎵撳紑寮规
const openDialog = async (type, row) => {
operationType.value = type;
- dialogFormVisible.value = true;
getOptions().then((res) => {
supplierList.value = res.data;
});
let userLists = await userListNoPage();
userList.value = userLists.data;
- form.value = {}
+ // 鍏堥噸缃〃鍗曟暟鎹紙淇濇寔瀛楁瀹屾暣锛岄伩鍏嶅脊绐楅娆℃覆鏌撴椂瑙﹀彂蹇呭~绾㈡鈥滈棯涓�涓嬧�濓級
+ form.value = {
+ checkTime: "",
+ process: "",
+ checkName: "",
+ productName: "",
+ productId: "",
+ productModelId: "",
+ model: "",
+ testStandardId: "",
+ unit: "",
+ quantity: "",
+ checkCompany: "",
+ checkResult: "",
+ }
testStandardOptions.value = [];
tableData.value = [];
- getProductOptions();
+ // 鍏堢‘淇濅骇鍝佹爲宸插姞杞斤紝鍚﹀垯缂栬緫鏃朵骇鍝�/瑙勬牸鍨嬪彿鏃犳硶鍙嶆樉
+ await getProductOptions();
if (operationType.value === 'edit') {
// 鍏堜繚瀛� testStandardId锛岄伩鍏嶈娓呯┖
const savedTestStandardId = row.testStandardId;
// 鍏堣缃〃鍗曟暟鎹紝浣嗘殏鏃舵竻绌� testStandardId锛岀瓑閫夐」鍔犺浇瀹屾垚鍚庡啀璁剧疆
form.value = {...row, testStandardId: ''}
currentProductId.value = row.productId || 0
+ // 鍏抽敭锛氱紪杈戞椂鍔犺浇瑙勬牸鍨嬪彿涓嬫媺閫夐」锛屾墠鑳藉弽鏄� productModelId
+ if (currentProductId.value) {
+ try {
+ const res = await modelList({ id: currentProductId.value });
+ modelOptions.value = res || [];
+ // 鍚屾鍥炲~ model / unit锛堟湁浜涙帴鍙h繑鍥炵殑 row 閲屽彲鑳芥病甯﹀叏锛�
+ if (form.value.productModelId) {
+ handleChangeModel(form.value.productModelId);
+ }
+ } catch (e) {
+ console.error("鍔犺浇瑙勬牸鍨嬪彿澶辫触", e);
+ modelOptions.value = [];
+ }
+ }
// 缂栬緫妯″紡涓嬶紝鍏堝姞杞芥寚鏍囬�夐」锛岀劧鍚庡姞杞藉弬鏁板垪琛�
if (currentProductId.value) {
// 鍏堝姞杞芥寚鏍囬�夐」
@@ -264,10 +292,16 @@
getQualityInspectParamList(row.id);
}
}
+ // 鏈�鍚庡啀鎵撳紑寮圭獥锛屽苟娓呯悊鏍¢獙鎬侊紝閬垮厤蹇呭~鎻愮ず闂儊
+ dialogFormVisible.value = true;
+ nextTick(() => {
+ proxy.$refs?.formRef?.clearValidate?.();
+ });
}
const getProductOptions = () => {
- productTreeList().then((res) => {
+ return productTreeList().then((res) => {
productOptions.value = convertIdToValue(res);
+ return productOptions.value;
});
};
const getModels = (value) => {
diff --git a/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue b/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
index 3323986..21c4323 100644
--- a/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
+++ b/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
@@ -218,21 +218,49 @@
const modelOptions = ref([]);
// 鎵撳紑寮规
-const openDialog = (type, row) => {
+const openDialog = async (type, row) => {
operationType.value = type;
- dialogFormVisible.value = true;
getOptions().then((res) => {
supplierList.value = res.data;
});
- form.value = {}
+ // 鍏堥噸缃〃鍗曟暟鎹紙淇濇寔瀛楁瀹屾暣锛岄伩鍏嶅脊绐楅娆℃覆鏌撴椂瑙﹀彂蹇呭~绾㈡鈥滈棯涓�涓嬧�濓級
+ form.value = {
+ checkTime: "",
+ supplier: "",
+ checkName: "",
+ productName: "",
+ productId: "",
+ productModelId: "",
+ model: "",
+ testStandardId: "",
+ unit: "",
+ quantity: "",
+ checkCompany: "",
+ checkResult: "",
+ }
testStandardOptions.value = [];
tableData.value = [];
- getProductOptions();
+ // 鍏堢‘淇濅骇鍝佹爲宸插姞杞斤紝鍚﹀垯缂栬緫鏃朵骇鍝�/瑙勬牸鍨嬪彿鏃犳硶鍙嶆樉
+ await getProductOptions();
if (operationType.value === 'edit') {
// 鍏堜繚瀛� testStandardId锛岄伩鍏嶈娓呯┖
const savedTestStandardId = row.testStandardId;
form.value = {...row}
currentProductId.value = row.productId || 0
+ // 鍏抽敭锛氱紪杈戞椂鍔犺浇瑙勬牸鍨嬪彿涓嬫媺閫夐」锛屾墠鑳藉弽鏄� productModelId
+ if (currentProductId.value) {
+ try {
+ const res = await modelList({ id: currentProductId.value });
+ modelOptions.value = res || [];
+ // 鍚屾鍥炲~ model / unit锛堟湁浜涙帴鍙h繑鍥炵殑 row 閲屽彲鑳芥病甯﹀叏锛�
+ if (form.value.productModelId) {
+ handleChangeModel(form.value.productModelId);
+ }
+ } catch (e) {
+ console.error("鍔犺浇瑙勬牸鍨嬪彿澶辫触", e);
+ modelOptions.value = [];
+ }
+ }
// 缂栬緫妯″紡涓嬶紝鍏堝姞杞芥寚鏍囬�夐」锛岀劧鍚庡姞杞藉弬鏁板垪琛�
if (currentProductId.value) {
// 鍏堝姞杞芥寚鏍囬�夐」
@@ -273,10 +301,16 @@
getQualityInspectParamList(row.id);
}
}
+ // 鏈�鍚庡啀鎵撳紑寮圭獥锛屽苟娓呯悊鏍¢獙鎬侊紝閬垮厤蹇呭~鎻愮ず闂儊
+ dialogFormVisible.value = true;
+ nextTick(() => {
+ proxy.$refs?.formRef?.clearValidate?.();
+ });
}
const getProductOptions = () => {
- productTreeList().then((res) => {
+ return productTreeList().then((res) => {
productOptions.value = convertIdToValue(res);
+ return productOptions.value;
});
};
const getModels = (value) => {
diff --git a/src/views/safeProduction/dangerInvestigation/index.vue b/src/views/safeProduction/dangerInvestigation/index.vue
index 7ff2a64..90093fa 100644
--- a/src/views/safeProduction/dangerInvestigation/index.vue
+++ b/src/views/safeProduction/dangerInvestigation/index.vue
@@ -125,7 +125,7 @@
<el-button link
type="primary"
size="small"
- :disabled="!isPeople(scope.row.rectifyUserId)"
+ :disabled="scope.row.isRectify"
@click="openForm('edit2', scope.row)">鏁存敼</el-button>
<el-button link
type="primary"
@@ -659,6 +659,14 @@
tableLoading.value = false;
tableData.value = res.data.records;
total.value = res.data.total;
+ tableData.value.forEach(item => {
+ // console.log(item.rectifyUserId, currentUserId.value, "=======");
+ if (Number(item.rectifyUserId) != Number(currentUserId.value)) {
+ item.isRectify = true;
+ } else {
+ item.isRectify = false;
+ }
+ });
return res;
})
.catch(() => {
@@ -893,8 +901,8 @@
proxy.$modal.msg("宸插彇娑�");
});
};
- const isPeople = row => {
- return row.rectifyUserId === Number(currentUserId.value);
+ const isPeople = rectifyUserId => {
+ return Number(rectifyUserId) == Number(currentUserId.value);
};
/**
@@ -976,11 +984,11 @@
};
onMounted(() => {
+ getCurrentFactoryName();
getList();
userListNoPage().then(res => {
userList.value = res.data;
});
- getCurrentFactoryName();
});
// 涓婁紶闄勪欢
const handleUpload = async () => {
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index c126b6a..5cf762c 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -221,7 +221,8 @@
</el-row>
<el-table :data="productData" border @selection-change="productSelected" show-summary
:summary-method="summarizeMainTable">
- <el-table-column align="center" type="selection" width="55" v-if="operationType !== 'view'" />
+ <el-table-column align="center" type="selection" width="55" v-if="operationType !== 'view'"
+ :selectable="(row) => !isProductShipped(row)" />
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
<el-table-column label="浜у搧澶х被" prop="productCategory" />
<el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" />
@@ -233,7 +234,9 @@
<el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
<el-table-column fixed="right" label="鎿嶄綔" min-width="60" align="center" v-if="operationType !== 'view'">
<template #default="scope">
- <el-button link type="primary" size="small" @click="openProductForm('edit', scope.row,scope.$index)">缂栬緫</el-button>
+ <el-button link type="primary" size="small"
+ :disabled="isProductShipped(scope.row)"
+ @click="openProductForm('edit', scope.row,scope.$index)">缂栬緫</el-button>
</template>
</el-table-column>
</el-table>
@@ -1222,6 +1225,12 @@
const productIndex = ref(0);
// 鎵撳紑浜у搧寮规
const openProductForm = async (type, row, index) => {
+ // 缂栬緫鏃舵鏌ヤ骇鍝佹槸鍚﹀凡鍙戣揣鎴栧鏍搁�氳繃
+ if (type === "edit" && isProductShipped(row)) {
+ proxy.$modal.msgWarning("宸插彂璐ф垨瀹℃牳閫氳繃鐨勪骇鍝佷笉鑳界紪杈�");
+ return;
+ }
+
productOperationType.value = type;
productForm.value = {};
proxy.resetForm("productFormRef");
@@ -1288,6 +1297,14 @@
proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
return;
}
+
+ // 妫�鏌ユ槸鍚︽湁宸插彂璐ф垨瀹℃牳閫氳繃鐨勪骇鍝�
+ const shippedProducts = productSelectedRows.value.filter(row => isProductShipped(row));
+ if (shippedProducts.length > 0) {
+ proxy.$modal.msgWarning("宸插彂璐ф垨瀹℃牳閫氳繃鐨勪骇鍝佷笉鑳藉垹闄�");
+ return;
+ }
+
if (operationType.value === "add") {
productSelectedRows.value.forEach((selectedRow) => {
const index = productData.value.findIndex(
@@ -1362,6 +1379,14 @@
proxy.$modal.msg("宸插彇娑�");
});
};
+/** 鍒ゆ柇鍗曚釜浜у搧鏄惁宸插彂璐э紙鏍规嵁shippingStatus鍒ゆ柇锛屽凡鍙戣揣鎴栧鏍搁�氳繃涓嶅彲缂栬緫鍜屽垹闄わ級 */
+const isProductShipped = (product) => {
+ if (!product) return false;
+ const status = String(product.shippingStatus || "").trim();
+ // 濡傛灉鍙戣揣鐘舵�佹槸"宸插彂璐�"鎴�"瀹℃牳閫氳繃"锛屽垯涓嶅彲缂栬緫鍜屽垹闄�
+ return status === "宸插彂璐�" || status === "瀹℃牳閫氳繃";
+};
+
/** 鍒ゆ柇閿�鍞鍗曚笅鏄惁瀛樺湪宸插彂璐�/鍙戣揣瀹屾垚鐨勪骇鍝侊紙涓嶅彲鍒犻櫎锛� */
const hasShippedProducts = (products) => {
if (!products || !products.length) return false;
--
Gitblit v1.9.3