|
|
@ -56,7 +56,7 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item class="customer-item" :label=labels.parentLabelNo> |
|
|
<el-form-item class="customer-item" :label=labels.parentLabelNo> |
|
|
<el-input v-model="pageData.parentLabelNo" style="width: 120px;" ></el-input> |
|
|
|
|
|
|
|
|
<el-input v-model="pageData.parentLabelNo" :disabled="pageData.subLabelFlag !== 'Y'" style="width: 120px;" ></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
@ -120,10 +120,9 @@ export default { |
|
|
labelName: '', |
|
|
labelName: '', |
|
|
labelClass: '', |
|
|
labelClass: '', |
|
|
subLabelFlag: 'N', |
|
|
subLabelFlag: 'N', |
|
|
parentLabelNo: '*', |
|
|
|
|
|
|
|
|
parentLabelNo: '', |
|
|
remark: '', |
|
|
remark: '', |
|
|
addFlag: false, |
|
|
addFlag: false, |
|
|
checkFlag: 'Y', |
|
|
|
|
|
}, |
|
|
}, |
|
|
labelNoReadOnly: false, |
|
|
labelNoReadOnly: false, |
|
|
dataListLoading: false, |
|
|
dataListLoading: false, |
|
|
@ -147,7 +146,7 @@ export default { |
|
|
labelName: '报表文件名:', |
|
|
labelName: '报表文件名:', |
|
|
labelClass: '标签种类:', |
|
|
labelClass: '标签种类:', |
|
|
subLabelFlag: '子报表:', |
|
|
subLabelFlag: '子报表:', |
|
|
parentLabelNo: '上机标签编号:', |
|
|
|
|
|
|
|
|
parentLabelNo: '上级标签编号:', |
|
|
remark: '备注:', |
|
|
remark: '备注:', |
|
|
confirmLabel: '确认', |
|
|
confirmLabel: '确认', |
|
|
cancelLabel: '取消', |
|
|
cancelLabel: '取消', |
|
|
@ -169,6 +168,9 @@ export default { |
|
|
init(currentRow) { |
|
|
init(currentRow) { |
|
|
//初始化参数 |
|
|
//初始化参数 |
|
|
this.pageData = JSON.parse(JSON.stringify(currentRow)); |
|
|
this.pageData = JSON.parse(JSON.stringify(currentRow)); |
|
|
|
|
|
//统一子报表标识和值,避免页面展示为* |
|
|
|
|
|
this.pageData.subLabelFlag = this.pageData.subLabelFlag === 'Y' ? 'Y' : 'N'; |
|
|
|
|
|
this.pageData.parentLabelNo = this.getDisplayParentLabelNo(this.pageData.parentLabelNo, this.pageData.subLabelFlag); |
|
|
//打开页面 |
|
|
//打开页面 |
|
|
this.visible = true; |
|
|
this.visible = true; |
|
|
//判断是否是新增 |
|
|
//判断是否是新增 |
|
|
@ -177,8 +179,6 @@ export default { |
|
|
}else{ |
|
|
}else{ |
|
|
this.labelNoReadOnly = true; |
|
|
this.labelNoReadOnly = true; |
|
|
} |
|
|
} |
|
|
//重置是否需要检验 |
|
|
|
|
|
this.pageData.checkFlag = 'Y'; |
|
|
|
|
|
//重置人员信息 |
|
|
//重置人员信息 |
|
|
this.pageData.username = this.userId; |
|
|
this.pageData.username = this.userId; |
|
|
//判断是否启用多语言 |
|
|
//判断是否启用多语言 |
|
|
@ -213,53 +213,83 @@ export default { |
|
|
if(this.pageData.subLabelFlag === 'Y'){ |
|
|
if(this.pageData.subLabelFlag === 'Y'){ |
|
|
this.pageData.parentLabelNo = ''; |
|
|
this.pageData.parentLabelNo = ''; |
|
|
}else{ |
|
|
}else{ |
|
|
this.pageData.parentLabelNo = '*'; |
|
|
|
|
|
|
|
|
this.pageData.parentLabelNo = ''; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/*保存标签自定义的信息*/ |
|
|
|
|
|
saveLabelSetting(){ |
|
|
|
|
|
//判断标签内容是否为空 |
|
|
|
|
|
let labelNo = this.pageData.labelNo.trim(); |
|
|
|
|
|
let labelType = this.pageData.labelType.trim(); |
|
|
|
|
|
let labelName = this.pageData.labelName.trim(); |
|
|
|
|
|
if(labelNo == null || labelNo === ''){ |
|
|
|
|
|
this.$message.success("标签编号不能为空!"); |
|
|
|
|
|
|
|
|
/*根据子报表标识处理上级标签显示值*/ |
|
|
|
|
|
getDisplayParentLabelNo(parentLabelNo, subLabelFlag){ |
|
|
|
|
|
if(subLabelFlag !== 'Y'){ |
|
|
|
|
|
return ''; |
|
|
|
|
|
} |
|
|
|
|
|
if(parentLabelNo == null || parentLabelNo === '*'){ |
|
|
|
|
|
return ''; |
|
|
|
|
|
} |
|
|
|
|
|
return parentLabelNo; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/*构建提交参数*/ |
|
|
|
|
|
buildSubmitData(){ |
|
|
|
|
|
let submitData = JSON.parse(JSON.stringify(this.pageData)); |
|
|
|
|
|
submitData.customerId = (submitData.customerId || '').trim().toUpperCase(); |
|
|
|
|
|
submitData.addressNo = (submitData.addressNo || '').trim().toUpperCase(); |
|
|
|
|
|
submitData.labelNo = (submitData.labelNo || '').trim().toUpperCase(); |
|
|
|
|
|
submitData.labelType = (submitData.labelType || '').trim(); |
|
|
|
|
|
submitData.labelName = (submitData.labelName || '').trim(); |
|
|
|
|
|
submitData.remark = (submitData.remark || '').trim(); |
|
|
|
|
|
submitData.subLabelFlag = submitData.subLabelFlag === 'Y' ? 'Y' : 'N'; |
|
|
|
|
|
let parentLabelNo = (submitData.parentLabelNo || '').trim().toUpperCase(); |
|
|
|
|
|
submitData.parentLabelNo = submitData.subLabelFlag === 'Y' ? parentLabelNo : '*'; |
|
|
|
|
|
return submitData; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/*保存前校验*/ |
|
|
|
|
|
validateSubmitData(submitData){ |
|
|
|
|
|
if(!submitData.customerId){ |
|
|
|
|
|
this.$message.error('客户编码不能为空!'); |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
if(labelType == null || labelType === ''){ |
|
|
|
|
|
this.$message.success("标签类型不能为空!"); |
|
|
|
|
|
|
|
|
if(!submitData.addressNo){ |
|
|
|
|
|
this.$message.error('地址编码不能为空!'); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
if(!submitData.labelNo){ |
|
|
|
|
|
this.$message.error(this.labels.labelNoCantBeNull); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
if(!submitData.labelType){ |
|
|
|
|
|
this.$message.error(this.labels.labelTypeCantBeNull); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
if(submitData.subLabelFlag === 'Y' && (!submitData.parentLabelNo || submitData.parentLabelNo === '*')){ |
|
|
|
|
|
this.$message.error('子报表必须维护上级标签编号!'); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/*保存标签自定义的信息*/ |
|
|
|
|
|
saveLabelSetting(){ |
|
|
|
|
|
let submitData = this.buildSubmitData(); |
|
|
|
|
|
if(!this.validateSubmitData(submitData)){ |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
//判断是否是新增标签自定义 |
|
|
//判断是否是新增标签自定义 |
|
|
if(this.pageData.addFlag === 'Y'){ |
|
|
if(this.pageData.addFlag === 'Y'){ |
|
|
this.insertLabelSettingData(); |
|
|
|
|
|
|
|
|
this.insertLabelSettingData(submitData); |
|
|
}else{ |
|
|
}else{ |
|
|
this.updateLabelSettingData(); |
|
|
|
|
|
|
|
|
this.updateLabelSettingData(submitData); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/*数量失去焦点的事件*/ |
|
|
/*数量失去焦点的事件*/ |
|
|
insertLabelSettingData(){ |
|
|
|
|
|
insertLabelSetting(this.pageData).then(({data}) => { |
|
|
|
|
|
|
|
|
insertLabelSettingData(submitData){ |
|
|
|
|
|
insertLabelSetting(submitData).then(({data}) => { |
|
|
if(data.code == 200){ |
|
|
if(data.code == 200){ |
|
|
this.$message.success(data.msg); |
|
|
this.$message.success(data.msg); |
|
|
setTimeout(this.closeDialog(), 2000); |
|
|
|
|
|
}else if(data.code == 201){ |
|
|
|
|
|
this.$confirm(data.msg, '提示', { |
|
|
|
|
|
confirmButtonText: this.labels.confirmLabel, |
|
|
|
|
|
cancelButtonText: this.labels.cancelLabel, |
|
|
|
|
|
type: "warning" |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
//调用存储过程实现 |
|
|
|
|
|
this.pageData.checkFlag = 'N'; |
|
|
|
|
|
//重新调用当前的方法 |
|
|
|
|
|
this.insertLabelSettingData(); |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.pageData.checkFlag = 'Y'; |
|
|
|
|
|
}); |
|
|
|
|
|
//重置标签 |
|
|
|
|
|
this.pageData.checkFlag = 'Y'; |
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.closeDialog(); |
|
|
|
|
|
}, 200); |
|
|
}else{ |
|
|
}else{ |
|
|
this.$message.error(data.msg); |
|
|
this.$message.error(data.msg); |
|
|
} |
|
|
} |
|
|
@ -267,11 +297,13 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/*验证时长的参数*/ |
|
|
/*验证时长的参数*/ |
|
|
updateLabelSettingData(){ |
|
|
|
|
|
updateLabelSetting(this.pageData).then(({data}) => { |
|
|
|
|
|
|
|
|
updateLabelSettingData(submitData){ |
|
|
|
|
|
updateLabelSetting(submitData).then(({data}) => { |
|
|
if(data.code == 200){ |
|
|
if(data.code == 200){ |
|
|
this.$message.success(data.msg); |
|
|
this.$message.success(data.msg); |
|
|
setTimeout(this.closeDialog(), 2000); |
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.closeDialog(); |
|
|
|
|
|
}, 200); |
|
|
}else{ |
|
|
}else{ |
|
|
this.$message.error(data.msg); |
|
|
this.$message.error(data.msg); |
|
|
} |
|
|
} |
|
|
@ -338,8 +370,14 @@ export default { |
|
|
pageData: { |
|
|
pageData: { |
|
|
deep: true, |
|
|
deep: true, |
|
|
handler: function (newV, oldV) { |
|
|
handler: function (newV, oldV) { |
|
|
this.pageData.labelNo = this.pageData.labelNo.toUpperCase(); |
|
|
|
|
|
this.pageData.parentLabelNo = this.pageData.parentLabelNo.toUpperCase(); |
|
|
|
|
|
|
|
|
let labelNo = (this.pageData.labelNo || '').toUpperCase(); |
|
|
|
|
|
let parentLabelNo = (this.pageData.parentLabelNo || '').toUpperCase(); |
|
|
|
|
|
if(this.pageData.labelNo !== labelNo){ |
|
|
|
|
|
this.pageData.labelNo = labelNo; |
|
|
|
|
|
} |
|
|
|
|
|
if(this.pageData.parentLabelNo !== parentLabelNo){ |
|
|
|
|
|
this.pageData.parentLabelNo = parentLabelNo; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
|