解决商品的bug

This commit is contained in:
季圣华
2018-12-24 22:55:32 +08:00
parent c0e43886a8
commit cce885fd4a
7 changed files with 117 additions and 37 deletions

View File

@@ -610,8 +610,8 @@
var str = '';
var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.model + 'AaBb' + rec.color + 'AaBb' + rec.unit + 'AaBb' + rec.retailprice
+ 'AaBb' + rec.lowprice + 'AaBb' + rec.presetpriceone + 'AaBb' + rec.presetpricetwo + 'AaBb' + rec.remark + 'AaBb' + rec.standard
+ 'AaBb' + rec.color + 'AaBb' + rec.packing + 'AaBb' + rec.safetystock + 'AaBb' + rec.categoryid + 'AaBb' + rec.categoryname
+ 'AaBb' + rec.unitid + 'AaBb' + rec.unitname + 'AaBb' + rec.firstoutunit + 'AaBb' + rec.firstinunit
+ 'AaBb' + rec.color + 'AaBb' + rec.packing + 'AaBb' + rec.safetystock + 'AaBb' + rec.categoryid + 'AaBb' + rec.categoryName
+ 'AaBb' + rec.unitid + 'AaBb' + rec.unitName + 'AaBb' + rec.firstoutunit + 'AaBb' + rec.firstinunit
+ 'AaBb' + rec.mfrs + 'AaBb' + rec.otherfield1 + 'AaBb' + rec.otherfield2 + 'AaBb' + rec.otherfield3;
str += '<img title="编辑" src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editMaterial(\'' + rowInfo + '\');"/>&nbsp;&nbsp;&nbsp;';
str += '<img title="删除" src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteMaterial(' + rec.id + ');"/>';
@@ -620,7 +620,7 @@
},
{title: '品名', field: 'name', width: 100},
{title: '型号', field: 'model', width: 80},
{title: '扩展信息', field: 'materialother', width: 150},
{title: '扩展信息', field: 'materialOther', width: 150},
{title: '单位', field: 'unit', width: 60},
{title: '安全存量', field: 'safetystock', width: 70},
{
@@ -1071,9 +1071,9 @@
//表格模板变更
$(".tb-other-info").html("");
for (var i = 0; i < mPropertyList.length; i++) {
if (mPropertyList[i].nativeName === "颜色") {
if (mPropertyList[i].nativename === "颜色") {
$(".tb-other-info").append(trColor);
$(".tr-color td").first().text(mPropertyList[i].anotherName);
$(".tr-color td").first().text(mPropertyList[i].anothername);
if (mPropertyList[i].enabled) {
$(".tr-color").show();
}
@@ -1081,9 +1081,9 @@
$(".tr-color").hide();
}
}
if (mPropertyList[i].nativeName === "规格") {
if (mPropertyList[i].nativename === "规格") {
$(".tb-other-info").append(trStandard);
$(".tr-standard td").first().text(mPropertyList[i].anotherName);
$(".tr-standard td").first().text(mPropertyList[i].anothername);
if (mPropertyList[i].enabled) {
$(".tr-standard").show();
}
@@ -1091,9 +1091,9 @@
$(".tr-standard").hide();
}
}
if (mPropertyList[i].nativeName === "制造商") {
if (mPropertyList[i].nativename === "制造商") {
$(".tb-other-info").append(trMfrs);
$(".tr-mfrs td").first().text(mPropertyList[i].anotherName);
$(".tr-mfrs td").first().text(mPropertyList[i].anothername);
if (mPropertyList[i].enabled) {
$(".tr-mfrs").show();
}
@@ -1101,9 +1101,9 @@
$(".tr-mfrs").hide();
}
}
if (mPropertyList[i].nativeName === "自定义1") {
if (mPropertyList[i].nativename === "自定义1") {
$(".tb-other-info").append(trOtherField1);
$(".tr-otherField1 td").first().text(mPropertyList[i].anotherName);
$(".tr-otherField1 td").first().text(mPropertyList[i].anothername);
if (mPropertyList[i].enabled) {
$(".tr-otherField1").show();
}
@@ -1111,9 +1111,9 @@
$(".tr-otherField1").hide();
}
}
if (mPropertyList[i].nativeName === "自定义2") {
if (mPropertyList[i].nativename === "自定义2") {
$(".tb-other-info").append(trOtherField2);
$(".tr-otherField2 td").first().text(mPropertyList[i].anotherName);
$(".tr-otherField2 td").first().text(mPropertyList[i].anothername);
if (mPropertyList[i].enabled) {
$(".tr-otherField2").show();
}
@@ -1121,9 +1121,9 @@
$(".tr-otherField2").hide();
}
}
if (mPropertyList[i].nativeName === "自定义3") {
if (mPropertyList[i].nativename === "自定义3") {
$(".tb-other-info").append(trOtherField3);
$(".tr-otherField3 td").first().text(mPropertyList[i].anotherName);
$(".tr-otherField3 td").first().text(mPropertyList[i].anothername);
if (mPropertyList[i].enabled) {
$(".tr-otherField3").show();
}
@@ -1373,7 +1373,7 @@
$("#mTypeName").text(categoryName).show(); //类型显示
$("#mTypeChange").show(); //按钮显示
$("#Packing").focus().val(materialInfo[12]);
$("#SafetyStock").focus().val(materialInfo[13]);
$("#SafetyStock").focus().val(materialInfo[13]=="undefined" ? "" : materialInfo[13]);
$("#Model").val(materialInfo[2]);
$("#Standard").val(materialInfo[10] == "undefined" ? "" : materialInfo[10]);
$("#Color").val(materialInfo[3] == "undefined" ? "" : materialInfo[3]);
@@ -1388,7 +1388,7 @@
$("#PresetPriceTwo").val(materialInfo[8]);
$("#Remark").val(materialInfo[9]);
$("#manyUnit").val(materialInfo[16]);
if (materialInfo[16]) {
if (materialInfo[16] != "undefined") {
$("#manyUnitCheck").prop("checked", true);
//当前为选中状态
$("#Unit").hide();
@@ -1430,8 +1430,9 @@
type: "get",
dataType: "json",
success: function (res) {
if (res && res.rows && res.rows[0]) {
var PriceStrategy = res.rows[0].PriceStrategy;
if (res && res.code === 200 && res.data && res.data[0]) {
var PriceStrategy = res.data[0].pricestrategy;
PriceStrategy = JSON.parse(PriceStrategy);
if (PriceStrategy && PriceStrategy[0] && PriceStrategy[1]) {
//基本单位
$("#basicUnit").text(PriceStrategy[0].basic.Unit);