|
|
@@ -166,6 +166,12 @@
|
|
|
<text class="detail-label" style="margin-left: 15px;">单位:</text>
|
|
|
<text class="detail-value">{{ item.measureName }}</text>
|
|
|
</view>
|
|
|
+ <view class="detail-row">
|
|
|
+ <text class="detail-label">申请人:</text>
|
|
|
+ <text class="detail-value">{{ item.applyUser || '-' }}</text>
|
|
|
+ <text class="detail-label">用途:</text>
|
|
|
+ <text class="detail-value">{{ item.remark || '-' }}</text>
|
|
|
+ </view>
|
|
|
<view class="detail-row delete-row">
|
|
|
<text class="detail-label">数量:</text>
|
|
|
<uni-easyinput
|
|
|
@@ -420,8 +426,8 @@ watch(() => props.formData, (newVal) => {
|
|
|
|
|
|
// 从 details 或 detailList 中获取物料列表 (后端返回的是 details)
|
|
|
const rawList = newVal.details || newVal.detailList || []
|
|
|
-
|
|
|
- // 加载物料数据 (即使为空也加载,因为可能是新增场景)
|
|
|
+
|
|
|
+ // 加载物料数据 (即使为空也加载,因为可能是新增场景)
|
|
|
if (Array.isArray(rawList)) {
|
|
|
materialList.value = rawList.map((item: any) => ({
|
|
|
materialCode: item.materialCode || item.itemCode,
|
|
|
@@ -430,6 +436,10 @@ watch(() => props.formData, (newVal) => {
|
|
|
measureName: item.measureName || item.unit,
|
|
|
itemTypeName: item.itemTypeName || '',
|
|
|
qty: item.qty || 0,
|
|
|
+ applyUser: item.applyUser || '', // 申请人
|
|
|
+ remark: item.remark || '', // 用途
|
|
|
+ applyId: item.applyId || null, // 申请ID(用于数据完整性)
|
|
|
+ applyDeptName: item.applyDeptName || '', // 申请部门名称(用于数据完整性)
|
|
|
expanded: true // 默认展开
|
|
|
}))
|
|
|
} else {
|
|
|
@@ -520,6 +530,10 @@ async function selectItem(item: any) {
|
|
|
measureName: item.measureName || item.unit,
|
|
|
itemTypeName: item.itemTypeName || '',
|
|
|
qty: 0,
|
|
|
+ applyUser: '', // 申请人(新增时为空)
|
|
|
+ remark: '', // 用途(新增时为空)
|
|
|
+ applyId: null, // 申请ID(用于数据完整性)
|
|
|
+ applyDeptName: '', // 申请部门名称(用于数据完整性)
|
|
|
expanded: true
|
|
|
}
|
|
|
materialList.value = [...materialList.value, newItem]
|