简体中文
nonstandard_product.checkUnit.before
约 192 字小于 1 分钟
2026-05-08
执行时机
检查产品单位前
参数
| 参数 | 说明 | 类型 |
|---|---|---|
| changeRows | 变更的行数据 | Array |
| param | 其他参数对象 | Object |
返回结果
| 参数 | 说明 | 类型 |
|---|---|---|
| stop | 是否停止执行后续逻辑 | Boolean |
说明
- 该钩子在检查产品单位前触发,用于验证更改后的产品单位是否与原产品单位一致。
- 如果不一致,可以提示用户,用户可以选择取消操作。
- 如果返回的
stop为true,则停止执行校验单位逻辑。 - 如果返回的
stop为false或不返回,则继续执行后续逻辑。
代码示例
export default class Plugin {
apply() {
return [{
event: "nonstandard_product.checkUnit.before",
functional: this.checkUnit.bind(this)
},
];
}
checkUnit(context){
let { changeRows, mdApiName, lookupData, plugin, param } = context;
if(!lookupData) return;
return { stop: false };
}
}