diff --git a/src/views/device/sparePartsLedger/index.vue b/src/views/device/sparePartsLedger/index.vue index 5c447f5..154da55 100644 --- a/src/views/device/sparePartsLedger/index.vue +++ b/src/views/device/sparePartsLedger/index.vue @@ -44,6 +44,27 @@ style="width: 150px" /> + + + + + + + + @@ -763,6 +785,7 @@ import QRCode from 'qrcode'; export default { name: "SparePartsLedger", + dicts: ['safety_stock'], data() { return { // 导入数据 @@ -871,7 +894,10 @@ export default { ownEquipmentCode: null, unitPrice: null, procurementMethod: null, + isLow: null, }, + // 日期范围 + dateRange: [], options: [ { spareType: "专用", @@ -910,10 +936,18 @@ export default { indexMethod(index) { return index + 1; }, + rowStyle({ row }) { + if (row.amount < row.safeStock) { + return { + backgroundColor: 'rgba(255, 0, 0, 0.1)', + color: '#ff0000' + } + } + }, /** 查询备品备件台账管理列表 */ getList() { this.loading = true; - listSparePartsLedger(this.queryParams).then((response) => { + listSparePartsLedger(this.addDateRange(this.queryParams, this.dateRange)).then((response) => { this.sparePartsLedgerList = response.rows; this.total = response.total; this.loading = false; diff --git a/src/views/device/sparepartsInOutStorage/index.vue b/src/views/device/sparepartsInOutStorage/index.vue index 9102d34..35ed315 100644 --- a/src/views/device/sparepartsInOutStorage/index.vue +++ b/src/views/device/sparepartsInOutStorage/index.vue @@ -49,6 +49,17 @@ @keyup.enter.native="handleQuery" /> + + + @@ -175,7 +188,7 @@ @@ -363,6 +377,8 @@ export default { delFlag: null, factoryCode: null, }, + // 日期范围 + dateRange: [], // 表单参数 form: {}, // 表单校验 @@ -401,12 +417,32 @@ export default { /** 查询备品备件出入库列表 */ getList() { this.loading = true; - listSparepartsInOutStorage(this.queryParams).then((response) => { + listSparepartsInOutStorage(this.addDateRange(this.queryParams, this.dateRange)).then((response) => { this.sparepartsInOutStorageList = response.rows; this.total = response.total; this.loading = false; }); }, + getSummaries(param) { + const { columns, data } = param; + const sums = []; + + // 初始化所有列 + columns.forEach((column, index) => { + if (index === 1) { + sums[index] = '总数'; // 第一列显示固定文本 + } else if (column.property === 'amount') { + // 计算amount列合计 + const total = data.reduce((sum, item) => { + const val = Number(item.amount); + return sum + (isNaN(val) ? 0 : val); + }, 0); + sums[index] = total + ' 个'; + } + }); + + return sums; + }, // 取消按钮 cancel() { this.open = false; @@ -441,6 +477,7 @@ export default { }, /** 重置按钮操作 */ resetQuery() { + this.dateRange = []; this.resetForm("queryForm"); this.handleQuery(); }, diff --git a/src/views/mes/reportWork/index.vue b/src/views/mes/reportWork/index.vue index 68d14a5..b77d662 100644 --- a/src/views/mes/reportWork/index.vue +++ b/src/views/mes/reportWork/index.vue @@ -23,7 +23,7 @@ @keyup.enter.native="handleQuery" /> - @@ -426,6 +426,14 @@ v-model="item.remark" placeholder="请输入内容(300个字内)" maxlength=300 > + +
+

用人情况说明:

+ + +
+