From b0f5a5f44c924fe69fb88312ff42ad0540661c8f Mon Sep 17 00:00:00 2001
From: ZN <zhang_12370@163.com>
Date: 星期五, 20 三月 2026 11:26:44 +0800
Subject: [PATCH] fix: 更新公司名称并优化生产工序和设备关联
---
src/views/inventoryManagement/dispatchLog/Record.vue | 2 +-
src/views/productionManagement/productionProcess/index.vue | 48 +++++++++++++++++++++++++++++++++++++++++-------
src/views/productionManagement/productionReporting/index.vue | 6 +++++-
src/views/salesManagement/salesLedger/index.vue | 4 ++--
4 files changed, 49 insertions(+), 11 deletions(-)
diff --git a/src/views/inventoryManagement/dispatchLog/Record.vue b/src/views/inventoryManagement/dispatchLog/Record.vue
index 1637226..7734c26 100644
--- a/src/views/inventoryManagement/dispatchLog/Record.vue
+++ b/src/views/inventoryManagement/dispatchLog/Record.vue
@@ -405,7 +405,7 @@
<div class="print-page">
<div class="delivery-note">
<div class="header">
- <div class="company-name">榧庤瘹鐟炲疄涓氭湁闄愯矗浠诲叕鍙�</div>
+ <div class="company-name">闃冲厜鍗板埛鏈夐檺璐d换鍏徃</div>
<div class="document-title">闆跺敭鍙戣揣鍗�</div>
</div>
diff --git a/src/views/productionManagement/productionProcess/index.vue b/src/views/productionManagement/productionProcess/index.vue
index ffe13fc..00b8b71 100644
--- a/src/views/productionManagement/productionProcess/index.vue
+++ b/src/views/productionManagement/productionProcess/index.vue
@@ -70,7 +70,7 @@
</template>
<script setup>
- import { onMounted, ref, reactive, toRefs, getCurrentInstance } from "vue";
+ import { onMounted, ref, reactive, toRefs, getCurrentInstance, computed } from "vue";
import NewProcess from "@/views/productionManagement/productionProcess/New.vue";
import EditProcess from "@/views/productionManagement/productionProcess/Edit.vue";
import ImportDialog from "@/components/Dialog/ImportDialog.vue";
@@ -81,6 +81,7 @@
downloadTemplate,
} from "@/api/productionManagement/productionProcess.js";
import { getToken } from "@/utils/auth";
+ import { getDeviceLedger } from "@/api/equipmentManagement/ledger";
const data = reactive({
searchForm: {
@@ -99,12 +100,20 @@
prop: "name",
},
{
+ label: "宸ュ簭鏈哄彴",
+ prop: "deviceName",
+ },
+ {
label: "宸ュ簭绫诲瀷",
prop: "typeText",
},
{
label: "宸ヨ祫瀹氶",
prop: "salaryQuota",
+ },
+ {
+ label: "宸ュ簭",
+ prop: "process",
},
{
label: "鏄惁璐ㄦ",
@@ -140,6 +149,15 @@
]);
const tableData = ref([]);
const selectedRows = ref([]);
+ const deviceList = ref([]);
+ const deviceNameMap = computed(() => {
+ const map = new Map();
+ (deviceList.value || []).forEach((d) => {
+ if (d?.id == null) return;
+ map.set(d.id, d.deviceName ?? "");
+ });
+ return map;
+ });
const tableLoading = ref(false);
const isShowNewModal = ref(false);
const isShowEditModal = ref(false);
@@ -152,6 +170,15 @@
total: 0,
});
const { proxy } = getCurrentInstance();
+
+ const loadDeviceList = async () => {
+ try {
+ const res = await getDeviceLedger();
+ deviceList.value = Array.isArray(res?.data) ? res.data : [];
+ } catch (e) {
+ deviceList.value = [];
+ }
+ };
// 瀵煎叆鐩稿叧閰嶇疆
const importAction =
@@ -177,10 +204,16 @@
listPage(params)
.then(res => {
tableLoading.value = false;
- tableData.value = res.data.records.map(item => ({
- ...item,
- typeText: item.type !== undefined && item.type !== null ? (item.type === 0 ? "璁℃椂" : "璁′欢") : "",
- }));
+ const records = Array.isArray(res?.data?.records) ? res.data.records : [];
+ const map = deviceNameMap.value;
+ tableData.value = records.map(item => {
+ const deviceName = item?.deviceName ?? map.get(item?.deviceId) ?? "";
+ return {
+ ...item,
+ deviceName,
+ typeText: item.type !== undefined && item.type !== null ? (item.type === 0 ? "璁℃椂" : "璁′欢") : "",
+ };
+ });
page.total = res.data.total;
})
.catch(err => {
@@ -250,7 +283,6 @@
importDialogRef.value.submit();
}
};
-
// 瀵煎叆鎴愬姛
const handleImportSuccess = response => {
if (response.code === 200) {
@@ -312,7 +344,9 @@
// };
onMounted(() => {
- getList();
+ loadDeviceList().finally(() => {
+ getList();
+ });
});
</script>
diff --git a/src/views/productionManagement/productionReporting/index.vue b/src/views/productionManagement/productionReporting/index.vue
index fbdc3c1..d09a666 100644
--- a/src/views/productionManagement/productionReporting/index.vue
+++ b/src/views/productionManagement/productionReporting/index.vue
@@ -543,7 +543,11 @@
productAudit(auditData)
.then(res => {
if (res.code === 200) {
- proxy.$modal.msgSuccess(auditResult === 1 ? "瀹℃牳閫氳繃" : "瀹℃牳涓嶉�氳繃");
+ if(auditResult === 1){
+ proxy.$modal.msgSuccess("瀹℃牳閫氳繃");
+ }else{
+ proxy.$modal.msgError("瀹℃牳涓嶉�氳繃");
+ }
auditDialogVisible.value = false;
getList();
} else {
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index b5bc804..5c2b9bb 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -487,7 +487,7 @@
<div v-for="(item, index) in printData" :key="index" class="print-page">
<div class="delivery-note">
<div class="header">
- <div class="company-name">榧庤瘹鐟炲疄涓氭湁闄愯矗浠诲叕鍙�</div>
+ <div class="company-name">闃冲厜鍗板埛鏈夐檺璐d换鍏徃</div>
<div class="document-title">闆跺敭鍙戣揣鍗�</div>
</div>
@@ -1678,7 +1678,7 @@
<div class="print-page">
<div class="delivery-note">
<div class="header">
- <div class="company-name">榧庤瘹鐟炲疄涓氭湁闄愯矗浠诲叕鍙�</div>
+ <div class="company-name">闃冲厜褰╁嵃鏈夐檺璐d换鍏徃</div>
<div class="document-title">闆跺敭鍙戣揣鍗�</div>
</div>
--
Gitblit v1.9.3