更新采购订单、发货记录、车间派工、物料维护、采购入库和仓储汇总等多个页面
This commit is contained in:
@@ -470,7 +470,7 @@
|
|||||||
</el-upload>
|
</el-upload>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="dialogFormVisible2=false">取消</el-button>
|
<el-button @click="dialogFormVisible2=false">取消</el-button>
|
||||||
<el-button type="primary" style="width: 70px" @click="submitPicture()">确定</el-button>
|
<el-button :loading="uploadSaving" type="primary" style="width: 70px" @click="submitPicture()">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog :visible.sync="dialogVisiblePictureCard">
|
<el-dialog :visible.sync="dialogVisiblePictureCard">
|
||||||
@@ -711,6 +711,10 @@ export default {
|
|||||||
limit: 20,
|
limit: 20,
|
||||||
Data: {},
|
Data: {},
|
||||||
upload: url,
|
upload: url,
|
||||||
|
uploadSaving: false,
|
||||||
|
uploadFileTotal: 0,
|
||||||
|
uploadFileFinished: 0,
|
||||||
|
uploadFileFailed: 0,
|
||||||
consignee: '',
|
consignee: '',
|
||||||
receiverTelephoneNumber: '',
|
receiverTelephoneNumber: '',
|
||||||
loading: false, // 数据加载
|
loading: false, // 数据加载
|
||||||
@@ -1025,10 +1029,15 @@ export default {
|
|||||||
now.getSeconds().toString().padStart(2, '0') +
|
now.getSeconds().toString().padStart(2, '0') +
|
||||||
now.getMilliseconds().toString().padStart(3, '0')
|
now.getMilliseconds().toString().padStart(3, '0')
|
||||||
const suffix = file.name.split('.').pop() || 'jpg'
|
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语句
|
// 构造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()
|
const formData = new FormData()
|
||||||
@@ -1042,10 +1051,24 @@ export default {
|
|||||||
if (response.data && response.data[0] && response.data[0].result === '1') {
|
if (response.data && response.data[0] && response.data[0].result === '1') {
|
||||||
console.log('文件保存成功:', savePath)
|
console.log('文件保存成功:', savePath)
|
||||||
} else {
|
} else {
|
||||||
|
this.uploadFileFailed++
|
||||||
console.error('文件保存失败:', response.data)
|
console.error('文件保存失败:', response.data)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
this.uploadFileFailed++
|
||||||
console.error('文件保存异常:', err)
|
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
|
// this.dialogFormVisible2 = false
|
||||||
@@ -1060,6 +1083,14 @@ export default {
|
|||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
submitPicture() {
|
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 = []
|
var param = []
|
||||||
param[0] = ['采购合同流水号', this.purchaseContractID]
|
param[0] = ['采购合同流水号', this.purchaseContractID]
|
||||||
param[1] = ['文件名称', '']
|
param[1] = ['文件名称', '']
|
||||||
@@ -1068,8 +1099,6 @@ export default {
|
|||||||
var Data1 = this.CreateData('15', '采购合同查询_上传图片', param)
|
var Data1 = this.CreateData('15', '采购合同查询_上传图片', param)
|
||||||
this.Data.param = Data1
|
this.Data.param = Data1
|
||||||
this.$refs.upload.submit()
|
this.$refs.upload.submit()
|
||||||
this.dialogFormVisible2 = false
|
|
||||||
this.$refs.upload.clearFiles()
|
|
||||||
},
|
},
|
||||||
exportTable(row) {
|
exportTable(row) {
|
||||||
this.supplier = row.供应商
|
this.supplier = row.供应商
|
||||||
@@ -1469,31 +1498,13 @@ export default {
|
|||||||
if (this.arrivalTableData.length === 0) {
|
if (this.arrivalTableData.length === 0) {
|
||||||
this.$message.info('该合同下没有物料明细')
|
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() {
|
submitArrivalNotice() {
|
||||||
const arrivalData = this.arrivalTableData.filter(item => item.到货数量 > 0)
|
const arrivalData = this.arrivalTableData.filter(item => item.到货数量 > 0)
|
||||||
if (arrivalData.length === 0) {
|
if (arrivalData.length === 0) {
|
||||||
@@ -1528,7 +1539,6 @@ export default {
|
|||||||
duration: 3000
|
duration: 3000
|
||||||
})
|
})
|
||||||
this.searchLeftTable()
|
this.searchLeftTable()
|
||||||
this.increment入库单号Seq()
|
|
||||||
this.dialogFormVisible4 = false
|
this.dialogFormVisible4 = false
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('通知失败')
|
this.$message.error('通知失败')
|
||||||
|
|||||||
@@ -1302,10 +1302,15 @@ export default {
|
|||||||
now.getSeconds().toString().padStart(2, '0') +
|
now.getSeconds().toString().padStart(2, '0') +
|
||||||
now.getMilliseconds().toString().padStart(3, '0')
|
now.getMilliseconds().toString().padStart(3, '0')
|
||||||
const suffix = file.name.split('.').pop() || 'jpg'
|
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语句
|
// 构造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()
|
const formData = new FormData()
|
||||||
|
|||||||
@@ -297,10 +297,15 @@ export default {
|
|||||||
now.getSeconds().toString().padStart(2, '0') +
|
now.getSeconds().toString().padStart(2, '0') +
|
||||||
now.getMilliseconds().toString().padStart(3, '0')
|
now.getMilliseconds().toString().padStart(3, '0')
|
||||||
const suffix = file.name.split('.').pop() || 'jpg'
|
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语句:清空文件内容,更新文件路径
|
// 构造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()
|
const formData = new FormData()
|
||||||
@@ -563,4 +568,3 @@ export default {
|
|||||||
width: 50px!important;
|
width: 50px!important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -1280,10 +1280,15 @@ export default {
|
|||||||
now.getSeconds().toString().padStart(2, '0') +
|
now.getSeconds().toString().padStart(2, '0') +
|
||||||
now.getMilliseconds().toString().padStart(3, '0')
|
now.getMilliseconds().toString().padStart(3, '0')
|
||||||
const suffix = file.name.split('.').pop() || 'jpg'
|
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语句:清空文件内容,更新文件路径
|
// 构造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()
|
const formData = new FormData()
|
||||||
|
|||||||
@@ -957,6 +957,7 @@ export default {
|
|||||||
param[1] = ['数量', row.数量]
|
param[1] = ['数量', row.数量]
|
||||||
param[2] = ['工艺任务流水号', row.工艺任务流水号]
|
param[2] = ['工艺任务流水号', row.工艺任务流水号]
|
||||||
param[3] = ['退货人', this.id]
|
param[3] = ['退货人', this.id]
|
||||||
|
param[4] = ['订单流水号', row.订单流水号]
|
||||||
// 参数数量与名称要与存储过程对应
|
// 参数数量与名称要与存储过程对应
|
||||||
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_取消派工', param)
|
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_取消派工', param)
|
||||||
this.ExecDatabase(Data).then(response => {
|
this.ExecDatabase(Data).then(response => {
|
||||||
|
|||||||
@@ -37,9 +37,9 @@
|
|||||||
style="margin-left:10px"
|
style="margin-left:10px"
|
||||||
@click="pageCurrent=1;searchTable()">查询
|
@click="pageCurrent=1;searchTable()">查询
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- <el-button type="distribution" icon="el-icon-plus" size="small" style="margin-left:10px" @click="materialPlus">
|
<el-button v-if="Number(token)===2" type="distribution" icon="el-icon-plus" size="small" style="margin-left:10px" @click="materialPlus">
|
||||||
物料
|
物料
|
||||||
</el-button> -->
|
</el-button>
|
||||||
<el-badge :value="value" :max="99" class="item">
|
<el-badge :value="value" :max="99" class="item">
|
||||||
<el-button type="warning" plain size="small" style="margin-left:10px" @click="purchaseChangeRequest">
|
<el-button type="warning" plain size="small" style="margin-left:10px" @click="purchaseChangeRequest">
|
||||||
采购变更申请
|
采购变更申请
|
||||||
@@ -209,6 +209,7 @@
|
|||||||
style="margin-right: 10px"
|
style="margin-right: 10px"
|
||||||
@click="handleEdit(scope.row)"/>
|
@click="handleEdit(scope.row)"/>
|
||||||
<el-button
|
<el-button
|
||||||
|
:disabled="Number(token ) !== 2"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
size="mini"
|
size="mini"
|
||||||
@@ -324,6 +325,15 @@
|
|||||||
<el-form-item label="物料说明" prop="物料说明">
|
<el-form-item label="物料说明" prop="物料说明">
|
||||||
<el-input v-model="form.物料说明" style="width:250px;" placeholder="物料说明" size="small" clearable/>
|
<el-input v-model="form.物料说明" style="width:250px;" placeholder="物料说明" size="small" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="安全库存" prop="安全库存">
|
||||||
|
<el-input v-model="form.安全库存" style="width:250px;" placeholder="安全库存" size="small" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="最高库存" prop="最高库存">
|
||||||
|
<el-input v-model="form.最高库存" style="width:250px;" placeholder="最高库存" size="small" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="最低库存" prop="最低库存">
|
||||||
|
<el-input v-model="form.最低库存" style="width:250px;" placeholder="最低库存" size="small" clearable/>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button size="small" style="width: 76px" @click="callOff('form')">取消</el-button>
|
<el-button size="small" style="width: 76px" @click="callOff('form')">取消</el-button>
|
||||||
@@ -719,6 +729,9 @@ export default {
|
|||||||
类型: '',
|
类型: '',
|
||||||
物料库: '',
|
物料库: '',
|
||||||
物料说明: '',
|
物料说明: '',
|
||||||
|
安全库存: '',
|
||||||
|
最高库存: '',
|
||||||
|
最低库存: '',
|
||||||
原图号或型号: '',
|
原图号或型号: '',
|
||||||
原物料名称: ''
|
原物料名称: ''
|
||||||
},
|
},
|
||||||
@@ -1262,6 +1275,9 @@ export default {
|
|||||||
this.form.单位 = Number(row.单位流水号)
|
this.form.单位 = Number(row.单位流水号)
|
||||||
this.form.类型 = Number(row.类型)
|
this.form.类型 = Number(row.类型)
|
||||||
this.form.物料库 = Number(row.物料库流水号)
|
this.form.物料库 = Number(row.物料库流水号)
|
||||||
|
this.form.安全库存 = row.安全库存 || ''
|
||||||
|
this.form.最高库存 = row.最高库存 || ''
|
||||||
|
this.form.最低库存 = row.最低库存 || ''
|
||||||
this.materialValue = row.物料流水号
|
this.materialValue = row.物料流水号
|
||||||
this.dialogFormVisible = true
|
this.dialogFormVisible = true
|
||||||
},
|
},
|
||||||
@@ -1281,6 +1297,9 @@ export default {
|
|||||||
param1[8] = ['货位流水号', this.form.库位]
|
param1[8] = ['货位流水号', this.form.库位]
|
||||||
param1[9] = ['物料库流水号', this.form.物料库]
|
param1[9] = ['物料库流水号', this.form.物料库]
|
||||||
param1[10] = ['物料说明', this.form.物料说明]
|
param1[10] = ['物料说明', this.form.物料说明]
|
||||||
|
param1[11] = ['安全库存', this.form.安全库存]
|
||||||
|
param1[12] = ['最高库存', this.form.最高库存]
|
||||||
|
param1[13] = ['最低库存', this.form.最低库存]
|
||||||
var Data1 = this.CreateData('12', '物料管理_编辑', param1)
|
var Data1 = this.CreateData('12', '物料管理_编辑', param1)
|
||||||
this.ExecDatabase(Data1).then(response => {
|
this.ExecDatabase(Data1).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
if (response.data[0].result === '1') {
|
||||||
@@ -1310,6 +1329,9 @@ export default {
|
|||||||
param[7] = ['物料编码', this.form.物料编码]
|
param[7] = ['物料编码', this.form.物料编码]
|
||||||
param[8] = ['货位流水号', this.form.库位]
|
param[8] = ['货位流水号', this.form.库位]
|
||||||
param[9] = ['物料库流水号', this.form.物料库]
|
param[9] = ['物料库流水号', this.form.物料库]
|
||||||
|
param[10] = ['安全库存', this.form.安全库存]
|
||||||
|
param[11] = ['最高库存', this.form.最高库存]
|
||||||
|
param[12] = ['最低库存', this.form.最低库存]
|
||||||
var Data = this.CreateData('12', '物料管理_编辑', param)
|
var Data = this.CreateData('12', '物料管理_编辑', param)
|
||||||
this.ExecDatabase(Data).then(response => {
|
this.ExecDatabase(Data).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
if (response.data[0].result === '1') {
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ export default {
|
|||||||
// 查询一批待迁移的数据(只查询必要字段,不查询文件内容以节省内存)
|
// 查询一批待迁移的数据(只查询必要字段,不查询文件内容以节省内存)
|
||||||
const sql = `SELECT TOP ${this.config.batchSize} id, [${this.config.keyField}], 文件后缀
|
const sql = `SELECT TOP ${this.config.batchSize} id, [${this.config.keyField}], 文件后缀
|
||||||
FROM [dbo].[${this.config.tableName}] WITH(NOLOCK)
|
FROM [dbo].[${this.config.tableName}] WITH(NOLOCK)
|
||||||
WHERE 文件路径 IS NULL
|
WHERE 文件路径 IS NULL AND id > ${this.currentOffset}
|
||||||
ORDER BY id`
|
ORDER BY id`
|
||||||
const Data = this.CreateData('3', sql)
|
const Data = this.CreateData('3', sql)
|
||||||
const response = await this.ExecDatabase(Data)
|
const response = await this.ExecDatabase(Data)
|
||||||
@@ -247,6 +247,7 @@ export default {
|
|||||||
// 逐条处理
|
// 逐条处理
|
||||||
for (const record of records) {
|
for (const record of records) {
|
||||||
if (this.stopFlag) break
|
if (this.stopFlag) break
|
||||||
|
this.currentOffset = Math.max(this.currentOffset, record.id)
|
||||||
await this.migrateOne(record)
|
await this.migrateOne(record)
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -285,7 +286,7 @@ export default {
|
|||||||
now.getSeconds().toString().padStart(2, '0') +
|
now.getSeconds().toString().padStart(2, '0') +
|
||||||
now.getMilliseconds().toString().padStart(3, '0')
|
now.getMilliseconds().toString().padStart(3, '0')
|
||||||
|
|
||||||
const savePath = this.config.basePath + '\\\\' + this.config.moduleName + '\\\\' + timestamp + '-' + keyValue + '.' + suffix
|
const savePath = this.config.basePath + '\\\\' + this.config.moduleName + '\\\\' + timestamp + '-' + keyValue + '-' + id + '.' + suffix
|
||||||
|
|
||||||
// 3. 将base64转为Blob
|
// 3. 将base64转为Blob
|
||||||
const byteCharacters = atob(fileContent)
|
const byteCharacters = atob(fileContent)
|
||||||
@@ -297,7 +298,7 @@ export default {
|
|||||||
const blob = new Blob([byteArray], { type: 'image/' + suffix })
|
const blob = new Blob([byteArray], { type: 'image/' + suffix })
|
||||||
|
|
||||||
// 4. 构造SQL语句(只更新路径,不清空内容)
|
// 4. 构造SQL语句(只更新路径,不清空内容)
|
||||||
const updateSql = `UPDATE [dbo].[${this.config.tableName}] SET 文件路径 = N'${savePath}' WHERE id = ${id}`
|
const updateSql = `UPDATE [dbo].[${this.config.tableName}] SET 文件路径 = N'${savePath}' WHERE id = ${id}; IF @@ROWCOUNT <> 1 RAISERROR(N'图片路径回填失败', 16, 1)`
|
||||||
|
|
||||||
// 5. 调用接口保存文件
|
// 5. 调用接口保存文件
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
v-model="PartType"
|
v-model="PartType"
|
||||||
type="border-card"
|
type="border-card"
|
||||||
style="height: 850px;padding: 0"
|
style="height: 850px;padding: 0"
|
||||||
@tab-click="pageCurrent=1;pageCurrent1=1;getData()">
|
@tab-click="pageCurrent=1;pageCurrent1=1">
|
||||||
<el-tab-pane label="采购入库" name="采购入库">
|
<el-tab-pane label="采购入库" name="采购入库">
|
||||||
<div style="margin-top: 7px; margin-bottom: 7px">
|
<div style="margin-top: 7px; margin-bottom: 7px">
|
||||||
<el-select
|
<el-select
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
size="small"
|
size="small"
|
||||||
filterable
|
filterable
|
||||||
clearable
|
clearable
|
||||||
@change="getContractState();searchTable1();onChangeSupplierSelection();">
|
@change="handleSupplierChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in supplierSelection"
|
v-for="item in supplierSelection"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
size="small"
|
size="small"
|
||||||
@click="submitInStorage">入库
|
@click="submitInStorage">入库
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-badge :value="tableDataRKD ? tableDataRKD.length : 0" class="item">
|
<el-badge :value="tableDataRKDMerged ? tableDataRKDMerged.length : 0" class="item">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-s-home"
|
icon="el-icon-s-home"
|
||||||
@@ -54,6 +54,14 @@
|
|||||||
@click="showRKDDialog">入库单
|
@click="showRKDDialog">入库单
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-badge>
|
</el-badge>
|
||||||
|
<!-- <el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-check"
|
||||||
|
style="margin-left: 10px"
|
||||||
|
plain
|
||||||
|
size="small"
|
||||||
|
@click="selectInStockableRows">勾选当前页可入库项
|
||||||
|
</el-button> -->
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-printer"
|
icon="el-icon-printer"
|
||||||
@@ -68,8 +76,6 @@
|
|||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
ref="table"
|
ref="table"
|
||||||
:data="tableData1"
|
:data="tableData1"
|
||||||
:summary-method="getSummaries"
|
|
||||||
show-summary
|
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
border
|
border
|
||||||
stripe
|
stripe
|
||||||
@@ -113,9 +119,16 @@
|
|||||||
{{ scope.row.备注 }}
|
{{ scope.row.备注 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column width="90px" label="库位" align="center">
|
<el-table-column width="120px" label="库位" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.货位名称 }}
|
<el-select v-if="scope.row._editing" v-model="scope.row.货位流水号" style="width:100%" placeholder="选择库位" size="mini" filterable clearable @change="onLocateChange(scope.row)">
|
||||||
|
<el-option
|
||||||
|
v-for="item in locateName"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"/>
|
||||||
|
</el-select>
|
||||||
|
<span v-else>{{ scope.row.货位名称 }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :width="setColumnWidth('数量')" label="采购数" prop="采购数" align="center">
|
<el-table-column :width="setColumnWidth('数量')" label="采购数" prop="采购数" align="center">
|
||||||
@@ -150,6 +163,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column width="80px" label="操作" align="center" show-overflow-tooltip>
|
<el-table-column width="80px" label="操作" align="center" show-overflow-tooltip>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" size="small" @click="toggleRowEdit(scope.row)">{{ scope.row._editing ? '完成' : '编辑' }}</el-button>
|
||||||
<el-button type="text" icon="el-icon-printer" size="small" @click="Pronter(scope.row)"/>
|
<el-button type="text" icon="el-icon-printer" size="small" @click="Pronter(scope.row)"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -271,9 +285,7 @@
|
|||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
ref="table2"
|
ref="table2"
|
||||||
:data="tableData3"
|
:data="tableData3"
|
||||||
:summary-method="getSummaries1"
|
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
show-summary
|
|
||||||
border
|
border
|
||||||
stripe
|
stripe
|
||||||
size="small"
|
size="small"
|
||||||
@@ -313,9 +325,16 @@
|
|||||||
{{ scope.row.零件图号 }}
|
{{ scope.row.零件图号 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column width="70px" label="库位" align="center" show-overflow-tooltip>
|
<el-table-column width="120px" label="库位" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.货位名称 }}
|
<el-select v-if="scope.row._editing" v-model="scope.row.货位流水号" style="width:100%" placeholder="选择库位" size="mini" filterable clearable @change="onLocateChange(scope.row)">
|
||||||
|
<el-option
|
||||||
|
v-for="item in locateName"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"/>
|
||||||
|
</el-select>
|
||||||
|
<span v-else>{{ scope.row.货位名称 }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@@ -383,8 +402,9 @@
|
|||||||
<el-input-number v-model="scope.row.打印条码数" :min="1" size="mini" style="margin: 0;width: 100%"/>
|
<el-input-number v-model="scope.row.打印条码数" :min="1" size="mini" style="margin: 0;width: 100%"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column width="72px" label="操作" align="center">
|
<el-table-column width="100px" label="操作" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" size="small" @click="toggleRowEdit(scope.row)">{{ scope.row._editing ? '完成' : '编辑' }}</el-button>
|
||||||
<el-button type="text" icon="el-icon-printer" size="small" @click="Pronter1(scope.row)"/>
|
<el-button type="text" icon="el-icon-printer" size="small" @click="Pronter1(scope.row)"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -443,8 +463,6 @@
|
|||||||
<div>
|
<div>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData30"
|
:data="tableData30"
|
||||||
:summary-method="getSummaries2"
|
|
||||||
show-summary
|
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
border
|
border
|
||||||
stripe
|
stripe
|
||||||
@@ -526,7 +544,7 @@
|
|||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisibleRKD" title="入库单" center width="700px">
|
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisibleRKD" title="入库单" center width="700px">
|
||||||
<el-table :data="tableDataRKD" border stripe size="small" height="400px">
|
<el-table :data="tableDataRKDMerged" border stripe size="small" height="400px">
|
||||||
<el-table-column prop="入库单号" label="入库单号" align="center" show-overflow-tooltip/>
|
<el-table-column prop="入库单号" label="入库单号" align="center" show-overflow-tooltip/>
|
||||||
<el-table-column prop="采购合同号" label="采购合同" align="center" show-overflow-tooltip/>
|
<el-table-column prop="采购合同号" label="采购合同" align="center" show-overflow-tooltip/>
|
||||||
<el-table-column prop="供应商名称" label="供应商" align="center" show-overflow-tooltip/>
|
<el-table-column prop="供应商名称" label="供应商" align="center" show-overflow-tooltip/>
|
||||||
@@ -706,7 +724,22 @@ export default {
|
|||||||
...mapGetters([
|
...mapGetters([
|
||||||
'id',
|
'id',
|
||||||
'token'
|
'token'
|
||||||
])
|
]),
|
||||||
|
tableDataRKDMerged() {
|
||||||
|
var map = {}
|
||||||
|
var result = []
|
||||||
|
for (var i = 0; i < this.tableDataRKD.length; i++) {
|
||||||
|
var row = this.tableDataRKD[i]
|
||||||
|
var key = row.入库单号
|
||||||
|
if (map[key] !== undefined) {
|
||||||
|
result[map[key]].到货数 = Number(result[map[key]].到货数 || 0) + Number(row.到货数 || 0)
|
||||||
|
} else {
|
||||||
|
map[key] = result.length
|
||||||
|
result.push(Object.assign({}, row, { 到货数: Number(row.到货数 || 0) }))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
},
|
},
|
||||||
updated() {
|
updated() {
|
||||||
if (this.$refs['']) {
|
if (this.$refs['']) {
|
||||||
@@ -735,18 +768,39 @@ export default {
|
|||||||
this.tableDataRKD = response.data.filter(item => item.是否入库 === 0 || item.是否入库 === false)
|
this.tableDataRKD = response.data.filter(item => item.是否入库 === 0 || item.是否入库 === false)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handleSupplierChange() {
|
||||||
|
this.contractStateValue = ''
|
||||||
|
this.contractNumber = ''
|
||||||
|
this.contractState = []
|
||||||
|
if (!this.supplierSelectionValue) {
|
||||||
|
this.supplierSelectionName = ''
|
||||||
|
this.tableData1 = []
|
||||||
|
this.multipleSelection = []
|
||||||
|
this.returns = []
|
||||||
|
this.totalAmount = ''
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.table) {
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.getContractState()
|
||||||
|
this.searchTable1()
|
||||||
|
this.onChangeSupplierSelection()
|
||||||
|
},
|
||||||
onChangeSupplierSelection() {
|
onChangeSupplierSelection() {
|
||||||
let obj = {}
|
let obj = {}
|
||||||
obj = this.supplierSelection.find((item) => {
|
obj = this.supplierSelection.find((item) => {
|
||||||
return item.value === this.supplierSelectionValue
|
return item.value === this.supplierSelectionValue
|
||||||
})
|
})
|
||||||
this.supplierSelectionName = obj.label
|
this.supplierSelectionName = obj ? obj.label : ''
|
||||||
},
|
},
|
||||||
showRKDDialog() {
|
showRKDDialog() {
|
||||||
var param = []
|
var param = []
|
||||||
var Data = this.CreateData('11', '仓储管理_入库单_查询', param)
|
var Data = this.CreateData('11', '仓储管理_入库单_查询', param)
|
||||||
this.ExecDatabase(Data).then(response => {
|
this.ExecDatabase(Data).then(response => {
|
||||||
this.tableDataRKD = response.data.filter(item => item.是否入库 === 0 || item.是否入库 === false)
|
this.tableDataRKD = response.data.filter(item => item.是否入库 === 0 || item.是否入库 === false )
|
||||||
this.dialogFormVisibleRKD = true
|
this.dialogFormVisibleRKD = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -998,11 +1052,17 @@ export default {
|
|||||||
for (let i = 0; i < response.data.length; i++) {
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
this.locateName.push({
|
this.locateName.push({
|
||||||
label: response.data[i].货位名称,
|
label: response.data[i].货位名称,
|
||||||
value: response.data[i].货位流水号
|
value: String(response.data[i].货位流水号)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
onLocateChange(row) {
|
||||||
|
var obj = this.locateName.find(function(item) {
|
||||||
|
return item.value === row.货位流水号
|
||||||
|
})
|
||||||
|
row.货位名称 = obj ? obj.label : ''
|
||||||
|
},
|
||||||
getData() {
|
getData() {
|
||||||
if (this.PartType === '采购入库') {
|
if (this.PartType === '采购入库') {
|
||||||
this.searchTable1()
|
this.searchTable1()
|
||||||
@@ -1027,6 +1087,18 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
searchTable1() {
|
searchTable1() {
|
||||||
|
if (!this.supplierSelectionValue) {
|
||||||
|
this.tableData1 = []
|
||||||
|
this.multipleSelection = []
|
||||||
|
this.returns = []
|
||||||
|
this.totalAmount = ''
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.table) {
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
for (let i = 0; i < this.contractState.length; i++) {
|
for (let i = 0; i < this.contractState.length; i++) {
|
||||||
if (this.contractStateValue === this.contractState[i].value) {
|
if (this.contractStateValue === this.contractState[i].value) {
|
||||||
this.contractNumber = this.contractState[i].label
|
this.contractNumber = this.contractState[i].label
|
||||||
@@ -1042,23 +1114,35 @@ export default {
|
|||||||
this.ExecDatabase(Data).then(response => {
|
this.ExecDatabase(Data).then(response => {
|
||||||
this.tableData1 = response.data
|
this.tableData1 = response.data
|
||||||
console.log('采购件入库', response.data)
|
console.log('采购件入库', response.data)
|
||||||
|
for (let i = 0; i < this.tableData1.length; i++) {
|
||||||
|
var row = this.tableData1[i]
|
||||||
|
if (row.货位流水号 !== null && row.货位流水号 !== undefined && row.货位流水号 !== '') {
|
||||||
|
row.货位流水号 = String(row.货位流水号)
|
||||||
|
}
|
||||||
|
this.$set(row, '_editing', false)
|
||||||
|
}
|
||||||
if (this.tableData1.length === 0) {
|
if (this.tableData1.length === 0) {
|
||||||
this.getContractState()
|
|
||||||
this.getSummaries()
|
this.getSummaries()
|
||||||
} else {
|
|
||||||
this.$nextTick(function() {
|
|
||||||
this.tableData1.forEach(function(row) {
|
|
||||||
if (Number(row.等待入库数量) > 0) {
|
|
||||||
this.$refs.table.toggleRowSelection(row, true)
|
|
||||||
}
|
|
||||||
}.bind(this))
|
|
||||||
}.bind(this))
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
selectable(row) {
|
selectable(row) {
|
||||||
return (Number(row.采购数) !== Number(row.已到数)) && Number(row.本次到货数) !== 0
|
return (Number(row.采购数) !== Number(row.已到数)) && Number(row.本次到货数) !== 0
|
||||||
},
|
},
|
||||||
|
selectInStockableRows() {
|
||||||
|
if (!this.$refs.table) return
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
this.$nextTick(function() {
|
||||||
|
this.tableData1.forEach(function(row) {
|
||||||
|
if ((Number(row.采购数) !== Number(row.已到数)) && Number(row.本次到货数) !== 0) {
|
||||||
|
this.$refs.table.toggleRowSelection(row, true)
|
||||||
|
}
|
||||||
|
}.bind(this))
|
||||||
|
}.bind(this))
|
||||||
|
},
|
||||||
|
toggleRowEdit(row) {
|
||||||
|
this.$set(row, '_editing', !row._editing)
|
||||||
|
},
|
||||||
submitInStorage() {
|
submitInStorage() {
|
||||||
// this.exportTable()
|
// this.exportTable()
|
||||||
if (!this.multipleSelection || this.multipleSelection.length === 0) {
|
if (!this.multipleSelection || this.multipleSelection.length === 0) {
|
||||||
@@ -1087,7 +1171,7 @@ export default {
|
|||||||
this.multipleSelection_variable = this.multipleSelection
|
this.multipleSelection_variable = this.multipleSelection
|
||||||
this.multipleSelection = []
|
this.multipleSelection = []
|
||||||
for (let i = 0; i < this.multipleSelection_variable.length; i++) {
|
for (let i = 0; i < this.multipleSelection_variable.length; i++) {
|
||||||
if (this.multipleSelection_variable[i].货位流水号 === 0) {
|
if (!this.multipleSelection_variable[i].货位流水号 && this.multipleSelection_variable[i].货位流水号 !== 0) {
|
||||||
this.$message.warning('存在未绑定货位的物料')
|
this.$message.warning('存在未绑定货位的物料')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -1196,6 +1280,13 @@ export default {
|
|||||||
this.ExecDatabase(Data).then(response => {
|
this.ExecDatabase(Data).then(response => {
|
||||||
this.tableData3 = response.data.rows
|
this.tableData3 = response.data.rows
|
||||||
this.total1 = response.data.total
|
this.total1 = response.data.total
|
||||||
|
for (let i = 0; i < this.tableData3.length; i++) {
|
||||||
|
var row = this.tableData3[i]
|
||||||
|
if (row.货位流水号 !== null && row.货位流水号 !== undefined && row.货位流水号 !== '') {
|
||||||
|
row.货位流水号 = String(row.货位流水号)
|
||||||
|
}
|
||||||
|
this.$set(row, '_editing', false)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
selectable2(row) {
|
selectable2(row) {
|
||||||
@@ -1216,7 +1307,7 @@ export default {
|
|||||||
this.multipleSelection_variable2 = this.multipleSelection2
|
this.multipleSelection_variable2 = this.multipleSelection2
|
||||||
this.multipleSelection2 = []
|
this.multipleSelection2 = []
|
||||||
for (let i = 0; i < this.multipleSelection_variable2.length; i++) {
|
for (let i = 0; i < this.multipleSelection_variable2.length; i++) {
|
||||||
if (this.multipleSelection_variable2[i].货位流水号 === 0) {
|
if (!this.multipleSelection_variable2[i].货位流水号 && this.multipleSelection_variable2[i].货位流水号 !== 0) {
|
||||||
this.$message.warning('存在未绑定货位的物料')
|
this.$message.warning('存在未绑定货位的物料')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,34 +67,62 @@
|
|||||||
<h3 style="margin: 0">{{ currentDetail }}详情</h3>
|
<h3 style="margin: 0">{{ currentDetail }}详情</h3>
|
||||||
<el-button v-if="currentDetail === '生产中'" type="primary" size="mini" style="margin-left: 15px" @click="exportProductionDetail">导出</el-button>
|
<el-button v-if="currentDetail === '生产中'" type="primary" size="mini" style="margin-left: 15px" @click="exportProductionDetail">导出</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
<div style="display: flex; gap: 15px;">
|
||||||
v-loading="loading"
|
<el-table
|
||||||
:data="detailData"
|
v-loading="loading"
|
||||||
highlight-current-row
|
:data="detailData"
|
||||||
border
|
highlight-current-row
|
||||||
stripe
|
border
|
||||||
size="small"
|
stripe
|
||||||
style="width: 100%"
|
size="small"
|
||||||
height="400">
|
:style="currentDetail === '待入库' ? 'width: 50%' : 'width: 100%'"
|
||||||
<el-table-column
|
height="400"
|
||||||
v-for="(column, index) in detailColumns"
|
@row-click="handlePendingInStorageRowClick">
|
||||||
:key="index"
|
<el-table-column
|
||||||
:width="column.width"
|
v-for="(column, index) in detailColumns"
|
||||||
:label="column.label"
|
:key="index"
|
||||||
:align="column.align">
|
:width="column.width"
|
||||||
<template slot-scope="scope">
|
:label="column.label"
|
||||||
<span v-if="column.prop === '期限状态'" :class="getDeadlineStatusClass(scope.row.期限状态)">
|
:align="column.align">
|
||||||
{{ scope.row.期限状态 }}
|
<template slot-scope="scope">
|
||||||
</span>
|
<span v-if="column.prop === '入库单号'" class="link-text" @click.stop="handlePendingInStorageRowClick(scope.row)">
|
||||||
<span v-else-if="column.prop === '超期时间' && scope.row.期限状态 === '超期'" class="text-danger">
|
{{ scope.row[column.prop] }}
|
||||||
{{ scope.row[column.prop] }}
|
</span>
|
||||||
</span>
|
<span v-else-if="column.prop === '期限状态'" :class="getDeadlineStatusClass(scope.row.期限状态)">
|
||||||
<span v-else>
|
{{ scope.row.期限状态 }}
|
||||||
{{ scope.row[column.prop] }}
|
</span>
|
||||||
</span>
|
<span v-else-if="column.prop === '超期时间' && scope.row.期限状态 === '超期'" class="text-danger">
|
||||||
|
{{ scope.row[column.prop] }}
|
||||||
|
</span>
|
||||||
|
<span v-else>
|
||||||
|
{{ scope.row[column.prop] }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-table
|
||||||
|
v-if="currentDetail === '待入库' && 选中的入库单号"
|
||||||
|
:data="待入库子表格数据"
|
||||||
|
border
|
||||||
|
stripe
|
||||||
|
size="small"
|
||||||
|
style="width: 50%"
|
||||||
|
height="400">
|
||||||
|
<template slot="empty">
|
||||||
|
<span>暂无数据</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
<el-table-column
|
||||||
</el-table>
|
v-for="(column, index) in 待入库子表格列"
|
||||||
|
:key="index"
|
||||||
|
:width="column.width"
|
||||||
|
:label="column.label"
|
||||||
|
:align="column.align">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row[column.prop] }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
@@ -131,7 +159,11 @@ export default {
|
|||||||
},
|
},
|
||||||
生产中期限筛选: null,
|
生产中期限筛选: null,
|
||||||
生产中全部数据: [],
|
生产中全部数据: [],
|
||||||
领料单数: 0
|
领料单数: 0,
|
||||||
|
待入库全部数据: [],
|
||||||
|
选中的入库单号: '',
|
||||||
|
待入库子表格数据: [],
|
||||||
|
待入库子表格列: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -228,13 +260,16 @@ export default {
|
|||||||
var param = []
|
var param = []
|
||||||
var Data = this.CreateData('11', '仓储管理_入库单_查询', param)
|
var Data = this.CreateData('11', '仓储管理_入库单_查询', param)
|
||||||
this.ExecDatabase(Data).then(response => {
|
this.ExecDatabase(Data).then(response => {
|
||||||
let count = 0
|
var filtered = response.data.filter(item => item.是否入库 === false)
|
||||||
response.data.forEach(item => {
|
// 按入库单号整合,同一单号只计一次
|
||||||
if (item.是否入库 === false) {
|
var map = {}
|
||||||
count++
|
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.currentDetail = type
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.生产中期限筛选 = null
|
this.生产中期限筛选 = null
|
||||||
|
this.选中的入库单号 = ''
|
||||||
|
this.待入库子表格数据 = []
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case '待入库':
|
case '待入库':
|
||||||
@@ -423,7 +460,26 @@ export default {
|
|||||||
var param = []
|
var param = []
|
||||||
var Data = this.CreateData('11', '仓储管理_入库单_查询', param)
|
var Data = this.CreateData('11', '仓储管理_入库单_查询', param)
|
||||||
this.ExecDatabase(Data).then(response => {
|
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 = [
|
this.detailColumns = [
|
||||||
{ prop: '入库单号', label: '入库单号', width: '150px', align: 'center' },
|
{ prop: '入库单号', label: '入库单号', width: '150px', align: 'center' },
|
||||||
{ prop: '采购合同号', label: '采购合同号', width: '100px', 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() {
|
getPendingOutStorageDetail() {
|
||||||
var param = []
|
var param = []
|
||||||
@@ -712,6 +783,16 @@ export default {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.link-text {
|
||||||
|
color: #409eff;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-text:hover {
|
||||||
|
color: #66b1ff;
|
||||||
|
}
|
||||||
|
|
||||||
.summary-card {
|
.summary-card {
|
||||||
height: 100px;
|
height: 100px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Reference in New Issue
Block a user