Browse Source

修改属性自动计算组件

java8
han\hanst 2 months ago
parent
commit
408f930d60
  1. 5
      src/api/part/partInformation.js
  2. 69
      src/views/modules/part/quicklyCreateBom.vue

5
src/api/part/partInformation.js

@ -212,3 +212,8 @@ export const batchUpdateCodeNo = data => createAPI(`/part/partInformation/batchU
export const batchSavePartInfo = data => createAPI(`/part/partInformation/batchSavePartInfo`,'post',data) export const batchSavePartInfo = data => createAPI(`/part/partInformation/batchSavePartInfo`,'post',data)
export const getCopyRowData = data => createAPI(`/part/partInformation/getCopyRowData`,'post',data) export const getCopyRowData = data => createAPI(`/part/partInformation/getCopyRowData`,'post',data)
/**
* 重新计算BOM单位用量和Routing机器处理时间
*/
export const recalculateBomAndRouting = data => createAPI(`/part/partInformation/recalculateBomAndRouting`,'post',data)

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

@ -37,7 +37,7 @@
:min-width="item.columnWidth" :min-width="item.columnWidth"
:label="item.columnLabel"> :label="item.columnLabel">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="!item.columnHidden" @dblclick="startEditCell(scope.$index, item.columnProp, scope.row[item.columnProp])" style="min-height: 23px; cursor: pointer;" :title="editingCell.rowIndex === scope.$index && editingCell.columnProp === item.columnProp ? '' : '双击编辑'">
<div v-if="!item.columnHidden" @dblclick="startEditCell(scope.$index, item.columnProp, scope.row[item.columnProp])" style="min-height: 23px; cursor: pointer;" :title="editingCell.rowIndex === scope.$index && editingCell.columnProp === item.columnProp ? '' : '双击编辑,回车保存'">
<el-input <el-input
v-if="editingCell.rowIndex === scope.$index && editingCell.columnProp === item.columnProp" v-if="editingCell.rowIndex === scope.$index && editingCell.columnProp === item.columnProp"
v-model="editingCell.value" v-model="editingCell.value"
@ -1421,7 +1421,7 @@ import {
getPartItem, getPartItem,
partInfoByMainPart, partInfoByMainPart,
queryPartItem, queryPartItem,
getItemLists, batchSavePartInfo, addPartsItem, batchUpdateCodeNo, deletePartsItem, commitItemsValue, getCopyRowData
getItemLists, batchSavePartInfo, addPartsItem, batchUpdateCodeNo, deletePartsItem, commitItemsValue, getCopyRowData, recalculateBomAndRouting
} from "../../../api/part/partInformation"; } from "../../../api/part/partInformation";
import {getChooselist1} from "../../../api/chooselist/chooselist"; import {getChooselist1} from "../../../api/chooselist/chooselist";
import { import {
@ -5484,12 +5484,52 @@ export default {
// //
commitItemsValue(list).then(({data}) => { commitItemsValue(list).then(({data}) => {
loading.close()
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message.success('保存成功') this.$message.success('保存成功')
this.editingCell.isSaving = false this.editingCell.isSaving = false
this.cancelEditCell() this.cancelEditCell()
// ""loading""loading
loading.close()
const recalcLoading = this.$loading({
lock: true,
text: '重新计算中,请稍后...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)'
})
// BOMRouting
const recalcData = {
site: this.searchData.site,
buNo: this.searchData.buNo,
partNo: this.searchData.partNo,
codeNo: this.searchData.codeNo
}
recalculateBomAndRouting(recalcData).then(({data}) => {
recalcLoading.close()
if (data && data.code === 0) {
this.$message.success('重新计算完成')
// BOMRouting
if (this.currentNode && this.currentNode.partNo) {
if (this.activeTable === 'routing_info') {
// RoutingRouting
this.getRoutingInfo(this.currentNode)
} else {
// BOMBOM
this.getBomInfo2(this.currentNode)
}
}
} else {
this.$message.warning('重新计算失败,但属性已保存')
}
}).catch(error => {
recalcLoading.close()
this.$message.warning('重新计算失败,但属性已保存')
})
} else { } else {
loading.close()
this.$message.error(data.msg || '保存失败') this.$message.error(data.msg || '保存失败')
this.$set(this.dataList[rowIndex], columnProp, oldValue) this.$set(this.dataList[rowIndex], columnProp, oldValue)
this.editingCell.isSaving = false this.editingCell.isSaving = false
@ -5520,29 +5560,6 @@ export default {
this.editingCell.isSaving = false this.editingCell.isSaving = false
}, },
openColumnModal(desc, prop) {
this.partItemList1 = []
this.itemProp = prop
let tempData = {
site: this.$store.state.user.site,
buNo: this.searchData.buNo,
partNo: this.searchData.partNo,
codeNo: this.searchData.codeNo,
recordType: 'IP'
}
getPartItem(tempData).then(({data}) => {
if (data && data.code === 0 && data.rows.length > 0) {
const foundItem = data.rows.find(item => item.itemDesc === desc);
if (!foundItem) {
this.$message.warning('请先新增该属性再进行修改!')
}
this.partItemList1.push(foundItem)
this.itemUpdateFlag = true
} else {
this.partItemList1 = []
}
})
},
async itemUpdateSave() { async itemUpdateSave() {
let tempData = { let tempData = {

Loading…
Cancel
Save