feat(stocking): 添加备货单车辆明细行内附件上传
每辆车行增加「上传附件」按钮与文件标签列表,附件随车辆 提交(attachment 字段)。 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -194,6 +194,35 @@
|
|||||||
<ElInput v-model="item.mileage" placeholder="请输入里程" />
|
<ElInput v-model="item.mileage" placeholder="请输入里程" />
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</ElCol>
|
</ElCol>
|
||||||
|
<ElCol :sm="12" :md="12" :lg="6" :xl="4">
|
||||||
|
<ElFormItem label="附件" label-width="85px">
|
||||||
|
<el-upload
|
||||||
|
:action="itemUploadAction"
|
||||||
|
:headers="uploadHeaders"
|
||||||
|
:show-file-list="false"
|
||||||
|
:before-upload="beforeItemAttachmentUpload"
|
||||||
|
:on-success="(res: any) => handleItemAttachmentUpload(res, idx)"
|
||||||
|
multiple
|
||||||
|
accept=".jpg,.jpeg,.png,.gif,.pdf,.doc,.docx,.xls,.xlsx,.txt"
|
||||||
|
>
|
||||||
|
<el-button size="small" type="primary" plain>上传附件</el-button>
|
||||||
|
</el-upload>
|
||||||
|
<div
|
||||||
|
v-if="item.attachment_files && item.attachment_files.length"
|
||||||
|
style="margin-top: 4px"
|
||||||
|
>
|
||||||
|
<el-tag
|
||||||
|
v-for="(f, fIdx) in item.attachment_files"
|
||||||
|
:key="fIdx"
|
||||||
|
closable
|
||||||
|
@close="removeItemAttachment(idx, fIdx)"
|
||||||
|
style="margin: 2px 4px 2px 0"
|
||||||
|
>
|
||||||
|
{{ f.name }}
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
</ElFormItem>
|
||||||
|
</ElCol>
|
||||||
</ElRow>
|
</ElRow>
|
||||||
<ElRow :gutter="12" class="item-row-wrap">
|
<ElRow :gutter="12" class="item-row-wrap">
|
||||||
<ElCol :sm="12" :md="12" :lg="6" :xl="4" v-if="(item.mileage ?? 0) <= 0">
|
<ElCol :sm="12" :md="12" :lg="6" :xl="4" v-if="(item.mileage ?? 0) <= 0">
|
||||||
@@ -1207,7 +1236,14 @@
|
|||||||
getVehicleList,
|
getVehicleList,
|
||||||
handleVehicleSizeChange,
|
handleVehicleSizeChange,
|
||||||
handleVehicleCurrentChange,
|
handleVehicleCurrentChange,
|
||||||
chooseVehicle
|
chooseVehicle,
|
||||||
|
|
||||||
|
// 车辆附件上传
|
||||||
|
uploadHeaders,
|
||||||
|
itemUploadAction,
|
||||||
|
beforeItemAttachmentUpload,
|
||||||
|
handleItemAttachmentUpload,
|
||||||
|
removeItemAttachment
|
||||||
} = useStockingForm(false) // isFinal = false
|
} = useStockingForm(false) // isFinal = false
|
||||||
|
|
||||||
// ---------- 草稿缓存:保存/恢复/清理 ----------
|
// ---------- 草稿缓存:保存/恢复/清理 ----------
|
||||||
|
|||||||
Reference in New Issue
Block a user