Browse Source

2025-06-05

1、属性值没填写时,不让保存
2、数字为什么会有默认0
master
fengyuan_yang 7 months ago
parent
commit
9721d69974
  1. 31
      src/views/modules/project/projectInfo/com_project_info_part.vue

31
src/views/modules/project/projectInfo/com_project_info_part.vue

@ -449,7 +449,11 @@
border
@selection-change="itemSelectionChange"
style="width: 100%">
<el-table-column type="selection" align="center" width="50"></el-table-column>
<el-table-column
type="selection"
align="center"
width="50">
</el-table-column>
<el-table-column
v-for="(item,index) in columnItemList" :key="index"
:sortable="item.columnSortable"
@ -2325,6 +2329,16 @@ import {
this.$message.warning('存在物料属性,属性模板不能为空值!')
return
}
//
if (this.partItemList.length > 0
&& this.partItemList.some(item => {
const emptyText = [null, undefined, ''].includes(item.textValue)
const emptyNum = [null, undefined, ''].includes(item.numValue)
return emptyText && emptyNum
})) {
this.$message.warning('属性值不能为空值!')
return
}
if (this.modalData.flag === '2' && this.modalData.oldPartType === 'Manufactured' && this.modalData.partType === 'Manufactured Recipe') {
this.$confirm("该操作会删除物料BOM,请确认!", "提示", {
confirmButtonText: "确定",
@ -2881,7 +2895,10 @@ import {
}
getPartCharacteristicList(tempData).then(({data}) => {
if (data && data.code === 0) {
this.partItemList = data.rows
this.partItemList = data.rows.map(item => ({
...item,
numValue: item.numValue === null ? undefined : item.numValue
}))
} else {
this.partItemList = []
}
@ -2897,7 +2914,10 @@ import {
}
getItemListByCodeNo(tempData).then(({data}) => {
if (data && data.code === 0) {
this.partItemList = data.rows
this.partItemList = data.rows.map(item => ({
...item,
numValue: item.numValue === null ? undefined : item.numValue
}))
} else {
this.partItemList = []
}
@ -2958,7 +2978,10 @@ import {
this.$message.warning('请选择属性!')
return
}
this.partItemList = [...this.partItemList,...this.characteristicSelections]
this.partItemList = [...this.partItemList,...this.characteristicSelections.map(item => ({
...item,
numValue: item.numValue === null ? undefined : item.numValue
}))]
this.saveItemModelFlag = false
},

Loading…
Cancel
Save