更新采购订单、发货记录、车间派工、物料维护、采购入库和仓储汇总等多个页面

This commit is contained in:
Developer
2026-06-22 11:28:56 +08:00
parent d81a528533
commit 0c8c6587bd
9 changed files with 325 additions and 105 deletions

View File

@@ -297,10 +297,15 @@ export default {
now.getSeconds().toString().padStart(2, '0') +
now.getMilliseconds().toString().padStart(3, '0')
const suffix = file.name.split('.').pop() || 'jpg'
const savePath = MESUploadFileNew_BasePath + '\\DeliveryRecord\\' + timestamp + '-' + this.listValue + '.' + suffix
const lastDotIndex = file.name.lastIndexOf('.')
const fileName = lastDotIndex > -1 ? file.name.slice(0, lastDotIndex) : file.name
const sqlFileName = fileName.replace(/'/g, "''")
const sqlSuffix = suffix.replace(/'/g, "''")
const uniqueCode = Math.random().toString(36).slice(2, 8)
const savePath = MESUploadFileNew_BasePath + '\\DeliveryRecord\\' + timestamp + '-' + this.listValue + '-' + uniqueCode + '.' + suffix
// 构造SQL语句清空文件内容更新文件路径
const sqlStatement = `update 发货管理_发货单_图片 set 文件内容 = NULL, 文件路径 = N'${savePath}' where id = (select top 1 id from 发货管理_发货单_图片 where 发货单流水号 = ${this.listValue} order by 操作时间 desc)`
const sqlStatement = `update 发货管理_发货单_图片 set 文件内容 = NULL, 文件路径 = N'${savePath}' where id = (select top 1 id from 发货管理_发货单_图片 where 发货单流水号 = ${this.listValue} and 文件名称 = N'${sqlFileName}' and 文件后缀 = N'${sqlSuffix}' and 文件路径 is null order by 操作时间 desc, id desc); IF @@ROWCOUNT <> 1 RAISERROR(N'图片路径回填失败', 16, 1)`
// 调用新接口保存文件到磁盘
const formData = new FormData()
@@ -563,4 +568,3 @@ export default {
width: 50px!important;
}
</style>