|
|
|
@ -37,7 +37,7 @@ |
|
|
|
:min-width="item.columnWidth" |
|
|
|
:label="item.columnLabel"> |
|
|
|
<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 |
|
|
|
v-if="editingCell.rowIndex === scope.$index && editingCell.columnProp === item.columnProp" |
|
|
|
v-model="editingCell.value" |
|
|
|
@ -1421,7 +1421,7 @@ import { |
|
|
|
getPartItem, |
|
|
|
partInfoByMainPart, |
|
|
|
queryPartItem, |
|
|
|
getItemLists, batchSavePartInfo, addPartsItem, batchUpdateCodeNo, deletePartsItem, commitItemsValue, getCopyRowData |
|
|
|
getItemLists, batchSavePartInfo, addPartsItem, batchUpdateCodeNo, deletePartsItem, commitItemsValue, getCopyRowData, recalculateBomAndRouting |
|
|
|
} from "../../../api/part/partInformation"; |
|
|
|
import {getChooselist1} from "../../../api/chooselist/chooselist"; |
|
|
|
import { |
|
|
|
@ -5484,12 +5484,52 @@ export default { |
|
|
|
|
|
|
|
// 调用保存接口 |
|
|
|
commitItemsValue(list).then(({data}) => { |
|
|
|
loading.close() |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('保存成功') |
|
|
|
this.editingCell.isSaving = false |
|
|
|
this.cancelEditCell() |
|
|
|
|
|
|
|
// 关闭"保存中"的loading,创建"重新计算中"的loading |
|
|
|
loading.close() |
|
|
|
const recalcLoading = this.$loading({ |
|
|
|
lock: true, |
|
|
|
text: '重新计算中,请稍后...', |
|
|
|
spinner: 'el-icon-loading', |
|
|
|
background: 'rgba(0, 0, 0, 0.5)' |
|
|
|
}) |
|
|
|
|
|
|
|
// 重新计算BOM单位用量和Routing机器处理时间 |
|
|
|
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('重新计算完成') |
|
|
|
|
|
|
|
// 刷新当前节点的BOM和Routing数据 |
|
|
|
if (this.currentNode && this.currentNode.partNo) { |
|
|
|
if (this.activeTable === 'routing_info') { |
|
|
|
// 如果当前显示Routing,刷新Routing数据 |
|
|
|
this.getRoutingInfo(this.currentNode) |
|
|
|
} else { |
|
|
|
// 如果当前显示BOM,刷新BOM数据 |
|
|
|
this.getBomInfo2(this.currentNode) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning('重新计算失败,但属性已保存') |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
recalcLoading.close() |
|
|
|
this.$message.warning('重新计算失败,但属性已保存') |
|
|
|
}) |
|
|
|
} else { |
|
|
|
loading.close() |
|
|
|
this.$message.error(data.msg || '保存失败') |
|
|
|
this.$set(this.dataList[rowIndex], columnProp, oldValue) |
|
|
|
this.editingCell.isSaving = false |
|
|
|
@ -5520,29 +5560,6 @@ export default { |
|
|
|
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() { |
|
|
|
let tempData = { |
|
|
|
|