diff --git a/src/views/EquipmentLedger/details.vue b/src/views/EquipmentLedger/details.vue
index 41c6152c..d7199fb5 100644
--- a/src/views/EquipmentLedger/details.vue
+++ b/src/views/EquipmentLedger/details.vue
@@ -57,18 +57,24 @@
+
+
+
+
+
+
+
+
-
-
@@ -84,11 +90,7 @@
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/views/EquipmentLedger/index.vue b/src/views/EquipmentLedger/index.vue
index c0cd78a0..8f001b74 100644
--- a/src/views/EquipmentLedger/index.vue
+++ b/src/views/EquipmentLedger/index.vue
@@ -804,6 +804,7 @@ export default {
{ key: 17, label: `出厂日期`, prop: 'productionDate', visible: true },
{ key: 18, label: `采购日期`, prop: 'purchaseDate', visible: true },
{ key: 19, label: `资产原值(万元)`, prop: 'originalValue', visible: true },
+ { key: 19, label: `资产净值(万元)`, prop: 'value', visible: true },
{ key: 20, label: `最大使用年限(年)`, prop: 'maxServiceLifeYears', visible: true },
{ key: 21, label: `下次维保日期`, prop: 'nextMaintenanceDate', visible: true },
{ key: 22, label: `装备外观`, prop: 'appearanceImages', visible: true },
diff --git a/src/views/EquipmentRoamRecord/outboundRecord/index.vue b/src/views/EquipmentRoamRecord/outboundRecord/index.vue
index 65cc8cac..60448b8a 100644
--- a/src/views/EquipmentRoamRecord/outboundRecord/index.vue
+++ b/src/views/EquipmentRoamRecord/outboundRecord/index.vue
@@ -262,9 +262,42 @@ export default {
)
},
- // 下载
+ // 下载PDF方法
onHandleDownload() {
- this.download('material-mall/decChange/exportDetails', { id: this.recordId }, `出库记录单.xlsx`)
+ this.downloadPDF('material-mall/decChange/exportDetails', { id: this.recordId }, '出库记录单.pdf');
+ },
+
+// 封装PDF下载逻辑
+ async downloadPDF(url, params, fileName) {
+ try {
+ // 关键:设置responseType为blob(二进制流)
+ const response = await this.$axios({
+ method: 'post',
+ url: url,
+ data: params, // POST请求参数
+ responseType: 'blob', // 必须指定为blob
+ headers: {
+ 'Content-Type': 'application/json;charset=UTF-8' // 匹配后端接收格式
+ }
+ });
+
+ // 创建下载链接
+ const blob = new Blob([response.data], { type: 'application/pdf' });
+ const downloadUrl = window.URL.createObjectURL(blob);
+ const link = document.createElement('a');
+ link.href = downloadUrl;
+ link.download = fileName; // 文件名
+ document.body.appendChild(link);
+ link.click(); // 触发下载
+
+ // 释放资源
+ document.body.removeChild(link);
+ window.URL.revokeObjectURL(downloadUrl);
+
+ this.$message.success('PDF导出成功!');
+ } catch (error) {
+ this.$message.error('PDF导出失败:' + (error.message || '未知错误'));
+ }
},
// 打印
@@ -319,7 +352,7 @@ export default {
display: flex;
flex-direction: column;
overflow: hidden;
-
+
::v-deep .el-card__body {
display: flex !important;
flex-direction: column !important;
diff --git a/src/views/business/warehouse/details.vue b/src/views/business/warehouse/details.vue
index f88d96f6..c3b146fa 100644
--- a/src/views/business/warehouse/details.vue
+++ b/src/views/business/warehouse/details.vue
@@ -34,7 +34,17 @@
:label="item.proName"
:value="item.proCode"
v-for="item in useProjectList"
- />
+ style="width: 200px"
+ >
+
+ {{ item.proName }}
+
+
+
diff --git a/src/views/toolsManage/codeToolsLedger/index.vue b/src/views/toolsManage/codeToolsLedger/index.vue
index 23ec6b58..fccb3c48 100644
--- a/src/views/toolsManage/codeToolsLedger/index.vue
+++ b/src/views/toolsManage/codeToolsLedger/index.vue
@@ -85,6 +85,17 @@
编码工具台账列表
+
+
+ 导出数据
+
+
@@ -565,6 +576,17 @@ export default {
if (!val) return
this.getSelectList()
},
+
+ /**
+ * 导出数据
+ */
+ handleExport() {
+ this.download('/material-mall/toolLedger/export', {
+ ...this.queryParams
+ }, `编码工具台账_${new Date().getTime()}.xlsx`)
+ },
+
+
// 获取厂家
async getManufacturerSelect() {
try {
diff --git a/src/views/toolsManage/toolsApplication/components/AddNum.vue b/src/views/toolsManage/toolsApplication/components/AddNum.vue
index 4cbfc1e9..fe79a2a8 100644
--- a/src/views/toolsManage/toolsApplication/components/AddNum.vue
+++ b/src/views/toolsManage/toolsApplication/components/AddNum.vue
@@ -7,17 +7,13 @@
-
- 点击填充
-
+
@@ -38,9 +34,11 @@
:prop="column.prop"
align="center"
>
-
-
+
+
+
+
+
+
+ {{ row[column.prop] }}
删除删除
@@ -84,6 +94,7 @@ export default {
{ label: '工具名称', prop: 'parentTypeName' },
{ label: '规格型号', prop: 'typeName' },
{ label: '计量单位', prop: 'unitName' },
+ { label: '单价', prop: 'originCost', width: 150 },
{ label: '申请数量', prop: 'applyNum', width: 150 },
],
dialogList: [],
@@ -114,7 +125,7 @@ export default {
handleTree(tree) {
for (const node of tree) {
if (node.level === '5') {
- // 删除 children
+ // 删除 children,标记为最终可选节点
delete node.children
} else if (node.children && node.children.length > 0) {
// 继续递归下级
@@ -123,12 +134,56 @@ export default {
}
},
handleChange(val) {
- console.log('🚀 ~ val:', val)
- this.dialogForm.typeId = val ? val[val.length - 1] : ''
+ console.log('🚀 ~ 选中的节点ID路径:', val)
+ // 1. 空值(取消选择)直接返回
+ if (!val || val.length === 0) {
+ this.dialogForm.typeId = ''
+ this.activeLabels = []
+ this.lastNode = null
+ return
+ }
+
+ // 2. 获取最后一级节点信息
+ this.dialogForm.typeId = val[val.length - 1]
this.activeLabels = this.getLabelsFromValuePath(val, this.options)
- this.lastNode = this.findNodeById(this.options, val[val.length - 1])
- console.log('🚀 ~ this.lastNode:', this.lastNode)
- console.log('选中的 labels:', this.activeLabels)
+ this.lastNode = this.findNodeById(this.options, this.dialogForm.typeId)
+
+ // 3. 仅当选中最后一级节点(level=5)时,自动填充表格
+ if (this.lastNode?.level === '5') {
+ this.autoAddToTable()
+ }
+ },
+ // 自动添加到表格的核心逻辑(提取原handleAdd的逻辑)
+ autoAddToTable() {
+ const typeId = this.dialogForm.typeId
+ // 去重判断:已添加则提示并返回
+ if (this.dialogList.some((item) => item.typeId === typeId)) {
+ this.$message({
+ type: 'warning',
+ message: '该工具已添加,请勿重复选择!',
+ })
+ return
+ }
+
+ // 初始化默认值并添加到表格
+ const originCost = this.lastNode?.originCost || 0
+ this.dialogList.unshift({
+ applyId: this.dialogForm.applyId,
+ typeId,
+ fourthParentName: this.activeLabels[0] || '',
+ greatGrandparentName: this.activeLabels[1] || '',
+ grandparentTypeName: this.activeLabels[2] || '',
+ parentTypeName: this.activeLabels[3] || '',
+ typeName: this.activeLabels[4] || '',
+ unitName: this.lastNode.unitName || '',
+ originCost,
+ applyNum: 1,
+ })
+ this.$message({
+ type: 'success',
+ message: '工具已添加到列表!',
+ duration: 1500, // 缩短提示时长,提升体验
+ })
},
getLabelsFromValuePath(valuePath, options) {
let labels = []
@@ -155,29 +210,6 @@ export default {
}
return null // 没找到
},
- handleAdd() {
- console.log('🚀 ~ handleAdd:', this.dialogForm.typeId)
- const typeId = this.typeIdList[this.typeIdList.length - 1]
- if (this.dialogList.some((item) => item.typeId === typeId)) {
- this.$message({
- type: 'warning',
- message: '该工具已添加!',
- })
- return
- }
- this.dialogList.unshift({
- applyId: this.dialogForm.applyId,
- typeId,
- fourthParentName: this.activeLabels[0],
- greatGrandparentName: this.activeLabels[1],
- grandparentTypeName: this.activeLabels[2],
- parentTypeName: this.activeLabels[3],
- typeName: this.activeLabels[4],
- unitName: this.lastNode.unitName,
- applyNum: 1,
- })
- console.log('🚀 ~ this.dialogList:', this.dialogList)
- },
handleDelete(index) {
this.dialogList.splice(index, 1)
this.$message({
diff --git a/src/views/toolsManage/toolsLedger/index.vue b/src/views/toolsManage/toolsLedger/index.vue
index 1469906f..f8c46bf5 100644
--- a/src/views/toolsManage/toolsLedger/index.vue
+++ b/src/views/toolsManage/toolsLedger/index.vue
@@ -77,6 +77,15 @@
工具台账列表
+
+ 导出数据
+
@@ -115,7 +124,7 @@
@@ -490,7 +511,7 @@ export default {
display: flex;
flex-direction: column;
overflow: hidden;
-
+
::v-deep .el-card__body {
display: flex !important;
flex-direction: column !important;