|
发表于
2024-10-22 16:34:03
|
显示全部楼层
本帖最后由 xxdoc 于 2024-10-22 16:41 编辑
不知道怎么去下断点。怎么监听到数据改变
下面是原代码中本来就有debug中断
// 不修改的情况下不触发afterCellEdit
module.on("beforeCellEdit", this.beforeGridEdit, this);
module.grid.on("beforeCheckedit", this.beforeCheckEdit, this)
module.on("afterCellEdit", this.afterGridEdit, this);
module.on("doNew", this.doNew, this);
module.on("doSave", this.doSave, this);
module.on("doRemove", this.doRemoveCF02, this);
module.on("loadData", this.listLoadData, this);
// module.on("click", this.loadFJdata, this);
// var gytj = module.grid.getColumnModel().getColumnById("GYTJ").editor;
// gytj.on("select", this.list.ypyfSelect, this.list);
我知道他是触发的afterCellEdit
我不知道怎么利用
afterGridEdit: function (it, record, field, v) {
debugger
var MZYPZLJSFS_Data = phis.script.rmi.miniJsonRequestSync({
serviceId: "publicService",
serviceAction: "loadSystemParams",
body: {
commons: ['MZYPZLJSFS', 'ZYYPZLJSFS']
}
});
var MZYPZLJSFS = MZYPZLJSFS_Data.json.body.MZYPZLJSFS;
record.set("MZYPZLJSFS", MZYPZLJSFS);
var sign = 1;
if (it.id == "YPYF") {
field.getStore().each(function (r) {
if (r.data.key == v) {
if (record.get("MRCS") != r.data.MRCS) {
record.set("MRCS", r.data.MRCS);
} else {
sign = 0;//
}
}
}, this);
}
if (it.id == "YCJL" || it.id == "YYTS" || it.id == "YPYF") {
this.isYPSL = false;
if (this.exContext.systemParams.QYKJYWGL == 1
&& record.get("KSBZ") == 1 && it.id == "YYTS") {//
var kjywts = this.exContext.systemParams.KJYSYTS || 3;
if (isNaN(kjywts)) {
MyMessageTip.msg("提示",
"", true);
kjywts = 3;
}
if (v > kjywts) {
record.set("YYTS", kjywts);
this.setMedQuantity(record);
return;
}
}
if (sign == 1) { // 添加this.cflx!=3 && this.cflx != 3
this.setMedQuantity(record);
}
}
if (it.id == 'JLBS') {// add by yangl 记录倍数快捷录入
record.set("YCJL", parseFloat(v * record.get("YSYCJL"))
.toFixed(3));
}
if (it.id == 'YPYF' || it.id == 'GYTJ' || it.id == 'YYTS'
|| (it.id == 'YPZS' && this.cflx != 3) || it.id == 'YPDS') {
this.isYPSL = false;
if (it.id == 'GYTJ') {
//替换GYTJ的select事件
var gytj = this.list.grid.getColumnModel().getColumnById("GYTJ").editor;
this.list.ypyfSelect(gytj, gytj.findRecord("key", record.get("GYTJ")), gytj.selectedIndex, record);// 附加项目
}
// else {
var store = this.list.grid.getStore();
// if (it.id == "GYTJ") {
// this.doGytjChange(record, v);
// }
store.each(function (r) {
if (r.get('YPZH_SHOW') == record.get('YPZH_SHOW')) {
if (r.get("YPXH") != record.get("YPXH")) {
r.set(it.id, v);
r.set(it.id + '_text', record.get(it.id + '_text'));
if (it.id == 'YPYF') {
r.set("MRCS", record.get("MRCS"));
}
if ((it.id == 'YPYF' || it.id == 'YYTS')
&& sign == 1
) {// 添加this.cflx!=3 && this.cflx != 3
this.setMedQuantity(r);
}
}
}
}, this)
// }
} |
|