diff --git a/src/views/PurchasingManagement/OrderInquiry/index.vue b/src/views/PurchasingManagement/OrderInquiry/index.vue
index 7c88a7a8..de4d60af 100644
--- a/src/views/PurchasingManagement/OrderInquiry/index.vue
+++ b/src/views/PurchasingManagement/OrderInquiry/index.vue
@@ -470,7 +470,7 @@
@@ -711,6 +711,10 @@ export default {
limit: 20,
Data: {},
upload: url,
+ uploadSaving: false,
+ uploadFileTotal: 0,
+ uploadFileFinished: 0,
+ uploadFileFailed: 0,
consignee: '',
receiverTelephoneNumber: '',
loading: false, // 数据加载
@@ -1025,10 +1029,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 + '\\OrderInquiry\\' + timestamp + '-' + this.purchaseContractID + '.' + 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 + '\\OrderInquiry\\' + timestamp + '-' + this.purchaseContractID + '-' + uniqueCode + '.' + suffix
// 构造SQL语句
- const sqlStatement = `update 采购管理_采购合同查询_图片 set 文件内容 = NULL, 文件路径 = N'${savePath}' where id = (select top 1 id from 采购管理_采购合同查询_图片 where 采购合同流水号 = ${this.purchaseContractID} and 文件路径 is null order by 操作时间 desc)`
+ const sqlStatement = `update 采购管理_采购合同查询_图片 set 文件内容 = NULL, 文件路径 = N'${savePath}' where id = (select top 1 id from 采购管理_采购合同查询_图片 where 采购合同流水号 = ${this.purchaseContractID} 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()
@@ -1042,10 +1051,24 @@ export default {
if (response.data && response.data[0] && response.data[0].result === '1') {
console.log('文件保存成功:', savePath)
} else {
+ this.uploadFileFailed++
console.error('文件保存失败:', response.data)
}
}).catch(err => {
+ this.uploadFileFailed++
console.error('文件保存异常:', err)
+ }).finally(() => {
+ this.uploadFileFinished++
+ if (this.uploadFileFinished >= this.uploadFileTotal) {
+ this.uploadSaving = false
+ if (this.uploadFileFailed === 0) {
+ this.$message.success('图片上传成功')
+ this.dialogFormVisible2 = false
+ this.$refs.upload.clearFiles()
+ } else {
+ this.$message.error('部分图片上传失败,请重新上传失败图片')
+ }
+ }
})
// this.dialogFormVisible2 = false
@@ -1060,6 +1083,14 @@ export default {
// }
},
submitPicture() {
+ if (!this.$refs.upload || this.$refs.upload.uploadFiles.length === 0) {
+ this.$message.warning('请选择图片')
+ return
+ }
+ this.uploadSaving = true
+ this.uploadFileTotal = this.$refs.upload.uploadFiles.length
+ this.uploadFileFinished = 0
+ this.uploadFileFailed = 0
var param = []
param[0] = ['采购合同流水号', this.purchaseContractID]
param[1] = ['文件名称', '']
@@ -1068,8 +1099,6 @@ export default {
var Data1 = this.CreateData('15', '采购合同查询_上传图片', param)
this.Data.param = Data1
this.$refs.upload.submit()
- this.dialogFormVisible2 = false
- this.$refs.upload.clearFiles()
},
exportTable(row) {
this.supplier = row.供应商
@@ -1469,31 +1498,13 @@ export default {
if (this.arrivalTableData.length === 0) {
this.$message.info('该合同下没有物料明细')
}
- // 生成入库单号:RK + 年月日 + 采购合同流水号 + 当天自增序号
- this.generate入库单号()
+ // 从后端获取入库单号
+ if (response.data.length > 0 && response.data[0].入库单号) {
+ this.入库单号 = response.data[0].入库单号
+ }
})
},
- generate入库单号() {
- var now = new Date()
- var year = now.getFullYear()
- var month = (now.getMonth() + 1).toString().padStart(2, '0')
- var day = now.getDate().toString().padStart(2, '0')
- var dateStr = '' + year + month + day
- var storageKey = 'RK_SEQ_' + dateStr
- var currentSeq = parseInt(localStorage.getItem(storageKey) || '0') + 1
- var seqStr = currentSeq.toString().padStart(1, '0')
- this.入库单号 = 'RK' + dateStr + this.arrivalContractNo + seqStr
- },
- increment入库单号Seq() {
- var now = new Date()
- var year = now.getFullYear()
- var month = (now.getMonth() + 1).toString().padStart(2, '0')
- var day = now.getDate().toString().padStart(2, '0')
- var dateStr = '' + year + month + day
- var storageKey = 'RK_SEQ_' + dateStr
- var currentSeq = parseInt(localStorage.getItem(storageKey) || '0') + 1
- localStorage.setItem(storageKey, currentSeq.toString())
- },
+
submitArrivalNotice() {
const arrivalData = this.arrivalTableData.filter(item => item.到货数量 > 0)
if (arrivalData.length === 0) {
@@ -1528,7 +1539,6 @@ export default {
duration: 3000
})
this.searchLeftTable()
- this.increment入库单号Seq()
this.dialogFormVisible4 = false
} else {
this.$message.error('通知失败')
diff --git a/src/views/PurchasingManagement/PurchaseOrder/index.vue b/src/views/PurchasingManagement/PurchaseOrder/index.vue
index 0b7751f7..e6bcacaf 100644
--- a/src/views/PurchasingManagement/PurchaseOrder/index.vue
+++ b/src/views/PurchasingManagement/PurchaseOrder/index.vue
@@ -1302,10 +1302,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 + '\\OrderInquiry\\' + timestamp + '-' + this.purchaseContractID + '.' + 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 + '\\OrderInquiry\\' + timestamp + '-' + this.purchaseContractID + '-' + uniqueCode + '.' + suffix
// 构造SQL语句
- const sqlStatement = `update 采购管理_采购合同查询_图片 set 文件内容 = NULL, 文件路径 = N'${savePath}' where id = (select top 1 id from 采购管理_采购合同查询_图片 where 采购合同流水号 = ${this.purchaseContractID} order by 操作时间 desc)`
+ const sqlStatement = `update 采购管理_采购合同查询_图片 set 文件内容 = NULL, 文件路径 = N'${savePath}' where id = (select top 1 id from 采购管理_采购合同查询_图片 where 采购合同流水号 = ${this.purchaseContractID} 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()
diff --git a/src/views/SalesManagement/DeliveryRecord/index.vue b/src/views/SalesManagement/DeliveryRecord/index.vue
index 0a167873..892d8c69 100644
--- a/src/views/SalesManagement/DeliveryRecord/index.vue
+++ b/src/views/SalesManagement/DeliveryRecord/index.vue
@@ -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;
}
-
diff --git a/src/views/SalesManagement/ProductDelivery/index.vue b/src/views/SalesManagement/ProductDelivery/index.vue
index 62e9fcd2..8a003bfc 100644
--- a/src/views/SalesManagement/ProductDelivery/index.vue
+++ b/src/views/SalesManagement/ProductDelivery/index.vue
@@ -1280,10 +1280,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()
diff --git a/src/views/SeikoWorkshop/WorkshopAssignment/index.vue b/src/views/SeikoWorkshop/WorkshopAssignment/index.vue
index 49a9416d..097533d1 100644
--- a/src/views/SeikoWorkshop/WorkshopAssignment/index.vue
+++ b/src/views/SeikoWorkshop/WorkshopAssignment/index.vue
@@ -957,6 +957,7 @@ export default {
param[1] = ['数量', row.数量]
param[2] = ['工艺任务流水号', row.工艺任务流水号]
param[3] = ['退货人', this.id]
+ param[4] = ['订单流水号', row.订单流水号]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_取消派工', param)
this.ExecDatabase(Data).then(response => {
diff --git a/src/views/TechnologyCenter/MaterialMaintain/index.vue b/src/views/TechnologyCenter/MaterialMaintain/index.vue
index 2adab4d8..39dfdfcf 100644
--- a/src/views/TechnologyCenter/MaterialMaintain/index.vue
+++ b/src/views/TechnologyCenter/MaterialMaintain/index.vue
@@ -37,9 +37,9 @@
style="margin-left:10px"
@click="pageCurrent=1;searchTable()">查询
-
+
采购变更申请
@@ -209,6 +209,7 @@
style="margin-right: 10px"
@click="handleEdit(scope.row)"/>
+
+
+
+
+
+
+
+
+
@@ -131,7 +159,11 @@ export default {
},
生产中期限筛选: null,
生产中全部数据: [],
- 领料单数: 0
+ 领料单数: 0,
+ 待入库全部数据: [],
+ 选中的入库单号: '',
+ 待入库子表格数据: [],
+ 待入库子表格列: []
}
},
computed: {
@@ -228,13 +260,16 @@ export default {
var param = []
var Data = this.CreateData('11', '仓储管理_入库单_查询', param)
this.ExecDatabase(Data).then(response => {
- let count = 0
- response.data.forEach(item => {
- if (item.是否入库 === false) {
- count++
+ var filtered = response.data.filter(item => item.是否入库 === false)
+ // 按入库单号整合,同一单号只计一次
+ var map = {}
+ filtered.forEach(item => {
+ var key = item.入库单号
+ if (!map[key]) {
+ map[key] = true
}
})
- this.statistics.待入库 = count
+ this.statistics.待入库 = Object.keys(map).length
})
},
@@ -389,6 +424,8 @@ export default {
this.currentDetail = type
this.loading = true
this.生产中期限筛选 = null
+ this.选中的入库单号 = ''
+ this.待入库子表格数据 = []
switch (type) {
case '待入库':
@@ -423,7 +460,26 @@ export default {
var param = []
var Data = this.CreateData('11', '仓储管理_入库单_查询', param)
this.ExecDatabase(Data).then(response => {
- this.detailData = response.data.filter(item => item.是否入库 === false)
+ var filtered = response.data.filter(item => item.是否入库 === false)
+ // 保存全部未入库原始数据,用于子表格筛选
+ this.待入库全部数据 = filtered
+ this.选中的入库单号 = ''
+ this.待入库子表格数据 = []
+ // 按入库单号整合,同一单号的到货数求和
+ var map = {}
+ filtered.forEach(item => {
+ var key = item.入库单号
+ if (!map[key]) {
+ map[key] = {
+ 入库单号: item.入库单号,
+ 采购合同号: item.采购合同号,
+ 供应商名称: item.供应商名称,
+ 到货数: 0
+ }
+ }
+ map[key].到货数 += (item.到货数 || 0)
+ })
+ this.detailData = Object.values(map)
this.detailColumns = [
{ prop: '入库单号', label: '入库单号', width: '150px', align: 'center' },
{ prop: '采购合同号', label: '采购合同号', width: '100px', align: 'center' },
@@ -434,6 +490,21 @@ export default {
})
},
+ // 点击待入库行,右侧显示该入库单号的明细
+ handlePendingInStorageRowClick(row) {
+ if (this.currentDetail !== '待入库') return
+ this.选中的入库单号 = row.入库单号
+ this.待入库子表格数据 = this.待入库全部数据.filter(item => item.入库单号 === row.入库单号)
+ this.待入库子表格列 = [
+ { prop: '入库单号', label: '入库单号', width: '120px', align: 'center' },
+ { prop: '采购合同号', label: '采购合同号', width: '120px', align: 'center' },
+ { prop: '供应商名称', label: '供应商', width: '120px', align: 'center' },
+ { prop: '物料名称', label: '物料名称', width: '150px', align: 'center' },
+ { prop: '图号或型号', label: '图号或型号', width: '120px', align: 'center' },
+ { prop: '到货数', label: '到货数', width: '80px', align: 'center' }
+ ]
+ },
+
// 获取待出库详情
getPendingOutStorageDetail() {
var param = []
@@ -712,6 +783,16 @@ export default {
font-weight: bold;
}
+ .link-text {
+ color: #409eff;
+ cursor: pointer;
+ text-decoration: underline;
+ }
+
+ .link-text:hover {
+ color: #66b1ff;
+ }
+
.summary-card {
height: 100px;
display: flex;