diff --git a/docs/jsh_erp(后续更新参考这个更新).sql b/docs/jsh_erp(后续更新参考这个更新).sql index 7667405b..497750ab 100644 --- a/docs/jsh_erp(后续更新参考这个更新).sql +++ b/docs/jsh_erp(后续更新参考这个更新).sql @@ -1683,4 +1683,11 @@ INSERT INTO `jsh_tenant` VALUES ('13', '63', 'jsh', '20', '2000', null); -- 时间:2019年7月10日 -- 删除函数 -- ---------------------------- -DROP FUNCTION IF EXISTS `_nextval`; \ No newline at end of file +DROP FUNCTION IF EXISTS `_nextval`; + +-- ---------------------------- +-- 时间:2019年8月1日 +-- 增加仓库和客户的启用标记 +-- ---------------------------- +alter table jsh_systemconfig add customer_flag varchar(1) DEFAULT '0' COMMENT '客户启用标记,0未启用,1启用' after company_post_code; +alter table jsh_systemconfig add depot_flag varchar(1) DEFAULT '0' COMMENT '仓库启用标记,0未启用,1启用' after company_post_code; diff --git a/docs/jsh_erp(第一次建库请使用这个).sql b/docs/jsh_erp(第一次建库请使用这个).sql index 4f287c05..58b5aa00 100644 --- a/docs/jsh_erp(第一次建库请使用这个).sql +++ b/docs/jsh_erp(第一次建库请使用这个).sql @@ -1700,6 +1700,8 @@ CREATE TABLE `jsh_systemconfig` ( `company_tel` varchar(20) DEFAULT NULL COMMENT '公司电话', `company_fax` varchar(20) DEFAULT NULL COMMENT '公司传真', `company_post_code` varchar(20) DEFAULT NULL COMMENT '公司邮编', + `depot_flag` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '仓库启用标记,0未启用,1启用' , + `customer_flag` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '客户启用标记,0未启用,1启用' , `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', `delete_Flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', PRIMARY KEY (`id`) diff --git a/erp_web/js/common/common.js b/erp_web/js/common/common.js index 3c65679c..ea005f17 100644 --- a/erp_web/js/common/common.js +++ b/erp_web/js/common/common.js @@ -73,6 +73,39 @@ } } + /** + * 获取公司信息 + */ + function getSystemConfig() { + var info = null; + $.ajax({ + type:"get", + url: "/systemConfig/list", + dataType: "json", + data: ({ + currentPage: 1, + pageSize: 100 + }), + async: false, + success: function (res) { + if (res && res.code === 200) { + if(res.data && res.data.page) { + var array = res.data.page.rows; + if(array.length > 0) { + info = array[0]; + } + } + } + }, + //此处添加错误处理 + error:function() { + $.messager.alert('查询失败','查询系统配置信息异常,请稍后再试!','error'); + return; + } + }); + return info; + } + /** * js生成唯一ID值 32位值随机值 * @returns 生成的字符串 diff --git a/erp_web/js/print/print.js b/erp_web/js/print/print.js index 2465b50d..47fda471 100644 --- a/erp_web/js/print/print.js +++ b/erp_web/js/print/print.js @@ -6,35 +6,11 @@ function CreateFormPage(strPrintName, printDatagrid) { var getMonth= $("#searchMonth").val(); var listTitle = $("#tablePanel").prev().text(); listTitle = listTitle.replace("列表",""); + var config = getSystemConfig(); var companyName = ""; - //加载公司信息 - $.ajax({ - type:"get", - url: "/systemConfig/list", - dataType: "json", - data: ({ - currentPage: 1, - pageSize: 100 - }), - async: false, - success: function (res) { - if (res && res.code === 200) { - if(res.data && res.data.page) { - var array = res.data.page.rows; - if(array.length > 0) { - var info = array[0]; - companyName = info.companyName; - } - } - } - }, - //此处添加错误处理 - error:function() { - $.messager.alert('查询失败','查询系统配置信息异常,请稍后再试!','error'); - return; - } - }); - + if(config) { + companyName = config.companyName; + } var tableString = '
' + companyName + "-" + listTitle + '\n
'; if(beginDate && endDate) { tableString+='\n
日期:' + beginDate + ' 至 ' + endDate + ' \n
'; diff --git a/erp_web/pages/manage/systemConfig.html b/erp_web/pages/manage/systemConfig.html index 9c9718fe..c5e8ca00 100644 --- a/erp_web/pages/manage/systemConfig.html +++ b/erp_web/pages/manage/systemConfig.html @@ -70,6 +70,14 @@ +
+ + +
+
+ + +
@@ -86,6 +94,16 @@ //初始化表格数据 function initTableData() { + function parseFlag(value) { + var flagName = ""; + if (value =="1") { + flagName = "启用"; + } + else { + flagName = "关闭"; + } + 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 += ' 编辑  '; str += ' 删除  '; 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]; } diff --git a/erp_web/pages/manage/user.html b/erp_web/pages/manage/user.html index 50fcfa3a..bfa5c097 100644 --- a/erp_web/pages/manage/user.html +++ b/erp_web/pages/manage/user.html @@ -113,11 +113,27 @@