|
楼主 |
发表于 2017-6-20 14:24:57
|
显示全部楼层
现在能判断编号是否存在了,判断之后会在上架商品页面添加一条空白数据,代码如下:Model.prototype.shopOnBtnClick = function(event) {
var mainData = this.comp("mainData");
var listData = this.comp("listData");
var putawayData = this.comp("putawayData");
var rows = listData.getCheckeds();
var rowids = [];
var rowidss = [];
debugger;
var options = {};
var datas = [];
var i = 0;
for (; i < rows.length; i++) {
rowids.push(rows.getID());
var row = mainData.find(['fNumber'],putawayData.find['fNumber'],true,true,true);
// if(row.length==0) alert('没有符合条件数据');
if (row.length==0) {
alert("商品已存在");
}else {
mainData.setValue("fFlag", "1", rows);
mainData.setValue("fStatus", "上架", rows);
datas.push({
fName : mainData.getValue("fName", rows),
fNumber : mainData.getValue("fNumber", rows)
});
options.defaultValues = datas;
alert("已上架" + i + "件商品");
}
}
putawayData.newData(options);
mainData.saveData();
putawayData.saveData();
};
页面如下:
|
|