From a6fc4c9dfe7fae23229312c813f0b1e933d87d5b Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 12 六月 2026 09:52:26 +0800
Subject: [PATCH] 宝东 1.计量器具台账报错 2.生产报工、生产排产完成进度改为四舍五入
---
src/views/equipmentManagement/measurementEquipment/index.vue | 630 +++++++++++++++++++++++++----------------------
src/views/equipmentManagement/measurementEquipment/filesDia.vue | 110 +++-----
src/views/productionManagement/workOrderEdit/index.vue | 2
src/api/equipmentManagement/measurementEquipment.js | 27 ++
src/views/productionManagement/workOrderManagement/index.vue | 2
5 files changed, 406 insertions(+), 365 deletions(-)
diff --git a/src/api/equipmentManagement/measurementEquipment.js b/src/api/equipmentManagement/measurementEquipment.js
index 8bb8a7f..ba73317 100644
--- a/src/api/equipmentManagement/measurementEquipment.js
+++ b/src/api/equipmentManagement/measurementEquipment.js
@@ -52,4 +52,31 @@
method:"post",
data
})
+}
+
+// 閫氱敤闄勪欢鏌ヨ
+export function getStorageAttachmentList(query) {
+ return request({
+ url: "/storageAttachment/list",
+ method: "get",
+ params: query,
+ });
+}
+
+// 閫氱敤闄勪欢淇濆瓨
+export function addStorageAttachment(data) {
+ return request({
+ url: "/storageAttachment/add",
+ method: "post",
+ data: data,
+ });
+}
+
+// 閫氱敤闄勪欢鍒犻櫎
+export function delStorageAttachment(ids) {
+ return request({
+ url: "/storageAttachment/delete",
+ method: "delete",
+ data: ids,
+ });
}
\ No newline at end of file
diff --git a/src/views/equipmentManagement/measurementEquipment/filesDia.vue b/src/views/equipmentManagement/measurementEquipment/filesDia.vue
index 16c026e..045ebc0 100644
--- a/src/views/equipmentManagement/measurementEquipment/filesDia.vue
+++ b/src/views/equipmentManagement/measurementEquipment/filesDia.vue
@@ -1,38 +1,16 @@
<template>
<div>
- <el-dialog
- v-model="dialogFormVisible"
- title="涓婁紶闄勪欢"
- width="50%"
- @close="closeDia"
- >
+ <el-dialog v-model="dialogFormVisible" title="涓婁紶闄勪欢" width="50%" @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-upload v-model:file-list="fileList" class="upload-demo" :action="uploadUrl"
+ :on-success="handleUploadSuccess" :on-error="handleUploadError" name="files" :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"
- :page="page"
- :tableLoading="tableLoading"
- :isSelection="true"
- @selection-change="handleSelectionChange"
- @pagination="paginationSearch"
- height="500"
- >
+ <PIMTable rowKey="id" :column="tableColumn" :tableData="tableData" :page="page" :tableLoading="tableLoading"
+ :isSelection="true" @selection-change="handleSelectionChange" @pagination="paginationSearch" height="500">
</PIMTable>
<template #footer>
<div class="dialog-footer">
@@ -45,16 +23,16 @@
</template>
<script setup>
-import {ref, reactive, getCurrentInstance} from "vue";
-import {ElMessageBox} from "element-plus";
-import {getToken} from "@/utils/auth.js";
+import { ref, reactive, getCurrentInstance } from "vue";
+import { ElMessageBox } from "element-plus";
+import { getToken } from "@/utils/auth.js";
import filePreview from '@/components/filePreview/index.vue'
import PIMTable from "@/components/PIMTable/PIMTable.vue";
import {
- fileAdd,
- fileDel,
- fileListPage
-} from "@/api/financialManagement/revenueManagement.js";
+ addStorageAttachment,
+ delStorageAttachment,
+ getStorageAttachmentList
+} from "@/api/equipmentManagement/measurementEquipment.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
@@ -90,9 +68,9 @@
},
]);
const page = reactive({
- current: 1,
- size: 100,
- total: 0,
+ current: 1,
+ size: 100,
+ total: 0,
});
const tableData = ref([]);
const fileList = ref([]);
@@ -101,24 +79,25 @@
const headers = ref({
Authorization: "Bearer " + getToken(),
});
-const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + "/file/upload"); // 涓婁紶鐨勫浘鐗囨湇鍔″櫒鍦板潃
+const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 涓婁紶鐨勬湇鍔″櫒鍦板潃
// 鎵撳紑寮规
-const openDialog = (row,type) => {
+const openDialog = (row, type) => {
accountType.value = type;
dialogFormVisible.value = true;
currentId.value = row.id;
getList()
}
const paginationSearch = (obj) => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
+ page.current = obj.page;
+ page.size = obj.limit;
+ // 鍓嶇鍒嗛〉鏆備笉澶勭悊锛岀洿鎺ヨ皟鐢ㄨ幏鍙栧叏閲忓垪琛�
+ getList();
};
const getList = () => {
- fileListPage({accountId: currentId.value,accountType:accountType.value, ...page}).then(res => {
- tableData.value = res.data.records;
- page.total = res.data.total;
+ getStorageAttachmentList({ recordId: currentId.value, recordType: accountType.value }).then(res => {
+ tableData.value = res.data;
+ page.total = res.data ? res.data.length : 0;
})
}
// 琛ㄦ牸閫夋嫨鏁版嵁
@@ -134,22 +113,25 @@
// 涓婁紶鎴愬姛澶勭悊
function handleUploadSuccess(res, file) {
// 濡傛灉涓婁紶鎴愬姛
- if (res.code == 200) {
- const fileRow = {}
- fileRow.name = res.data.originalName
- fileRow.url = res.data.tempPath
- uploadFile(fileRow)
+ if (res.code == 200 && res.data && res.data.length > 0) {
+ const newFiles = res.data.map(item => ({
+ ...item,
+ name: item.originalFilename || item.name
+ }));
+ const mergedFiles = [...(tableData.value || []), ...newFiles];
+ const storageAttachmentDTO = {
+ recordType: accountType.value,
+ recordId: currentId.value,
+ application: "file",
+ storageBlobDTOs: mergedFiles
+ };
+ addStorageAttachment(storageAttachmentDTO).then(r => {
+ proxy.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛");
+ getList()
+ })
} else {
proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
}
-}
-function uploadFile(file) {
- file.accountId = currentId.value;
- file.accountType = accountType.value;
- fileAdd(file).then(res => {
- proxy.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛");
- getList()
- })
}
// 涓婁紶澶辫触澶勭悊
function handleUploadError() {
@@ -157,13 +139,13 @@
}
// 涓嬭浇闄勪欢
const downLoadFile = (row) => {
- proxy.$download.byUrl(row.url, row.originalFilename);
+ proxy.$download.byUrl(row.url, row.originalFilename);
}
// 鍒犻櫎
const handleDelete = () => {
let ids = [];
if (selectedRows.value.length > 0) {
- ids = selectedRows.value.map((item) => item.id);
+ ids = selectedRows.value.map((item) => item.storageAttachmentId);
} else {
proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
return;
@@ -173,7 +155,7 @@
cancelButtonText: "鍙栨秷",
type: "warning",
}).then(() => {
- fileDel(ids).then((res) => {
+ delStorageAttachment(ids).then((res) => {
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
getList();
});
@@ -191,6 +173,4 @@
});
</script>
-<style scoped>
-
-</style>
\ No newline at end of file
+<style scoped></style>
\ No newline at end of file
diff --git a/src/views/equipmentManagement/measurementEquipment/index.vue b/src/views/equipmentManagement/measurementEquipment/index.vue
index d2ec2d7..007eef6 100644
--- a/src/views/equipmentManagement/measurementEquipment/index.vue
+++ b/src/views/equipmentManagement/measurementEquipment/index.vue
@@ -1,320 +1,354 @@
<template>
- <div class="app-container">
- <div class="search_form mb20">
- <div>
- <span class="search_title">褰曞叆鏃ユ湡锛�</span>
- <el-date-picker
- v-model="searchForm.recordDate"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- type="date"
- placeholder="璇烽�夋嫨"
- clearable
- style="width: 160px"
- @change="handleQuery"
- />
- <span class="search_title ml10">璁¢噺鍣ㄥ叿缂栧彿锛�</span>
- <el-input v-model="searchForm.code" placeholder="璇疯緭鍏ョ紪鍙�" clearable style="width: 240px" @change="handleQuery"/>
- <span class="search_title ml10">鐘舵�侊細</span>
- <el-select v-model="searchForm.status" placeholder="璇烽�夋嫨鐘舵��" @change="handleQuery" style="width: 160px" clearable>
- <el-option label="鏈夋晥" :value="1"></el-option>
- <el-option label="閫炬湡" :value="2"></el-option>
- </el-select>
- <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
- >鎼滅储</el-button
- >
- <el-button @click="handleReset" 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 @click="handleOut">瀵煎嚭</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"
- :dbRowClick="dbRowClick"
- :rowClassName="rowClassName"
- ></PIMTable>
- </div>
- <form-dia ref="formDia" @close="handleQuery"></form-dia>
- <calibration-dia ref="calibrationDia" @close="handleQuery"></calibration-dia>
+ <div class="app-container">
+ <div class="search_form mb20">
+ <div>
+ <span class="search_title">褰曞叆鏃ユ湡锛�</span>
+ <el-date-picker v-model="searchForm.recordDate"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ type="date"
+ placeholder="璇烽�夋嫨"
+ clearable
+ style="width: 160px"
+ @change="handleQuery" />
+ <span class="search_title ml10">璁¢噺鍣ㄥ叿缂栧彿锛�</span>
+ <el-input v-model="searchForm.code"
+ placeholder="璇疯緭鍏ョ紪鍙�"
+ clearable
+ style="width: 240px"
+ @change="handleQuery" />
+ <span class="search_title ml10">鐘舵�侊細</span>
+ <el-select v-model="searchForm.status"
+ placeholder="璇烽�夋嫨鐘舵��"
+ @change="handleQuery"
+ style="width: 160px"
+ clearable>
+ <el-option label="鏈夋晥"
+ :value="1"></el-option>
+ <el-option label="閫炬湡"
+ :value="2"></el-option>
+ </el-select>
+ <el-button type="primary"
+ @click="handleQuery"
+ style="margin-left: 10px">鎼滅储</el-button>
+ <el-button @click="handleReset"
+ 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 @click="handleOut">瀵煎嚭</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"
+ :dbRowClick="dbRowClick"
+ :rowClassName="rowClassName"></PIMTable>
+ </div>
+ <form-dia ref="formDia"
+ @close="handleQuery"></form-dia>
+ <calibration-dia ref="calibrationDia"
+ @close="handleQuery"></calibration-dia>
<files-dia ref="filesDia"></files-dia>
<rowClickDataForm ref="rowClickData"></rowClickDataForm>
- </div>
+ </div>
</template>
<script setup>
-import {onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
-import FormDia from "@/views/equipmentManagement/measurementEquipment/components/formDia.vue";
-import {ElMessageBox} from "element-plus";
-import useUserStore from "@/store/modules/user.js";
-import CalibrationDia from "@/views/equipmentManagement/measurementEquipment/components/calibrationDia.vue";
-import {
- measuringInstrumentDelete,
- measuringInstrumentListPage,
-} from "@/api/equipmentManagement/measurementEquipment.js";
-import FilesDia from "./filesDia.vue";
-import rowClickDataForm from "./components/rowClickData.vue"
-const { proxy } = getCurrentInstance();
-const userStore = useUserStore()
+ import {
+ onMounted,
+ ref,
+ reactive,
+ toRefs,
+ getCurrentInstance,
+ nextTick,
+ } from "vue";
+ import FormDia from "@/views/equipmentManagement/measurementEquipment/components/formDia.vue";
+ import { ElMessageBox } from "element-plus";
+ import useUserStore from "@/store/modules/user.js";
+ import CalibrationDia from "@/views/equipmentManagement/measurementEquipment/components/calibrationDia.vue";
+ import {
+ measuringInstrumentDelete,
+ measuringInstrumentListPage,
+ } from "@/api/equipmentManagement/measurementEquipment.js";
+ import FilesDia from "./filesDia.vue";
+ import rowClickDataForm from "./components/rowClickData.vue";
+ const { proxy } = getCurrentInstance();
+ const userStore = useUserStore();
-const data = reactive({
- searchForm: {
- recordDate: "",
- code: "",
- status: "",
- },
-});
-const { searchForm } = toRefs(data);
+ const data = reactive({
+ searchForm: {
+ recordDate: "",
+ code: "",
+ status: "",
+ },
+ });
+ const { searchForm } = toRefs(data);
-const tableColumn = ref([
- {
- label: "鍑哄巶缂栧彿",
- prop: "code",
- minWidth:150,
- align:"center"
- },
- {
- label: "璁¢噺鍣ㄥ叿鍚嶇О",
- prop: "name",
- width: '160px',
- align: "center",
- },
- {
- label: "妫�瀹氬崟浣�",
- prop: "unit",
- width: 200,
- align:"center"
- },
- {
- label: "璇佷功缂栧彿",
- prop: "model",
- width:200,
- align:"center"
- },
- {
- label: "鏈�鏂伴壌瀹氭棩鏈�",
- prop: "mostDate",
- width: 130,
- align:"center"
- },
- {
- label: "褰曞叆浜�",
- prop: "userName",
- width: 130,
- align:"center"
- },
- {
- label: "褰曞叆鏃ユ湡",
- prop: "recordDate",
- align:"center",
- minWidth: 130
- },
- {
- label: "鏈夋晥鏃ユ湡",
- prop: "valid",
- width: 130,
- align:"center"
- },
- {
- label: "鐘舵��",
- prop: "status",
- width: 130,
- align: "center",
- formatData: (params) => {
- if (params === 1) {
- return "鏈夋晥";
- } else if (params === 2) {
- return "閫炬湡";
- } else {
- return null;
- }
- }
- },
- {
- dataType: "action",
- label: "鎿嶄綔",
- align: "center",
- width: '130',
- fixed: 'right',
- operation: [
- {
- name: "闄勪欢",
- type: "text",
- clickFun: (row) => {
- openFilesFormDia(row);
- },
+ const tableColumn = ref([
+ {
+ label: "鍑哄巶缂栧彿",
+ prop: "code",
+ minWidth: 150,
+ align: "center",
+ },
+ {
+ label: "璁¢噺鍣ㄥ叿鍚嶇О",
+ prop: "name",
+ width: "160px",
+ align: "center",
+ },
+ {
+ label: "妫�瀹氬崟浣�",
+ prop: "unit",
+ width: 200,
+ align: "center",
+ },
+ {
+ label: "璇佷功缂栧彿",
+ prop: "model",
+ width: 200,
+ align: "center",
+ },
+ {
+ label: "鏈�鏂伴壌瀹氭棩鏈�",
+ prop: "mostDate",
+ width: 130,
+ align: "center",
+ },
+ {
+ label: "褰曞叆浜�",
+ prop: "userName",
+ width: 130,
+ align: "center",
+ },
+ {
+ label: "褰曞叆鏃ユ湡",
+ prop: "recordDate",
+ align: "center",
+ minWidth: 130,
+ },
+ {
+ label: "鏈夋晥鏃ユ湡",
+ prop: "valid",
+ width: 130,
+ align: "center",
+ },
+ {
+ label: "鐘舵��",
+ prop: "status",
+ width: 130,
+ align: "center",
+ formatData: params => {
+ if (params === 1) {
+ return "鏈夋晥";
+ } else if (params === 2) {
+ return "閫炬湡";
+ } else {
+ return null;
+ }
},
- {
- name: "鏌ョ湅",
- type: "text",
- clickFun: (row) => {
- openCalibrationDia("verifying", row);
- },
- },
- ],
- },
-]);
-const tableData = ref([]);
-const tableLoading = ref(false);
-const rowClickData = ref([])
-const filesDia = ref()
-const page = reactive({
- current: 1,
- size: 100,
- total: 0,
-});
-const selectedRows = ref([]);
+ },
+ {
+ dataType: "action",
+ label: "鎿嶄綔",
+ align: "center",
+ width: "130",
+ fixed: "right",
+ operation: [
+ {
+ name: "闄勪欢",
+ type: "text",
+ clickFun: row => {
+ openFilesFormDia(row);
+ },
+ },
+ {
+ name: "缂栬緫",
+ type: "text",
+ clickFun: row => {
+ openCalibrationDia("verifying", row);
+ },
+ },
+ ],
+ },
+ ]);
+ const tableData = ref([]);
+ const tableLoading = ref(false);
+ const rowClickData = ref([]);
+ const filesDia = ref();
+ const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0,
+ });
+ const selectedRows = ref([]);
-// 鎵撳紑闄勪欢寮规
-const openFilesFormDia = (row) => {
- filesDia.value?.openDialog(row,'璁¢噺鍣ㄥ叿鍙拌处')
-};
+ // 鎵撳紑闄勪欢寮规
+ const openFilesFormDia = row => {
+ filesDia.value?.openDialog(row, "measuring_instrument_ledger");
+ };
-const dbRowClick = (row)=>{
- rowClickData.value?.openDialog(row)
-}
+ const dbRowClick = row => {
+ rowClickData.value?.openDialog(row);
+ };
-// 琛屾牱寮忥細蹇埌鏈燂紙7澶╁唴锛夋垨閫炬湡鏍囩孩
-const rowClassName = ({ row }) => {
- console.log('rowClassName called:', row);
- // valid 鏄湁鏁堝ぉ鏁帮紝mostDate 鏄渶鏂版瀹氭棩鏈�
- if (row.valid && row.mostDate) {
- const mostDate = new Date(row.mostDate);
- // 璁$畻鍒版湡鏃ユ湡 = 妫�瀹氭棩鏈� + 鏈夋晥澶╂暟
- const validDays = parseInt(row.valid) || 0;
- const expireDate = new Date(mostDate);
- expireDate.setDate(expireDate.getDate() + validDays);
-
- const now = new Date();
- const diffDays = Math.ceil((expireDate - now) / (1000 * 60 * 60 * 24));
- console.log('row:', row.code, 'validDays:', validDays, 'expireDate:', expireDate, 'diffDays:', diffDays);
- // 7澶╁唴鍒版湡鎴栧凡閫炬湡閮芥爣绾�
- if (diffDays <= 7) {
- console.log('return warning-row');
- return 'warning-row';
+ // 琛屾牱寮忥細蹇埌鏈燂紙7澶╁唴锛夋垨閫炬湡鏍囩孩
+ const rowClassName = ({ row }) => {
+ console.log("rowClassName called:", row);
+ // valid 鏄湁鏁堝ぉ鏁帮紝mostDate 鏄渶鏂版瀹氭棩鏈�
+ if (row.valid && row.mostDate) {
+ const mostDate = new Date(row.mostDate);
+ // 璁$畻鍒版湡鏃ユ湡 = 妫�瀹氭棩鏈� + 鏈夋晥澶╂暟
+ const validDays = parseInt(row.valid) || 0;
+ const expireDate = new Date(mostDate);
+ expireDate.setDate(expireDate.getDate() + validDays);
+
+ const now = new Date();
+ const diffDays = Math.ceil((expireDate - now) / (1000 * 60 * 60 * 24));
+ console.log(
+ "row:",
+ row.code,
+ "validDays:",
+ validDays,
+ "expireDate:",
+ expireDate,
+ "diffDays:",
+ diffDays
+ );
+ // 7澶╁唴鍒版湡鎴栧凡閫炬湡閮芥爣绾�
+ if (diffDays <= 7) {
+ console.log("return warning-row");
+ return "warning-row";
+ }
+ } else {
+ console.log("row missing valid or mostDate:", row.valid, row.mostDate);
}
- } else {
- console.log('row missing valid or mostDate:', row.valid, row.mostDate);
- }
- return '';
-}
+ return "";
+ };
-// 琛ㄦ牸閫夋嫨鏁版嵁
-const handleSelectionChange = (selection) => {
- selectedRows.value = selection;
-};
-const formDia = ref()
-const calibrationDia = ref()
+ // 琛ㄦ牸閫夋嫨鏁版嵁
+ const handleSelectionChange = selection => {
+ selectedRows.value = selection;
+ };
+ const formDia = ref();
+ const calibrationDia = ref();
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
- page.current = 1;
- getList();
-};
+ // 鏌ヨ鍒楄〃
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ const handleQuery = () => {
+ page.current = 1;
+ getList();
+ };
-// 閲嶇疆鎼滅储鏉′欢
-const handleReset = () => {
- searchForm.value.recordDate = "";
- searchForm.value.code = "";
- searchForm.value.status = "";
- page.current = 1;
- getList();
-};
-const pagination = (obj) => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
-};
-const getList = () => {
- tableLoading.value = true;
- measuringInstrumentListPage({ ...searchForm.value, ...page }).then((res) => {
- tableLoading.value = false;
- tableData.value = res.data.records;
- page.total = res.data.total;
- }).catch((err) => {
- tableLoading.value = false;
- })
-};
+ // 閲嶇疆鎼滅储鏉′欢
+ const handleReset = () => {
+ searchForm.value.recordDate = "";
+ searchForm.value.code = "";
+ searchForm.value.status = "";
+ page.current = 1;
+ getList();
+ };
+ const pagination = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+ };
+ const getList = () => {
+ tableLoading.value = true;
+ measuringInstrumentListPage({ ...searchForm.value, ...page })
+ .then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ page.total = res.data.total;
+ })
+ .catch(err => {
+ tableLoading.value = false;
+ });
+ };
-// 鎵撳紑寮规
-const openForm = (type, row) => {
- nextTick(() => {
- formDia.value?.openDialog(type, row)
- })
-};
-// 鎵撳紑妫�瀹氭牎鍑嗗脊妗�
-const openCalibrationDia = (type, row) => {
- nextTick(() => {
- calibrationDia.value?.openDialog(type, row)
- })
-}
+ // 鎵撳紑寮规
+ const openForm = (type, row) => {
+ nextTick(() => {
+ formDia.value?.openDialog(type, row);
+ });
+ };
+ // 鎵撳紑妫�瀹氭牎鍑嗗脊妗�
+ const openCalibrationDia = (type, row) => {
+ nextTick(() => {
+ calibrationDia.value?.openDialog(type, row);
+ });
+ };
-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(() => {
- tableLoading.value = true;
- measuringInstrumentDelete(ids)
- .then((res) => {
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- getList();
- })
- .finally(() => {
- tableLoading.value = false;
- });
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
-};
-// 瀵煎嚭
-const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- proxy.download("/measuringInstrumentLedger/export", {}, "璁¢噺鍣ㄥ叿鍙拌处.xlsx");
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
-};
-onMounted(() => {
- getList();
-});
+ 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(() => {
+ tableLoading.value = true;
+ measuringInstrumentDelete(ids)
+ .then(res => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getList();
+ })
+ .finally(() => {
+ tableLoading.value = false;
+ });
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
+ // 瀵煎嚭
+ const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download(
+ "/measuringInstrumentLedger/export",
+ {},
+ "璁¢噺鍣ㄥ叿鍙拌处.xlsx"
+ );
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
+ onMounted(() => {
+ getList();
+ });
</script>
<style scoped>
-:deep(.el-table .warning-row) {
- background-color: #fef0f0 !important;
-}
-:deep(.el-table .warning-row:hover > td) {
- background-color: #f9d5d5 !important;
-}
-:deep(.el-table .el-table__body tr.warning-row td) {
- background-color: #fef0f0 !important;
-}
+ :deep(.el-table .warning-row) {
+ background-color: #fef0f0 !important;
+ }
+ :deep(.el-table .warning-row:hover > td) {
+ background-color: #f9d5d5 !important;
+ }
+ :deep(.el-table .el-table__body tr.warning-row td) {
+ background-color: #fef0f0 !important;
+ }
</style>
\ No newline at end of file
diff --git a/src/views/productionManagement/workOrderEdit/index.vue b/src/views/productionManagement/workOrderEdit/index.vue
index 15ad408..ead2c1f 100644
--- a/src/views/productionManagement/workOrderEdit/index.vue
+++ b/src/views/productionManagement/workOrderEdit/index.vue
@@ -289,7 +289,7 @@
if (!Number.isFinite(n)) return 0;
if (n <= 0) return 0;
if (n >= 100) return 100;
- return Math.round(n);
+ return parseFloat(n.toFixed(2));
};
const progressColor = percentage => {
diff --git a/src/views/productionManagement/workOrderManagement/index.vue b/src/views/productionManagement/workOrderManagement/index.vue
index ced481b..948eb1b 100644
--- a/src/views/productionManagement/workOrderManagement/index.vue
+++ b/src/views/productionManagement/workOrderManagement/index.vue
@@ -526,7 +526,7 @@
if (!Number.isFinite(n)) return 0;
if (n <= 0) return 0;
if (n >= 100) return 100;
- return Math.round(n);
+ return parseFloat(n.toFixed(2));
};
const progressColor = percentage => {
--
Gitblit v1.9.3