diff --git a/erp_web/js/pages/materials/add_temp.js b/erp_web/js/pages/materials/add_temp.js
index 84db3a3e..c7886143 100644
--- a/erp_web/js/pages/materials/add_temp.js
+++ b/erp_web/js/pages/materials/add_temp.js
@@ -1,10 +1,10 @@
-$.get("../../pages/template/base.html", function(tem) {
+$.get("../../pages/template/base.html?999", function(tem) {
if(tem) {
var template = Handlebars.compile(tem);
/**
* 加载供应商、客户模块
*/
- $("body").append(template({
+ $("#supplier").html(template({
supplierSelect: true
}));
$('#supplierDlg').dialog({
@@ -24,12 +24,38 @@ $.get("../../pages/template/base.html", function(tem) {
min:0,
precision:2
});
-
$("#saveSupplier").linkbutton({
iconCls: 'icon-ok'
});
$("#cancelSupplier").linkbutton({
iconCls: 'icon-cancel'
});
+
+ /**
+ * 加载仓库
+ */
+ $("#depot").html(template({
+ depotSelect: true
+ }));
+ $('#depotDlg').dialog({
+ closed: true,
+ modal: true,
+ collapsible: false,
+ closable: true
+ });
+ $("#depotDlg #name,#depotDlg #address").validatebox({
+ required: true,
+ validType: 'length[2,30]'
+ });
+ $("#depotDlg #warehousing,#depotDlg #truckage").numberbox({
+ min:0,
+ precision:2
+ });
+ $("#saveDepot").linkbutton({
+ iconCls: 'icon-ok'
+ });
+ $("#cancelDepot").linkbutton({
+ iconCls: 'icon-cancel'
+ });
}
});
\ No newline at end of file
diff --git a/erp_web/js/pages/materials/in_out.js b/erp_web/js/pages/materials/in_out.js
index 6d9686cc..c0139f1c 100644
--- a/erp_web/js/pages/materials/in_out.js
+++ b/erp_web/js/pages/materials/in_out.js
@@ -216,9 +216,7 @@
}
//初始化页面选项卡
function initSelectInfo_depot(){
- var options = "";
if(depotList !=null) {
- options = "";
for(var i = 0 ;i < depotList.length;i++) {
var depot = depotList[i];
var config = getSystemConfig();
@@ -228,7 +226,6 @@
if(depot.isDefault){
defDepotId = depot.id;
}
- options += '';
depotString = depotString + depot.id + ",";
}
}
@@ -243,9 +240,6 @@
}
}
depotString = depotString.substring(1, depotString.length-1);
- $("#ProjectId").empty().append(options);
- $("#AllocationProjectId").empty().append(options);
- $("#searchProjectId").empty().append('').append(options);
}
}
@@ -3012,7 +3006,78 @@
}
//新增仓库
function appendDepot() {
- alert("新增仓库");
+ $('#depotDlg').dialog('open').dialog('setTitle', '
增加仓库信息');
+ $(".window-mask").css({width: webW, height: webH});
+ $('#depotFM').form('clear');
+ $("#depotFM #name").focus();
+ $("#selectType").val("principal");
+ oldDepot = "";
+ depotID = 0;
+ url = '/depot/add';
+ //检查名称是否存在 ++ 重名无法提示问题需要跟进
+ function checkDepotName() {
+ var name = $.trim($("#name").val());
+ //表示是否存在 true == 存在 false = 不存在
+ var flag = false;
+ //开始ajax名称检验,不能重名
+ if (name.length > 0 && (oldDepot.length == 0 || name != oldDepot)) {
+ $.ajax({
+ type: "get",
+ url: "/depot/checkIsNameExist",
+ dataType: "json",
+ async: false,
+ data: ({
+ id: depotID,
+ name: name
+ }),
+ success: function (res) {
+ if(res && res.code === 200) {
+ if(res.data && res.data.status) {
+ flag = res.data.status;
+ if (flag) {
+ $.messager.alert('提示', '仓库名称已经存在', 'info');
+ return;
+ }
+ }
+ }
+ },
+ //此处添加错误处理
+ error: function () {
+ $.messager.alert('提示', '检查仓库名称是否存在异常,请稍后再试!', 'error');
+ return;
+ }
+ });
+ }
+ return flag;
+ }
+ $("#saveDepot").off("click").on("click", function () {
+ var infoObj = $("#depotFM").serializeObject();
+ infoObj.type = 0;
+ if (checkDepotName()) {
+ return;
+ }
+ $.ajax({
+ url: url,
+ type: "post",
+ dataType: "json",
+ data: ({
+ info: JSON.stringify(infoObj)
+ }),
+ success: function(res) {
+ if(res && res.code === 200) {
+ $('#depotDlg').dialog('close');
+ //加载完以后重新初始化
+ var opts = $("#tableData").datagrid('options');
+ showDepotDetails(opts.pageNumber, opts.pageSize);
+ }
+ },
+ //此处添加错误处理
+ error: function () {
+ $.messager.alert('提示', '保存仓库信息异常,请稍后再试!', 'error');
+ return;
+ }
+ });
+ });
}
//新增商品
function appendMaterial() {
diff --git a/erp_web/pages/materials/purchase_in_list.html b/erp_web/pages/materials/purchase_in_list.html
index d31e2287..f3e8655d 100644
--- a/erp_web/pages/materials/purchase_in_list.html
+++ b/erp_web/pages/materials/purchase_in_list.html
@@ -282,5 +282,7 @@
保存
取消
+