增加仓库和客户配置开关(完成1阶段)
This commit is contained in:
@@ -70,6 +70,14 @@
|
||||
<label id="companyPostCodeLabel">公司邮编 </label>
|
||||
<input name="companyPostCode" id="companyPostCode" style="width: 220px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="depotFlagLabel">仓库开关 </label>
|
||||
<input name="depotFlag" id="depotFlag" type="checkbox" style="width: 220px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="customerFlagLabel">客户开关 </label>
|
||||
<input name="customerFlag" id="customerFlag" type="checkbox" style="width: 220px;height: 20px"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
@@ -86,6 +94,16 @@
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData() {
|
||||
function parseFlag(value) {
|
||||
var flagName = "";
|
||||
if (value =="1") {
|
||||
flagName = "<span style='color:green'>启用</span>";
|
||||
}
|
||||
else {
|
||||
flagName = "<span style='color:red'>关闭</span>";
|
||||
}
|
||||
return flagName;
|
||||
}
|
||||
$('#tableData').datagrid({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
@@ -108,11 +126,24 @@
|
||||
{title: '公司电话', field: 'companyTel', width: 120, align: "center"},
|
||||
{title: '公司传真', field: 'companyFax', width: 120, align: "center"},
|
||||
{title: '公司邮编', field: 'companyPostCode', width: 80, align: "center"},
|
||||
{
|
||||
title: '仓库开关', field: 'depotFlag', width: 80, align: "center",
|
||||
formatter: function (value) {
|
||||
return parseFlag(value);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '客户开关', field: 'customerFlag', width: 80, align: "center",
|
||||
formatter: function (value) {
|
||||
return parseFlag(value);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作', field: 'op', width: 160, formatter: function (value, rec) {
|
||||
var str = '';
|
||||
var rowInfo = rec.id + 'AaBb' + rec.companyName + 'AaBb' + rec.companyContacts + 'AaBb' + rec.companyAddress
|
||||
+ 'AaBb' + rec.companyTel + 'AaBb' + rec.companyFax + 'AaBb' + rec.companyPostCode;
|
||||
+ 'AaBb' + rec.companyTel + 'AaBb' + rec.companyFax + 'AaBb' + rec.companyPostCode
|
||||
+ 'AaBb' + rec.depotFlag + 'AaBb' + rec.customerFlag;
|
||||
str += '<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editSystemConfig(\'' + rowInfo + '\');"/> <a onclick="editSystemConfig(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteSystemConfig(' + rec.id + ');"/> <a onclick="deleteSystemConfig(' + rec.id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
return str;
|
||||
@@ -298,12 +329,15 @@
|
||||
$("#companyName").val("").focus();
|
||||
return;
|
||||
}
|
||||
var infoObj = $("#systemConfigFM").serializeObject();
|
||||
infoObj.depotFlag = $("#depotFlag").is(':checked')?"1":"0";
|
||||
infoObj.customerFlag = $("#customerFlag").is(':checked')?"1":"0";
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
info: JSON.stringify($("#systemConfigFM").serializeObject())
|
||||
info: JSON.stringify(infoObj)
|
||||
},
|
||||
success: function(res) {
|
||||
if(res && res.code === 200) {
|
||||
@@ -339,6 +373,8 @@
|
||||
systemConfigId = systemConfigInfo[0];
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
$("#companyName").val("").focus().val(systemConfigInfo[1]);
|
||||
$("#depotFlag").attr("checked", systemConfigInfo[7] == '1' ? true : false);
|
||||
$("#customerFlag").attr("checked", systemConfigInfo[8] == '1' ? true : false);
|
||||
url = '/systemConfig/update?id=' + systemConfigInfo[0];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user