动态控制查看单据详情页面的字段的隐藏

This commit is contained in:
jishenghua
2025-05-04 13:48:50 +08:00
parent c70ad0d569
commit 268d425a9a

View File

@@ -1652,7 +1652,7 @@
} }
//动态替换扩展字段 //动态替换扩展字段
this.handleChangeOtherField() this.handleChangeOtherField()
//判断序列号、批号、有效期、多属性、重量、仓位货架是否有值 //判断序列号、批号、有效期、多属性、重量、仓位货架、扩展、备注等是否有值
let needAddkeywords = [] let needAddkeywords = []
for (let i = 0; i < ds.length; i++) { for (let i = 0; i < ds.length; i++) {
if(ds[i].snList) { if(ds[i].snList) {
@@ -1679,6 +1679,21 @@
if(ds[i].mfrs) { if(ds[i].mfrs) {
needAddkeywords.push('mfrs') needAddkeywords.push('mfrs')
} }
if(ds[i].otherField1) {
needAddkeywords.push('otherField1')
}
if(ds[i].otherField2) {
needAddkeywords.push('otherField2')
}
if(ds[i].otherField3) {
needAddkeywords.push('otherField3')
}
if(ds[i].taxRate) {
needAddkeywords.push('taxRate')
}
if(ds[i].remark) {
needAddkeywords.push('remark')
}
} }
let currentCol = [{title:'#',dataIndex:'',align:'center',customRender:function(t,r,index){ let currentCol = [{title:'#',dataIndex:'',align:'center',customRender:function(t,r,index){
return index === ds.length-1?'':parseInt(index)+1}}] return index === ds.length-1?'':parseInt(index)+1}}]
@@ -1709,7 +1724,8 @@
} else { } else {
for(let i=0; i<this.defColumns.length; i++){ for(let i=0; i<this.defColumns.length; i++){
//移除列 //移除列
let needRemoveKeywords = ['finishNumber','snList','batchNumber','expirationDate','sku','weight','position','brand','mfrs'] let needRemoveKeywords = ['finishNumber','snList','batchNumber','expirationDate','sku','weight','position',
'brand','mfrs','otherField1','otherField2','otherField3','taxRate','remark']
if(needRemoveKeywords.indexOf(this.defColumns[i].dataIndex)===-1) { if(needRemoveKeywords.indexOf(this.defColumns[i].dataIndex)===-1) {
let info = {} let info = {}
info.title = this.defColumns[i].title info.title = this.defColumns[i].title