更新-商品属性的选择加载[主线]
This commit is contained in:
@@ -262,7 +262,8 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
|||||||
pageUtil.setAdvSearch(getCondition());
|
pageUtil.setAdvSearch(getCondition());
|
||||||
depotItemService.find(pageUtil);
|
depotItemService.find(pageUtil);
|
||||||
List<DepotItem> dataList = pageUtil.getPageList();
|
List<DepotItem> dataList = pageUtil.getPageList();
|
||||||
|
String mpList = model.getMpList(); //商品属性
|
||||||
|
String[] mpArr = mpList.split(",");
|
||||||
JSONObject outer = new JSONObject();
|
JSONObject outer = new JSONObject();
|
||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
@@ -280,11 +281,29 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
|||||||
ratio = depotItem.getMaterialId().getUnitId().getUName();
|
ratio = depotItem.getMaterialId().getUnitId().getUName();
|
||||||
ratio = ratio.substring(ratio.indexOf("("));
|
ratio = ratio.substring(ratio.indexOf("("));
|
||||||
}
|
}
|
||||||
//品名/型号/规格/颜色/包装
|
//品名/型号/扩展信息/包装
|
||||||
String MaterialName = depotItem.getMaterialId().getName() + ((depotItem.getMaterialId().getModel() == null||depotItem.getMaterialId().getModel().equals(""))?"":"("+depotItem.getMaterialId().getModel()+ ")")
|
String MaterialName = depotItem.getMaterialId().getName() + ((depotItem.getMaterialId().getModel() == null || depotItem.getMaterialId().getModel().equals(""))?"":"("+depotItem.getMaterialId().getModel() + ")");
|
||||||
+((depotItem.getMaterialId().getStandard() == null||depotItem.getMaterialId().getStandard().equals(""))?"":"("+depotItem.getMaterialId().getStandard() + ")")
|
for(int i=0; i< mpArr.length; i++) {
|
||||||
+((depotItem.getMaterialId().getColor() == null||depotItem.getMaterialId().getColor().equals(""))?"":"("+depotItem.getMaterialId().getColor() + ")")
|
if(mpArr[i].equals("颜色")) {
|
||||||
+ ratio;
|
MaterialName = MaterialName + ((depotItem.getMaterialId().getColor() == null || depotItem.getMaterialId().getColor().equals(""))?"":"("+depotItem.getMaterialId().getColor() + ")");
|
||||||
|
}
|
||||||
|
if(mpArr[i].equals("规格")) {
|
||||||
|
MaterialName = MaterialName + ((depotItem.getMaterialId().getStandard() == null || depotItem.getMaterialId().getStandard().equals(""))?"":"("+depotItem.getMaterialId().getStandard() + ")");
|
||||||
|
}
|
||||||
|
if(mpArr[i].equals("制造商")) {
|
||||||
|
MaterialName = MaterialName + ((depotItem.getMaterialId().getMfrs() == null || depotItem.getMaterialId().getMfrs().equals(""))?"":"("+depotItem.getMaterialId().getMfrs() + ")");
|
||||||
|
}
|
||||||
|
if(mpArr[i].equals("自定义1")) {
|
||||||
|
MaterialName = MaterialName + ((depotItem.getMaterialId().getOtherField1() == null || depotItem.getMaterialId().getOtherField1().equals(""))?"":"("+depotItem.getMaterialId().getOtherField1() + ")");
|
||||||
|
}
|
||||||
|
if(mpArr[i].equals("自定义2")) {
|
||||||
|
MaterialName = MaterialName + ((depotItem.getMaterialId().getOtherField2() == null || depotItem.getMaterialId().getOtherField2().equals(""))?"":"("+depotItem.getMaterialId().getOtherField2() + ")");
|
||||||
|
}
|
||||||
|
if(mpArr[i].equals("自定义3")) {
|
||||||
|
MaterialName = MaterialName + ((depotItem.getMaterialId().getOtherField3() == null || depotItem.getMaterialId().getOtherField3().equals(""))?"":"("+depotItem.getMaterialId().getOtherField3() + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MaterialName = MaterialName + ratio;
|
||||||
item.put("MaterialName", MaterialName);
|
item.put("MaterialName", MaterialName);
|
||||||
item.put("Unit", depotItem.getMUnit());
|
item.put("Unit", depotItem.getMUnit());
|
||||||
item.put("OperNumber", depotItem.getOperNumber());
|
item.put("OperNumber", depotItem.getOperNumber());
|
||||||
|
|||||||
@@ -425,6 +425,8 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
pageUtil.setAdvSearch(getCondition_Select());
|
pageUtil.setAdvSearch(getCondition_Select());
|
||||||
materialService.find(pageUtil);
|
materialService.find(pageUtil);
|
||||||
List<Material> dataList = pageUtil.getPageList();
|
List<Material> dataList = pageUtil.getPageList();
|
||||||
|
String mpList = model.getMpList(); //商品属性
|
||||||
|
String[] mpArr = mpList.split(",");
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList) {
|
if(null != dataList) {
|
||||||
@@ -439,11 +441,29 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
ratio = material.getUnitId().getUName();
|
ratio = material.getUnitId().getUName();
|
||||||
ratio = ratio.substring(ratio.indexOf("("));
|
ratio = ratio.substring(ratio.indexOf("("));
|
||||||
}
|
}
|
||||||
//品名/型号/规格/颜色/包装
|
//品名/型号/扩展信息/包装
|
||||||
String MaterialName = material.getName() + ((material.getModel() == null || material.getModel().equals(""))?"":"("+material.getModel() + ")")
|
String MaterialName = material.getName() + ((material.getModel() == null || material.getModel().equals(""))?"":"("+material.getModel() + ")");
|
||||||
+ ((material.getStandard() == null || material.getStandard().equals(""))?"":"("+material.getStandard() + ")")
|
for(int i=0; i< mpArr.length; i++) {
|
||||||
+ ((material.getColor() == null || material.getColor().equals(""))?"":"("+material.getColor() + ")")
|
if(mpArr[i].equals("颜色")) {
|
||||||
+ ratio;
|
MaterialName = MaterialName + ((material.getColor() == null || material.getColor().equals(""))?"":"("+material.getColor() + ")");
|
||||||
|
}
|
||||||
|
if(mpArr[i].equals("规格")) {
|
||||||
|
MaterialName = MaterialName + ((material.getStandard() == null || material.getStandard().equals(""))?"":"("+material.getStandard() + ")");
|
||||||
|
}
|
||||||
|
if(mpArr[i].equals("制造商")) {
|
||||||
|
MaterialName = MaterialName + ((material.getMfrs() == null || material.getMfrs().equals(""))?"":"("+material.getMfrs() + ")");
|
||||||
|
}
|
||||||
|
if(mpArr[i].equals("自定义1")) {
|
||||||
|
MaterialName = MaterialName + ((material.getOtherField1() == null || material.getOtherField1().equals(""))?"":"("+material.getOtherField1() + ")");
|
||||||
|
}
|
||||||
|
if(mpArr[i].equals("自定义2")) {
|
||||||
|
MaterialName = MaterialName + ((material.getOtherField2() == null || material.getOtherField2().equals(""))?"":"("+material.getOtherField2() + ")");
|
||||||
|
}
|
||||||
|
if(mpArr[i].equals("自定义3")) {
|
||||||
|
MaterialName = MaterialName + ((material.getOtherField3() == null || material.getOtherField3().equals(""))?"":"("+material.getOtherField3() + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MaterialName = MaterialName + ratio;
|
||||||
item.put("MaterialName", MaterialName);
|
item.put("MaterialName", MaterialName);
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
}
|
}
|
||||||
@@ -456,6 +476,8 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
}
|
}
|
||||||
catch (IOException e) {
|
catch (IOException e) {
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询供应商信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询供应商信息结果异常", e);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,6 +76,8 @@ public class DepotItemModel implements Serializable
|
|||||||
*/
|
*/
|
||||||
private InputStream excelStream;
|
private InputStream excelStream;
|
||||||
|
|
||||||
|
private String mpList = ""; //商品属性
|
||||||
|
|
||||||
public DepotItemShowModel getShowModel() {
|
public DepotItemShowModel getShowModel() {
|
||||||
return showModel;
|
return showModel;
|
||||||
}
|
}
|
||||||
@@ -371,4 +373,12 @@ public class DepotItemModel implements Serializable
|
|||||||
public void setMType(String MType) {
|
public void setMType(String MType) {
|
||||||
this.MType = MType;
|
this.MType = MType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMpList() {
|
||||||
|
return mpList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMpList(String mpList) {
|
||||||
|
this.mpList = mpList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,6 +122,8 @@ public class MaterialModel implements Serializable
|
|||||||
private String fileName = ""; //文件名称
|
private String fileName = ""; //文件名称
|
||||||
private InputStream excelStream; //输入流,导出excel文件
|
private InputStream excelStream; //输入流,导出excel文件
|
||||||
|
|
||||||
|
private String mpList = ""; //商品属性
|
||||||
|
|
||||||
public MaterialShowModel getShowModel() {
|
public MaterialShowModel getShowModel() {
|
||||||
return showModel;
|
return showModel;
|
||||||
}
|
}
|
||||||
@@ -393,4 +395,12 @@ public class MaterialModel implements Serializable
|
|||||||
public void setMaterialFile(File materialFile) {
|
public void setMaterialFile(File materialFile) {
|
||||||
this.materialFile = materialFile;
|
this.materialFile = materialFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMpList() {
|
||||||
|
return mpList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMpList(String mpList) {
|
||||||
|
this.mpList = mpList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,7 @@ import java.security.MessageDigest;
|
|||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
var oldId = 0; //编辑前的单据Id
|
var oldId = 0; //编辑前的单据Id
|
||||||
var otherColumns = true; //明细中的‘别名’列是否显示
|
var otherColumns = true; //明细中的‘别名’列是否显示
|
||||||
var btnEnableList = getBtnStr(); //获取按钮的权限
|
var btnEnableList = getBtnStr(); //获取按钮的权限
|
||||||
|
var mPropertyList = ""; //商品属性列表
|
||||||
$(function(){
|
$(function(){
|
||||||
//初始化系统基础信息
|
//初始化系统基础信息
|
||||||
getType();
|
getType();
|
||||||
@@ -46,6 +47,7 @@
|
|||||||
initSalesman(); //销售人员
|
initSalesman(); //销售人员
|
||||||
initGift(); //初始化礼品卡
|
initGift(); //初始化礼品卡
|
||||||
initOutItemList(); //初始化支出项目
|
initOutItemList(); //初始化支出项目
|
||||||
|
initMProperty(); //初始化商品属性
|
||||||
initTableData();
|
initTableData();
|
||||||
ininPager();
|
ininPager();
|
||||||
initForm();
|
initForm();
|
||||||
@@ -358,6 +360,33 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//初始化商品属性
|
||||||
|
function initMProperty(){
|
||||||
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: path + "/materialProperty/findBy.action",
|
||||||
|
dataType: "json",
|
||||||
|
success: function (res) {
|
||||||
|
if (res && res.rows) {
|
||||||
|
var thisRows = res.rows;
|
||||||
|
for(var i=0; i < thisRows.length; i++) {
|
||||||
|
if(thisRows[i].enabled){
|
||||||
|
mPropertyList += thisRows[i].nativeName +",";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mPropertyList){
|
||||||
|
mPropertyList = mPropertyList.substring(0,mPropertyList.length-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//此处添加错误处理
|
||||||
|
error:function() {
|
||||||
|
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//初始化系统基础信息
|
//初始化系统基础信息
|
||||||
function initSystemData_person(){
|
function initSystemData_person(){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -788,7 +817,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '品名(型号)(规格)(颜色)(包装)',field: 'MaterialId',width:230,
|
{ title: '品名(型号)(扩展信息)(包装)',field: 'MaterialId',width:230,
|
||||||
formatter:function(value,row,index){
|
formatter:function(value,row,index){
|
||||||
return row.MaterialName;
|
return row.MaterialName;
|
||||||
},
|
},
|
||||||
@@ -797,7 +826,7 @@
|
|||||||
options:{
|
options:{
|
||||||
valueField:'Id',
|
valueField:'Id',
|
||||||
textField:'MaterialName',
|
textField:'MaterialName',
|
||||||
method:'get',
|
method:'post',
|
||||||
url: path + "/material/findBySelect.action",
|
url: path + "/material/findBySelect.action",
|
||||||
panelWidth: 300, //下拉框的宽度
|
panelWidth: 300, //下拉框的宽度
|
||||||
//全面模糊匹配,过滤字段
|
//全面模糊匹配,过滤字段
|
||||||
@@ -805,6 +834,9 @@
|
|||||||
var opts = $(this).combobox('options');
|
var opts = $(this).combobox('options');
|
||||||
return row[opts.textField].indexOf(q) >-1;
|
return row[opts.textField].indexOf(q) >-1;
|
||||||
},
|
},
|
||||||
|
onBeforeLoad: function(param){
|
||||||
|
param.mpList = mPropertyList; //商品属性
|
||||||
|
},
|
||||||
onSelect:function(rec){
|
onSelect:function(rec){
|
||||||
if(rec) {
|
if(rec) {
|
||||||
var mId = rec.Id;
|
var mId = rec.Id;
|
||||||
@@ -1081,6 +1113,9 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
url: path + '/depotItem/findBy.action?HeaderId=' + depotHeadID,
|
url: path + '/depotItem/findBy.action?HeaderId=' + depotHeadID,
|
||||||
|
data: {
|
||||||
|
mpList: mPropertyList
|
||||||
|
},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
var AllPrice = 0;
|
var AllPrice = 0;
|
||||||
@@ -1150,7 +1185,7 @@
|
|||||||
columns:[[
|
columns:[[
|
||||||
{ title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn},
|
{ title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn},
|
||||||
{ title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
|
{ title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
|
||||||
{ title: '品名(型号)(规格)(颜色)(包装)',field: 'MaterialName',width:230},
|
{ title: '品名(型号)(扩展信息)(包装)',field: 'MaterialName',width:230},
|
||||||
{ title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
|
{ title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:70},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:70},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:70},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:70},
|
||||||
@@ -1175,6 +1210,9 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
url: path + '/depotItem/findBy.action?HeaderId=' + depotHeadID,
|
url: path + '/depotItem/findBy.action?HeaderId=' + depotHeadID,
|
||||||
|
data: {
|
||||||
|
mpList: mPropertyList
|
||||||
|
},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
var AllPrice = TotalPrice;
|
var AllPrice = TotalPrice;
|
||||||
|
|||||||
@@ -170,38 +170,38 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div title="扩展信息" style="padding:20px;">
|
<div title="扩展信息" style="padding:20px;">
|
||||||
<table>
|
<table class="tb-other-info">
|
||||||
<tr>
|
<tr class="tr-color">
|
||||||
<td style="width:60px; height:30px;">颜色</td>
|
<td style="width:60px; height:30px;">颜色</td>
|
||||||
<td style="padding:5px">
|
<td style="padding:5px">
|
||||||
<input name="Color" id="Color" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
|
<input name="Color" id="Color" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="tr-standard">
|
||||||
<td>规格</td>
|
<td>规格</td>
|
||||||
<td style="padding:5px">
|
<td style="padding:5px">
|
||||||
<input name="Standard" id="Standard" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
|
<input name="Standard" id="Standard" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="tr-mfrs">
|
||||||
<td>制造商</td>
|
<td>制造商</td>
|
||||||
<td style="padding:5px">
|
<td style="padding:5px">
|
||||||
<input name="Mfrs" id="Mfrs" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
|
<input name="Mfrs" id="Mfrs" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="tr-otherField1">
|
||||||
<td>自定义1</td>
|
<td>自定义1</td>
|
||||||
<td style="padding:5px">
|
<td style="padding:5px">
|
||||||
<input name="OtherField1" id="OtherField1" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
|
<input name="OtherField1" id="OtherField1" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="tr-otherField2">
|
||||||
<td>自定义2</td>
|
<td>自定义2</td>
|
||||||
<td style="padding:5px">
|
<td style="padding:5px">
|
||||||
<input name="OtherField2" id="OtherField2" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
|
<input name="OtherField2" id="OtherField2" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="tr-otherField3">
|
||||||
<td>自定义3</td>
|
<td>自定义3</td>
|
||||||
<td style="padding:5px">
|
<td style="padding:5px">
|
||||||
<input name="OtherField3" id="OtherField3" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
|
<input name="OtherField3" id="OtherField3" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
|
||||||
@@ -252,10 +252,12 @@
|
|||||||
var setCategoryId="1";
|
var setCategoryId="1";
|
||||||
var cid=1;
|
var cid=1;
|
||||||
var multiple = 0; //倍数
|
var multiple = 0; //倍数
|
||||||
|
var mPropertyList = null; //商品属性列表
|
||||||
//初始化界面
|
//初始化界面
|
||||||
$(function()
|
$(function()
|
||||||
{
|
{
|
||||||
//初始化系统基础信息
|
//初始化系统基础信息
|
||||||
|
initMProperty();
|
||||||
initSystemData(1);
|
initSystemData(1);
|
||||||
initSelectInfo("search_first");
|
initSelectInfo("search_first");
|
||||||
initSelectInfo("edit_first");
|
initSelectInfo("edit_first");
|
||||||
@@ -268,6 +270,23 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
//初始化系统基础信息
|
//初始化系统基础信息
|
||||||
|
function initMProperty() {
|
||||||
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: "<%=path%>/materialProperty/findBy.action",
|
||||||
|
dataType: "json",
|
||||||
|
success: function (res) {
|
||||||
|
if (res && res.rows) {
|
||||||
|
mPropertyList = res.rows; //属性列表
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//此处添加错误处理
|
||||||
|
error:function() {
|
||||||
|
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
function initSystemData(parentid_search) {
|
function initSystemData(parentid_search) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
@@ -921,10 +940,92 @@
|
|||||||
var oldUnit = "";
|
var oldUnit = "";
|
||||||
var oldManyUnit = "";
|
var oldManyUnit = "";
|
||||||
|
|
||||||
function addMaterial()
|
//根据商品属性架子啊
|
||||||
{
|
function bindMProperty(){
|
||||||
|
var trColor = $(".tr-color").html();
|
||||||
|
trColor = '<tr class="tr-color">' + trColor + '</tr>';
|
||||||
|
var trStandard = $(".tr-standard").html();
|
||||||
|
trStandard = '<tr class="tr-standard">' + trStandard + '</tr>';
|
||||||
|
var trMfrs = $(".tr-mfrs").html();
|
||||||
|
trMfrs = '<tr class="tr-mfrs">' + trMfrs + '</tr>';
|
||||||
|
var trOtherField1 = $(".tr-otherField1").html();
|
||||||
|
trOtherField1 = '<tr class="tr-otherField1">' + trOtherField1 + '</tr>';
|
||||||
|
var trOtherField2 = $(".tr-otherField2").html();
|
||||||
|
trOtherField2 = '<tr class="tr-otherField2">' + trOtherField2 + '</tr>';
|
||||||
|
var trOtherField3 = $(".tr-otherField3").html();
|
||||||
|
trOtherField3 = '<tr class="tr-otherField3">' + trOtherField3 + '</tr>';
|
||||||
|
//表格模板变更
|
||||||
|
$(".tb-other-info").html("");
|
||||||
|
for(var i=0; i < mPropertyList.length; i++) {
|
||||||
|
if(mPropertyList[i].nativeName === "颜色"){
|
||||||
|
$(".tb-other-info").append(trColor);
|
||||||
|
$(".tr-color td").first().text(mPropertyList[i].anotherName);
|
||||||
|
if(mPropertyList[i].enabled) {
|
||||||
|
$(".tr-color").show();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$(".tr-color").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mPropertyList[i].nativeName === "规格"){
|
||||||
|
$(".tb-other-info").append(trStandard);
|
||||||
|
$(".tr-standard td").first().text(mPropertyList[i].anotherName);
|
||||||
|
if(mPropertyList[i].enabled) {
|
||||||
|
$(".tr-standard").show();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$(".tr-standard").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mPropertyList[i].nativeName === "制造商"){
|
||||||
|
$(".tb-other-info").append(trMfrs);
|
||||||
|
$(".tr-mfrs td").first().text(mPropertyList[i].anotherName);
|
||||||
|
if(mPropertyList[i].enabled) {
|
||||||
|
$(".tr-mfrs").show();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$(".tr-mfrs").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mPropertyList[i].nativeName === "自定义1"){
|
||||||
|
$(".tb-other-info").append(trOtherField1);
|
||||||
|
$(".tr-otherField1 td").first().text(mPropertyList[i].anotherName);
|
||||||
|
if(mPropertyList[i].enabled) {
|
||||||
|
$(".tr-otherField1").show();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$(".tr-otherField1").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mPropertyList[i].nativeName === "自定义2"){
|
||||||
|
$(".tb-other-info").append(trOtherField2);
|
||||||
|
$(".tr-otherField2 td").first().text(mPropertyList[i].anotherName);
|
||||||
|
if(mPropertyList[i].enabled) {
|
||||||
|
$(".tr-otherField2").show();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$(".tr-otherField2").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mPropertyList[i].nativeName === "自定义3"){
|
||||||
|
$(".tb-other-info").append(trOtherField3);
|
||||||
|
$(".tr-otherField3 td").first().text(mPropertyList[i].anotherName);
|
||||||
|
if(mPropertyList[i].enabled) {
|
||||||
|
$(".tr-otherField3").show();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$(".tr-otherField3").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function addMaterial() {
|
||||||
$("#clientIp").val('<%=clientIp %>');
|
$("#clientIp").val('<%=clientIp %>');
|
||||||
$('#materialFM').form('clear');
|
$('#materialFM input').val(""); //将输入框全部清空
|
||||||
|
|
||||||
|
bindMProperty(); //根据商品属性绑定
|
||||||
|
|
||||||
$('#materialDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加商品信息');
|
$('#materialDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加商品信息');
|
||||||
$(".window-mask").css({ width: webW ,height: webH});
|
$(".window-mask").css({ width: webW ,height: webH});
|
||||||
$("#Name").val("").focus();
|
$("#Name").val("").focus();
|
||||||
@@ -1121,6 +1222,9 @@
|
|||||||
var materialInfo = materialTotalInfo.split("AaBb");
|
var materialInfo = materialTotalInfo.split("AaBb");
|
||||||
|
|
||||||
$("#clientIp").val('<%=clientIp %>');
|
$("#clientIp").val('<%=clientIp %>');
|
||||||
|
|
||||||
|
bindMProperty(); //根据商品属性绑定
|
||||||
|
|
||||||
$("#Name").focus().val(materialInfo[1]);
|
$("#Name").focus().val(materialInfo[1]);
|
||||||
$("#Color").focus().val(materialInfo[11]);
|
$("#Color").focus().val(materialInfo[11]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user