From 9405f29aedbbac76f32c131b59dcc9f3ab7e0732 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com>
Date: Sun, 3 Nov 2019 00:12:16 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=93=E7=AE=97=E8=B4=A6?=
=?UTF-8?q?=E6=88=B7=E5=9C=A8=E5=8D=95=E6=8D=AE=E7=95=8C=E9=9D=A2=E7=9A=84?=
=?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
erp_web/js/pages/materials/add_temp.js | 253 +++++++++++++++++-
erp_web/js/pages/materials/in_out.js | 167 +-----------
.../pages/materials/allocation_out_list.html | 2 +
erp_web/pages/materials/assemble_list.html | 2 +
erp_web/pages/materials/disassemble_list.html | 1 +
erp_web/pages/materials/other_in_list.html | 2 +
erp_web/pages/materials/other_out_list.html | 2 +
.../pages/materials/purchase_back_list.html | 6 +-
erp_web/pages/materials/purchase_in_list.html | 6 +-
.../pages/materials/purchase_orders_list.html | 1 +
erp_web/pages/materials/retail_back_list.html | 2 +
erp_web/pages/materials/retail_out_list.html | 2 +
erp_web/pages/materials/sale_back_list.html | 6 +-
erp_web/pages/materials/sale_orders_list.html | 1 +
erp_web/pages/materials/sale_out_list.html | 15 +-
erp_web/pages/template/base.html | 32 +++
16 files changed, 330 insertions(+), 170 deletions(-)
diff --git a/erp_web/js/pages/materials/add_temp.js b/erp_web/js/pages/materials/add_temp.js
index b5a06bd3..341c60e7 100644
--- a/erp_web/js/pages/materials/add_temp.js
+++ b/erp_web/js/pages/materials/add_temp.js
@@ -57,5 +57,256 @@ $.get("../../pages/template/base.html?789", function(tem) {
$("#cancelDepot").linkbutton({
iconCls: 'icon-cancel'
});
+
+ /**
+ * 加载账户
+ */
+ $("#account").html(template({
+ accountSelect: true
+ }));
+ $('#accountDlg').dialog({
+ closed: true,
+ modal: true,
+ collapsible: false,
+ closable: true
+ });
+ $("#accountDlg #name,#accountDlg #serialNo").validatebox({
+ required: true,
+ validType: 'length[2,30]'
+ });
+ $("#accountDlg #initialAmount").numberbox({
+ min:0,
+ precision:2
+ });
+ $("#saveAccount").linkbutton({
+ iconCls: 'icon-ok'
+ });
+ $("#cancelAccount").linkbutton({
+ iconCls: 'icon-cancel'
+ });
}
-});
\ No newline at end of file
+});
+
+//绑定供应商、客户事件
+function bindSupplierEvent() {
+ if(listTitle === "采购入库列表" || listTitle === "其它入库列表" || listTitle === "采购订单列表"
+ || listTitle === "零售出库列表"|| listTitle === "销售出库列表"|| listTitle === "销售订单列表"){
+ var supplierType = "供应商";
+ if(listTitle === "零售出库列表"){
+ supplierType = "会员";
+ }else if(listTitle === "销售出库列表" || listTitle === "销售订单列表"){
+ supplierType = "客户";
+ }
+ //检查单位名称是否存在 ++ 重名无法提示问题需要跟进
+ function checkSupplierName() {
+ var supplierName = $.trim($("#supplier").val());
+ var orgSupplier = "";
+ //表示是否存在 true == 存在 false = 不存在
+ var flag = false;
+ //开始ajax名称检验,不能重名
+ if(supplierName.length > 0 &&( orgSupplier.length ==0 || supplierName != orgSupplier))
+ {
+ $.ajax({
+ type:"get",
+ url: "/supplier/checkIsNameExist",
+ dataType: "json",
+ async : false,
+ data: ({
+ id : 0,
+ name : supplierName
+ }),
+ 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;
+ }
+
+ //保存供应商信息
+ $("#saveSupplier").off("click").on("click",function() {
+ if(validateForm("supplierFM")) {
+ return;
+ }
+ if(checkSupplierName()){
+ return;
+ }
+ var reg = /^([0-9])+$/;
+ var phonenum = $.trim($("#phonenum").val());
+ if(phonenum.length>0 && !reg.test(phonenum))
+ {
+ $.messager.alert('提示','电话号码只能是数字','info');
+ $("#phonenum").val("").focus();
+ return;
+ }
+ var beginNeedGet = $.trim($("#BeginNeedGet").val());
+ var beginNeedPay = $.trim($("#BeginNeedPay").val());
+ if(beginNeedGet && beginNeedPay) {
+ $.messager.alert('提示','期初应收和期初应付不能同时输入','info');
+ return;
+ }
+ var url = '/supplier/add';
+ var supObj = $("#supplierFM").serializeObject();
+ supObj.type = supplierType;
+ supObj.enabled = 1;
+ $.ajax({
+ url: url,
+ type:"post",
+ dataType: "json",
+ data:{
+ info: JSON.stringify(supObj)
+ },
+ success: function(res) {
+ if (res) {
+ $('#supplierDlg').dialog('close');
+ initSupplier(); //刷新供应商
+ }
+ }
+ });
+ });
+ }
+}
+
+//绑定仓库事件
+function bindDepotEvent() {
+ $("#depotFM #name").focus();
+ $("#selectType").val("principal");
+ //检查名称是否存在 ++ 重名无法提示问题需要跟进
+ function checkDepotName() {
+ var name = $.trim($("#depotDlg #name").val());
+ //表示是否存在 true == 存在 false = 不存在
+ var flag = false;
+ //开始ajax名称检验,不能重名
+ if (name.length > 0) {
+ $.ajax({
+ type: "get",
+ url: "/depot/checkIsNameExist",
+ dataType: "json",
+ async: false,
+ data: ({
+ id: 0,
+ 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: "/depot/add",
+ type: "post",
+ dataType: "json",
+ data: ({
+ info: JSON.stringify(infoObj)
+ }),
+ success: function(res) {
+ if(res && res.code === 200) {
+ $('#depotDlg').dialog('close');
+ }
+ },
+ //此处添加错误处理
+ error: function () {
+ $.messager.alert('提示', '保存仓库信息异常,请稍后再试!', 'error');
+ return;
+ }
+ });
+ });
+}
+
+//绑定账户事件
+function bindAccountEvent() {
+ function checkAccountName() {
+ var accountName = $.trim($("#accountDlg #name").val());
+ //表示是否存在 true == 存在 false = 不存在
+ var flag = false;
+ //开始ajax名称检验,不能重名
+ if (accountName.length > 0) {
+ $.ajax({
+ type: "get",
+ url: "/account/checkIsNameExist",
+ dataType: "json",
+ async: false,
+ data: ({
+ id: 0,
+ name: accountName
+ }),
+ 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;
+ }
+ //保存结算账户
+ $("#saveAccount").off("click").on("click", function () {
+ if (checkAccountName()) {
+ return;
+ }
+ $.ajax({
+ url: '/account/add',
+ type: "post",
+ dataType: "json",
+ data: ({
+ info: JSON.stringify($("#accountFM").serializeObject())
+ }),
+ success: function(res) {
+ if(res && res.code === 200) {
+ $('#accountDlg').dialog('close');
+ initSystemData_account(); //刷新账户
+ }
+ },
+ //此处添加错误处理
+ error: function () {
+ $.messager.alert('提示', '保存结算账户异常,请稍后再试!', 'error');
+ return;
+ }
+ });
+ });
+}
\ 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 baf39217..175c9740 100644
--- a/erp_web/js/pages/materials/in_out.js
+++ b/erp_web/js/pages/materials/in_out.js
@@ -1042,7 +1042,8 @@
text:'新增商品',
iconCls:'icon-add',
handler:function() {
- appendMaterial(); //新增商品
+ js.addTabPage(null, "商品信息", "/pages/materials/material.html");
+ // appendMaterial(); //新增商品
}
}
],
@@ -1454,7 +1455,9 @@
supplierDlgFun("客户");
});
$("#addAccount").off("click").on("click",function(){
- alert("增加结算账户");
+ $('#accountDlg').dialog('open').dialog('setTitle','
增加结算账户');
+ $('#accountFM').form('clear');
+ bindAccountEvent();
});
url = '/depotHead/addDepotHeadAndDetail';
@@ -2372,98 +2375,7 @@
});
}
- //绑定供应商、客户事件
- function bindSupplierEvent() {
- if(listTitle === "采购入库列表" || listTitle === "其它入库列表" || listTitle === "采购订单列表"
- || listTitle === "零售出库列表"|| listTitle === "销售出库列表"|| listTitle === "销售订单列表"){
- var supplierType = "供应商";
- if(listTitle === "零售出库列表"){
- supplierType = "会员";
- }else if(listTitle === "销售出库列表" || listTitle === "销售订单列表"){
- supplierType = "客户";
- }
- //检查单位名称是否存在 ++ 重名无法提示问题需要跟进
- function checkSupplierName() {
- var supplierName = $.trim($("#supplier").val());
- var orgSupplier = "";
- //表示是否存在 true == 存在 false = 不存在
- var flag = false;
- //开始ajax名称检验,不能重名
- if(supplierName.length > 0 &&( orgSupplier.length ==0 || supplierName != orgSupplier))
- {
- $.ajax({
- type:"get",
- url: "/supplier/checkIsNameExist",
- dataType: "json",
- async : false,
- data: ({
- id : 0,
- name : supplierName
- }),
- 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;
- }
- //保存供应商信息
- $("#saveSupplier").off("click").on("click",function() {
- if(validateForm("supplierFM")) {
- return;
- }
- if(checkSupplierName()){
- return;
- }
- var reg = /^([0-9])+$/;
- var phonenum = $.trim($("#phonenum").val());
- if(phonenum.length>0 && !reg.test(phonenum))
- {
- $.messager.alert('提示','电话号码只能是数字','info');
- $("#phonenum").val("").focus();
- return;
- }
- var beginNeedGet = $.trim($("#BeginNeedGet").val());
- var beginNeedPay = $.trim($("#BeginNeedPay").val());
- if(beginNeedGet && beginNeedPay) {
- $.messager.alert('提示','期初应收和期初应付不能同时输入','info');
- return;
- }
- var url = '/supplier/add';
- var supObj = $("#supplierFM").serializeObject();
- supObj.type = supplierType;
- supObj.enabled = 1;
- $.ajax({
- url: url,
- type:"post",
- dataType: "json",
- data:{
- info: JSON.stringify(supObj)
- },
- success: function(res) {
- if (res) {
- $('#supplierDlg').dialog('close');
- initSupplier(); //刷新供应商
- }
- }
- });
- });
- }
- }
//查询单据列表信息
function showDepotHeadDetails(pageNo,pageSize){
var materialParam = $.trim($("#searchMaterial").val());
@@ -2699,76 +2611,11 @@
$('#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');
- }
- },
- //此处添加错误处理
- error: function () {
- $.messager.alert('提示', '保存仓库信息异常,请稍后再试!', 'error');
- return;
- }
- });
- });
+ bindDepotEvent();
}
//新增商品
function appendMaterial() {
- alert("新增商品");
+ js.addTabPage(null, "商品信息", "/pages/materials/material.html");
}
//判断明细
function CheckData(type) {
diff --git a/erp_web/pages/materials/allocation_out_list.html b/erp_web/pages/materials/allocation_out_list.html
index 32de82b3..c560241d 100644
--- a/erp_web/pages/materials/allocation_out_list.html
+++ b/erp_web/pages/materials/allocation_out_list.html
@@ -16,6 +16,7 @@
+
@@ -132,5 +133,6 @@
取消
+