|
@@ -233,23 +233,22 @@ export default {
|
|
|
var type = [],
|
|
|
sta = true
|
|
|
this.declareElementsData.map(item => {
|
|
|
- type.push(item.typeValue)
|
|
|
- if(item.typeValue === '' || item.describeText === ''){
|
|
|
+ type.push(item.typeValue)
|
|
|
+ if(item.typeValue === '' ){
|
|
|
sta = false
|
|
|
- }
|
|
|
+ }
|
|
|
})
|
|
|
var typeSet = [...new Set(type)]
|
|
|
//类型/描述为空时
|
|
|
if(!sta){
|
|
|
- this.$message.error("类型/描述均不可为空!");
|
|
|
+ this.$message.error("类型不可为空!");
|
|
|
} else if(typeSet.length !== type.length){ //类名重复时
|
|
|
this.$message.error("类型不能重复选择!");
|
|
|
} else {
|
|
|
- console.log('点击报关要素对话框 保存')
|
|
|
var newObj = {} // 新增主表
|
|
|
newObj.id = this.declareElements.id
|
|
|
newObj.declarationName = this.declareElements.declarationName //报关品名
|
|
|
- newObj.hsCode = this.declareElements.hsCode //报关品名
|
|
|
+ newObj.hsCode = this.declareElements.hsCode
|
|
|
newObj.englishProductName = this.declareElements.englishProductName //英文品名
|
|
|
newObj.acSetNo = this.declareElements.acSetNo //账套
|
|
|
newObj.inventoryName = this.declareElements.inventoryName //物料名称
|
|
@@ -261,8 +260,10 @@ export default {
|
|
|
syDeclarationElementsAdd(newObj).then(res => {
|
|
|
if (res.success) {
|
|
|
this.$message.success('新增成功')
|
|
|
- console.log('新增的对象', newObj)
|
|
|
+ this.$emit('table')
|
|
|
this.close()
|
|
|
+ }else {
|
|
|
+ this.$message.error(res.message)
|
|
|
}
|
|
|
})
|
|
|
this.close()
|