Browse Source

RFQ 批量修改里点保存没有执行计算

java8
han\hanst 2 months ago
parent
commit
cabf54c863
  1. 56
      src/views/modules/part/bom_create.vue
  2. 4
      src/views/modules/part/quicklyCreateBom.vue

56
src/views/modules/part/bom_create.vue

@ -389,7 +389,7 @@
<!-- 可选物料 --> <!-- 可选物料 -->
<div style="flex: 1; padding: 1px;"> <div style="flex: 1; padding: 1px;">
<span style="font-size: 12px">可选物料</span> <span style="font-size: 12px">可选物料</span>
<div style="height: 400px; overflow: auto">
<div style="height: 260px; overflow: auto">
<el-table <el-table
:data="batchComponentPartList" :data="batchComponentPartList"
border border
@ -430,6 +430,7 @@
<el-table <el-table
:data="choosePartList" :data="choosePartList"
border border
height="260px"
ref="batchSaveTable2" ref="batchSaveTable2"
@row-dblclick="batchDeletePartDB" @row-dblclick="batchDeletePartDB"
@selection-change="selectionSaveComponent2" @selection-change="selectionSaveComponent2"
@ -668,7 +669,7 @@
</el-table> </el-table>
</div> </div>
<el-footer style="height:40px;margin-top: 20px;text-align:center"> <el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="batchUpdateComponentsSave">保存</el-button>
<el-button type="primary" :loading="batchUpdateSaveLoading" @click="batchUpdateComponentsSave">保存</el-button>
<el-button type="primary" @click="batchUpdateComponentsFlag=false">关闭</el-button> <el-button type="primary" @click="batchUpdateComponentsFlag=false">关闭</el-button>
</el-footer> </el-footer>
</el-dialog> </el-dialog>
@ -2525,6 +2526,7 @@ export default {
saveDetailLoading: false, saveDetailLoading: false,
computeLoading: false, computeLoading: false,
copyBomQueryLoading: false, copyBomQueryLoading: false,
batchUpdateSaveLoading: false,
// //
modalFlag: false, modalFlag: false,
modalDisableFlag: false, modalDisableFlag: false,
@ -3131,6 +3133,22 @@ export default {
// //
packageSaveData () { packageSaveData () {
//
const hasEmptyQty = this.subDetailList.some(item =>
item.qtyPerAssembly === null ||
item.qtyPerAssembly === '' ||
item.qtyPerAssembly === undefined
)
if (hasEmptyQty) {
this.$alert('单位用量不允许为空,请填写完整后再保存!', '验证失败', {
confirmButtonText: '确定',
type: 'warning'
})
return
}
//
const allAHasValue = this.subDetailList.every(item => item.operationId !== null && item.operationId !== '') const allAHasValue = this.subDetailList.every(item => item.operationId !== null && item.operationId !== '')
if (!allAHasValue) { if (!allAHasValue) {
this.$confirm(`存在未选择工序的子物料,是否确认保存数据?`, '提示', { this.$confirm(`存在未选择工序的子物料,是否确认保存数据?`, '提示', {
@ -3895,8 +3913,15 @@ export default {
}, },
async batchUpdateComponentsSave() { async batchUpdateComponentsSave() {
// loading
this.batchUpdateSaveLoading = true
let flag = true let flag = true
for (let i = 0; i < this.subDetailList.length; i++) {
//
const listLength = this.subDetailList.length
for (let i = 0; i < listLength; i++) {
//
let row = this.subDetailList[i] let row = this.subDetailList[i]
this.componentData = { this.componentData = {
flag: '2', flag: '2',
@ -3943,64 +3968,85 @@ export default {
} }
if (this.componentData.lineSequence === '' || this.componentData.lineSequence == null) { if (this.componentData.lineSequence === '' || this.componentData.lineSequence == null) {
this.$message.warning('序号不能为空!') this.$message.warning('序号不能为空!')
this.batchUpdateSaveLoading = false
return return
} }
if (this.componentData.partNo === '' || this.componentData.partNo == null) { if (this.componentData.partNo === '' || this.componentData.partNo == null) {
this.$message.warning('请选择主记录物料编码!') this.$message.warning('请选择主记录物料编码!')
this.batchUpdateSaveLoading = false
return return
} }
if (this.componentData.bomType === '' || this.componentData.bomType == null) { if (this.componentData.bomType === '' || this.componentData.bomType == null) {
this.$message.warning('请选择主记录制造类型!') this.$message.warning('请选择主记录制造类型!')
this.batchUpdateSaveLoading = false
return return
} }
if (this.componentData.engChgLevel === '' || this.componentData.engChgLevel == null) { if (this.componentData.engChgLevel === '' || this.componentData.engChgLevel == null) {
this.$message.warning('请填写主记录BOM版本号!') this.$message.warning('请填写主记录BOM版本号!')
this.batchUpdateSaveLoading = false
return return
} }
if (this.componentData.componentPart === '' || this.componentData.componentPart == null) { if (this.componentData.componentPart === '' || this.componentData.componentPart == null) {
this.$message.warning('请选择子物料编码!') this.$message.warning('请选择子物料编码!')
this.batchUpdateSaveLoading = false
return return
} }
if (this.componentData.productFlag === 'component' && (this.componentData.consumptionItem === '' || this.componentData.consumptionItem == null)) { if (this.componentData.productFlag === 'component' && (this.componentData.consumptionItem === '' || this.componentData.consumptionItem == null)) {
this.$message.warning('请选择消耗项目!') this.$message.warning('请选择消耗项目!')
this.batchUpdateSaveLoading = false
return return
} }
if (this.componentData.componentScrap === '' || this.componentData.componentScrap == null) { if (this.componentData.componentScrap === '' || this.componentData.componentScrap == null) {
this.$message.warning('请填写调机量!') this.$message.warning('请填写调机量!')
this.batchUpdateSaveLoading = false
return return
} }
if (this.componentData.shrinkageFactor === '' || this.componentData.shrinkageFactor == null) { if (this.componentData.shrinkageFactor === '' || this.componentData.shrinkageFactor == null) {
this.$message.warning('请填写损耗率!') this.$message.warning('请填写损耗率!')
this.batchUpdateSaveLoading = false
return return
} }
if (this.componentData.issueType === '' || this.componentData.issueType == null) { if (this.componentData.issueType === '' || this.componentData.issueType == null) {
this.$message.warning('请选择生产属性!') this.$message.warning('请选择生产属性!')
this.batchUpdateSaveLoading = false
return return
} }
try { try {
const {data} = await computeQtyPerAssemblyEdit(this.componentData) const {data} = await computeQtyPerAssemblyEdit(this.componentData)
if (data && data.code !== 0) {
if (data && data.code === 0) {
//
this.subDetailList = data.rows.subDetailList
} else if (data && data.code !== 0) {
flag = false flag = false
this.batchUpdateSaveLoading = false
this.$alert('第'+(i+1)+'行'+data.msg, '错误', { this.$alert('第'+(i+1)+'行'+data.msg, '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
break
} }
} catch (error) { } catch (error) {
flag = false flag = false
this.batchUpdateSaveLoading = false
this.$alert('第'+(i+1)+'行请求失败', '错误', { this.$alert('第'+(i+1)+'行请求失败', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
break
} }
} }
// loading
this.batchUpdateSaveLoading = false
if(flag) { if(flag) {
this.$message({ this.$message({
message: '操作成功',
message: '批量修改并计算完成',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => {} onClose: () => {}
}) })
this.batchUpdateComponentsFlag = false this.batchUpdateComponentsFlag = false
//
this.$forceUpdate()
} }
}, },

4
src/views/modules/part/quicklyCreateBom.vue

@ -105,9 +105,9 @@
</el-card> </el-card>
</el-col> </el-col>
<!-- 数据 --> <!-- 数据 -->
<el-col :span="17">
<el-col :span="17" :style="{height: this.height + 'px'}" style="display: block;overflow-y: scroll">
<!-- 页签 --> <!-- 页签 -->
<el-tabs v-model="activeTable" style="width: 100%" type="border-card" @tab-click="refreshCurrentTabTable" class="customer-tab">
<el-tabs v-model="activeTable" :style="{height: this.height + 'px'}" style="width: 100%" type="border-card" @tab-click="refreshCurrentTabTable" class="customer-tab">
<!-- BOM页签 --> <!-- BOM页签 -->
<el-tab-pane label="产品BOM管理" name="bom_info"> <el-tab-pane label="产品BOM管理" name="bom_info">
<bom-create v-loading="bomLoading" ref="BomCreate" :batchUpdateFlag="batchUpdateFlag" @handleBatchUpdatePart="handleBatchUpdatePart" @refreshNode="refreshNode" @refreshBomLoading="refreshBomLoading" v-drag></bom-create> <bom-create v-loading="bomLoading" ref="BomCreate" :batchUpdateFlag="batchUpdateFlag" @handleBatchUpdatePart="handleBatchUpdatePart" @refreshNode="refreshNode" @refreshBomLoading="refreshBomLoading" v-drag></bom-create>

Loading…
Cancel
Save