|
|
|
@ -183,6 +183,7 @@ |
|
|
|
border |
|
|
|
:row-class-name="tableRowClassName" |
|
|
|
v-loading="dataListLoading" |
|
|
|
@row-dblclick="handleMaterialRowDblClick" |
|
|
|
style="width: 100%; "> |
|
|
|
|
|
|
|
<!-- <el-table-column--> |
|
|
|
@ -374,6 +375,62 @@ |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 编辑材料明细对话框 --> |
|
|
|
<el-dialog title="编辑材料明细" :close-on-click-modal="false" v-drag :visible.sync="editMaterialModalFlag" width="600px"> |
|
|
|
<el-form :inline="true" label-position="top" label-width="120px" style="margin-top: 20px;"> |
|
|
|
<el-row> |
|
|
|
<el-col span="8"> |
|
|
|
<el-form-item label="申请单序号"> |
|
|
|
<el-input v-model="editMaterialData.itemNo" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col span="8"> |
|
|
|
<el-form-item label="材料编码"> |
|
|
|
<el-input v-model="editMaterialData.componentPartNo" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col span="8"> |
|
|
|
<el-form-item label="生产订单"> |
|
|
|
<el-input v-model="editMaterialData.soorderNo" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col span="8"> |
|
|
|
<el-form-item label="需求时间"> |
|
|
|
<el-input v-model="editMaterialData.needDate" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col span="8"> |
|
|
|
<el-form-item label="申请数量" required> |
|
|
|
<el-input |
|
|
|
v-model="editMaterialData.qtyToIssue" |
|
|
|
:min="0" |
|
|
|
style="width: 98%;" |
|
|
|
@input="value => editMaterialData.qtyToIssue = value |
|
|
|
.replace(/[^\d.]/g, '') |
|
|
|
.replace(/\.{2,}/g, '.') |
|
|
|
.replace(/^\./, '0.') |
|
|
|
.replace(/(\.\d{4}).*/, '$1') |
|
|
|
.replace(/^0+(?=\d)/, '0') |
|
|
|
.replace(/^0+(?=\.)/, '0')" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col span="8"> |
|
|
|
<el-form-item label="类型"> |
|
|
|
<el-input v-model="editMaterialData.issueType" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|
|
|
<el-button type="primary" @click="saveEditMaterialDetail()">保存</el-button> |
|
|
|
<el-button type="primary" @click="editMaterialModalFlag=false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 库存预览模态框 --> |
|
|
|
<el-dialog |
|
|
|
title="库存匹配预览" |
|
|
|
@ -485,6 +542,7 @@ |
|
|
|
, getSOSBOMForIssureNew |
|
|
|
, saveMaterialDetail |
|
|
|
, searchMaterialListDetail |
|
|
|
, updateMaterialDetail |
|
|
|
|
|
|
|
} from "@/api/orderIssure/soIssueNotify.js" |
|
|
|
|
|
|
|
@ -935,7 +993,7 @@ |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 80 |
|
|
|
},{ |
|
|
|
},/* { |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 701002, |
|
|
|
serialNumber: '701002Table3QtyToIssueOriginal', |
|
|
|
@ -952,7 +1010,7 @@ |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 80 |
|
|
|
},{ |
|
|
|
}, */{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 701002, |
|
|
|
serialNumber: '701002Table3IssueType', |
|
|
|
@ -1314,6 +1372,21 @@ |
|
|
|
partNo: '', |
|
|
|
}, |
|
|
|
bomLoadFlag: false, |
|
|
|
// 编辑材料明细对话框相关数据 |
|
|
|
editMaterialModalFlag: false, |
|
|
|
editMaterialData: { |
|
|
|
itemNo: '', |
|
|
|
componentPartNo: '', |
|
|
|
isInWh: '', |
|
|
|
needDate: '', |
|
|
|
qtyToIssue: 0, |
|
|
|
issueType: '', |
|
|
|
remark: '', |
|
|
|
soorderNo: '', |
|
|
|
bomitemNo: '', |
|
|
|
site: '', |
|
|
|
notifyNo: '', |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
@ -1810,6 +1883,64 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 处理材料明细行双击事件 |
|
|
|
handleMaterialRowDblClick(row) { |
|
|
|
|
|
|
|
if(!'未推送'.includes(this.currentRow.pushWcsFlag)){ |
|
|
|
this.$message.warning('只有未推送状态的申请单才能编辑材料明细') |
|
|
|
return; |
|
|
|
} |
|
|
|
// 保存完整的行数据,以便后续保存时包含所有必要字段 |
|
|
|
this.editMaterialData = JSON.parse(JSON.stringify(row)) |
|
|
|
// 确保包含必要的字段 |
|
|
|
this.editMaterialData.site = this.currentRow.site || this.$store.state.user.site |
|
|
|
this.editMaterialData.notifyNo = this.currentRow.notifyNo || '' |
|
|
|
// 确保申请数量有默认值 |
|
|
|
if (this.editMaterialData.qtyToIssue === null || this.editMaterialData.qtyToIssue === undefined) { |
|
|
|
this.editMaterialData.qtyToIssue = 0 |
|
|
|
} |
|
|
|
this.editMaterialModalFlag = true |
|
|
|
}, |
|
|
|
// 保存编辑的材料明细 |
|
|
|
saveEditMaterialDetail() { |
|
|
|
if (this.editMaterialData.qtyToIssue === null || this.editMaterialData.qtyToIssue === '') { |
|
|
|
this.$alert('申请数量不能为空!', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
if (this.editMaterialData.qtyToIssue < 0) { |
|
|
|
this.$alert('申请数量不能小于0!', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
// 使用完整的行数据,只更新申请数量 |
|
|
|
let materialData = { |
|
|
|
...this.editMaterialData, |
|
|
|
} |
|
|
|
|
|
|
|
// 确保申请数量不为空 |
|
|
|
if (materialData.qtyToIssue === '' || materialData.qtyToIssue == null) { |
|
|
|
materialData.qtyToIssue = 0 |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
updateMaterialDetail(materialData).then(({ data }) => { |
|
|
|
if (data.code === 0) { |
|
|
|
this.editMaterialModalFlag = false |
|
|
|
this.refreshCurrentTabTable() |
|
|
|
this.$message.success('保存成功') |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$message.error('保存失败') |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|