From 079fa47690449cad9c1356b5f65dab82ebadeb89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Sat, 26 Sep 2020 12:14:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8D=95=E6=8D=AE=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/jsh_erp.sql | 38 +- erp_web/js/common/common.js | 2 +- erp_web/js/pages/bill/add_temp.js | 333 ++++ erp_web/js/pages/bill/bill_detail.js | 560 +++++++ erp_web/js/pages/bill/in_out.js | 1486 ++++++++++++++++++ erp_web/pages/bill/allocation_out_list.html | 868 ++++++++++ erp_web/pages/bill/assemble_list.html | 865 ++++++++++ erp_web/pages/bill/bill_detail.html | 869 ++++++++++ erp_web/pages/bill/disassemble_list.html | 866 ++++++++++ erp_web/pages/bill/other_in_list.html | 883 +++++++++++ erp_web/pages/bill/other_out_list.html | 876 +++++++++++ erp_web/pages/bill/purchase_back_list.html | 1018 ++++++++++++ erp_web/pages/bill/purchase_in_list.html | 1036 ++++++++++++ erp_web/pages/bill/purchase_orders_list.html | 970 ++++++++++++ erp_web/pages/bill/retail_back_list.html | 1035 ++++++++++++ erp_web/pages/bill/retail_out_list.html | 1075 +++++++++++++ erp_web/pages/bill/sale_back_list.html | 1063 +++++++++++++ erp_web/pages/bill/sale_orders_list.html | 1018 ++++++++++++ erp_web/pages/bill/sale_out_list.html | 1099 +++++++++++++ erp_web/pages/manage/person.html | 453 ++++++ 20 files changed, 16393 insertions(+), 20 deletions(-) create mode 100644 erp_web/js/pages/bill/add_temp.js create mode 100644 erp_web/js/pages/bill/bill_detail.js create mode 100644 erp_web/js/pages/bill/in_out.js create mode 100644 erp_web/pages/bill/allocation_out_list.html create mode 100644 erp_web/pages/bill/assemble_list.html create mode 100644 erp_web/pages/bill/bill_detail.html create mode 100644 erp_web/pages/bill/disassemble_list.html create mode 100644 erp_web/pages/bill/other_in_list.html create mode 100644 erp_web/pages/bill/other_out_list.html create mode 100644 erp_web/pages/bill/purchase_back_list.html create mode 100644 erp_web/pages/bill/purchase_in_list.html create mode 100644 erp_web/pages/bill/purchase_orders_list.html create mode 100644 erp_web/pages/bill/retail_back_list.html create mode 100644 erp_web/pages/bill/retail_out_list.html create mode 100644 erp_web/pages/bill/sale_back_list.html create mode 100644 erp_web/pages/bill/sale_orders_list.html create mode 100644 erp_web/pages/bill/sale_out_list.html create mode 100644 erp_web/pages/manage/person.html diff --git a/docs/jsh_erp.sql b/docs/jsh_erp.sql index 8c8c4853..3156794d 100644 --- a/docs/jsh_erp.sql +++ b/docs/jsh_erp.sql @@ -3,14 +3,14 @@ Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 50704 -Source Host : 127.0.0.1:3306 +Source Host : localhost:3306 Source Database : jsh_erp Target Server Type : MYSQL Target Server Version : 50704 File Encoding : 65001 -Date: 2020-09-13 18:47:08 +Date: 2020-09-26 12:06:20 */ SET FOREIGN_KEY_CHECKS=0; @@ -337,22 +337,22 @@ INSERT INTO `jsh_function` VALUES ('23', '010102', '商品信息', '0101', '/pag INSERT INTO `jsh_function` VALUES ('24', '0102', '基本资料', '0', '', '\0', '0750', '', '电脑版', null, 'icon-grid', '0'); INSERT INTO `jsh_function` VALUES ('25', '01020101', '供应商信息', '0102', '/pages/manage/vendor.html', '\0', '0260', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('26', '010202', '仓库信息', '0102', '/pages/manage/depot.html', '\0', '0270', '', '电脑版', '1', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('31', '010206', '经手人管理', '0102', '/pages/materials/person.html', '\0', '0284', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('31', '010206', '经手人管理', '0102', '/pages/manage/person.html', '\0', '0284', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('32', '0502', '采购管理', '0', '', '\0', '0330', '', '电脑版', '', 'icon-loop', '0'); -INSERT INTO `jsh_function` VALUES ('33', '050201', '采购入库', '0502', '/pages/materials/purchase_in_list.html', '\0', '0340', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('33', '050201', '采购入库', '0502', '/pages/bill/purchase_in_list.html', '\0', '0340', '', '电脑版', '1,2', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('38', '0603', '销售管理', '0', '', '\0', '0390', '', '电脑版', '', 'icon-briefcase', '0'); -INSERT INTO `jsh_function` VALUES ('40', '080107', '调拨出库', '0801', '/pages/materials/allocation_out_list.html', '\0', '0807', '', '电脑版', '1,2', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('41', '060303', '销售出库', '0603', '/pages/materials/sale_out_list.html', '\0', '0394', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('40', '080107', '调拨出库', '0801', '/pages/bill/allocation_out_list.html', '\0', '0807', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('41', '060303', '销售出库', '0603', '/pages/bill/sale_out_list.html', '\0', '0394', '', '电脑版', '1,2', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('44', '0704', '财务管理', '0', '', '\0', '0450', '', '电脑版', '', 'icon-map', '0'); INSERT INTO `jsh_function` VALUES ('59', '030101', '库存状况', '0301', '/pages/reports/in_out_stock_report.html', '\0', '0600', '', '电脑版', '', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('194', '010204', '收支项目', '0102', '/pages/manage/inOutItem.html', '\0', '0282', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('195', '010205', '结算账户', '0102', '/pages/manage/account.html', '\0', '0283', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('197', '070402', '收入单', '0704', '/pages/financial/item_in.html', '\0', '0465', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('198', '0301', '报表查询', '0', '', '\0', '0570', '', '电脑版', null, 'icon-pie-chart', '0'); -INSERT INTO `jsh_function` VALUES ('199', '050204', '采购退货', '0502', '/pages/materials/purchase_back_list.html', '\0', '0345', '', '电脑版', '1,2', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('200', '060305', '销售退货', '0603', '/pages/materials/sale_back_list.html', '\0', '0396', '', '电脑版', '1,2', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('201', '080103', '其它入库', '0801', '/pages/materials/other_in_list.html', '\0', '0803', '', '电脑版', '1,2', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('202', '080105', '其它出库', '0801', '/pages/materials/other_out_list.html', '\0', '0805', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('199', '050204', '采购退货', '0502', '/pages/bill/purchase_back_list.html', '\0', '0345', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('200', '060305', '销售退货', '0603', '/pages/bill/sale_back_list.html', '\0', '0396', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('201', '080103', '其它入库', '0801', '/pages/bill/other_in_list.html', '\0', '0803', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('202', '080105', '其它出库', '0801', '/pages/bill/other_out_list.html', '\0', '0805', '', '电脑版', '1,2', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('203', '070403', '支出单', '0704', '/pages/financial/item_out.html', '\0', '0470', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('204', '070404', '收款单', '0704', '/pages/financial/money_in.html', '\0', '0475', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('205', '070405', '付款单', '0704', '/pages/financial/money_out.html', '\0', '0480', '', '电脑版', '1', 'icon-notebook', '0'); @@ -360,8 +360,8 @@ INSERT INTO `jsh_function` VALUES ('206', '070406', '转账单', '0704', '/pages INSERT INTO `jsh_function` VALUES ('207', '030102', '账户统计', '0301', '/pages/reports/account_report.html', '\0', '0610', '', '电脑版', '', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('208', '030103', '进货统计', '0301', '/pages/reports/buy_in_report.html', '\0', '0620', '', '电脑版', '', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('209', '030104', '销售统计', '0301', '/pages/reports/sale_out_report.html', '\0', '0630', '', '电脑版', '', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('210', '040102', '零售出库', '0401', '/pages/materials/retail_out_list.html', '\0', '0405', '', '电脑版', '1,2', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('211', '040104', '零售退货', '0401', '/pages/materials/retail_back_list.html', '\0', '0407', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('210', '040102', '零售出库', '0401', '/pages/bill/retail_out_list.html', '\0', '0405', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('211', '040104', '零售退货', '0401', '/pages/bill/retail_back_list.html', '\0', '0407', '', '电脑版', '1,2', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('212', '070407', '收预付款', '0704', '/pages/financial/advance_in.html', '\0', '0495', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('217', '01020102', '客户信息', '0102', '/pages/manage/customer.html', '\0', '0262', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('218', '01020103', '会员信息', '0102', '/pages/manage/member.html', '\0', '0263', '', '电脑版', '1', 'icon-notebook', '0'); @@ -371,16 +371,16 @@ INSERT INTO `jsh_function` VALUES ('226', '030106', '入库明细', '0301', '/pa INSERT INTO `jsh_function` VALUES ('227', '030107', '出库明细', '0301', '/pages/reports/out_detail.html', '\0', '0645', '', '电脑版', '', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('228', '030108', '入库汇总', '0301', '/pages/reports/in_material_count.html', '\0', '0650', '', '电脑版', '', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('229', '030109', '出库汇总', '0301', '/pages/reports/out_material_count.html', '\0', '0655', '', '电脑版', '', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('232', '080109', '组装单', '0801', '/pages/materials/assemble_list.html', '\0', '0809', '', '电脑版', '1,2', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('233', '080111', '拆卸单', '0801', '/pages/materials/disassemble_list.html', '\0', '0811', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('232', '080109', '组装单', '0801', '/pages/bill/assemble_list.html', '\0', '0809', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('233', '080111', '拆卸单', '0801', '/pages/bill/disassemble_list.html', '\0', '0811', '', '电脑版', '1,2', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('234', '000105', '系统配置', '0001', '/pages/manage/systemConfig.html', '\0', '0165', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('235', '030110', '客户对账', '0301', '/pages/reports/customer_account.html', '\0', '0660', '', '电脑版', '', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('236', '000106', '商品属性', '0001', '/pages/materials/materialProperty.html', '\0', '0168', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('237', '030111', '供应商对账', '0301', '/pages/reports/vendor_account.html', '\0', '0665', '', '电脑版', '', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('239', '0801', '仓库管理', '0', '', '\0', '0420', '', '电脑版', '', 'icon-layers', '0'); INSERT INTO `jsh_function` VALUES ('240', '010104', '序列号', '0101', '/pages/manage/serialNumber.html', '\0', '0246', '', '电脑版', '1', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('241', '050202', '采购订单', '0502', '/pages/materials/purchase_orders_list.html', '\0', '0335', '', '电脑版', '1,2', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('242', '060301', '销售订单', '0603', '/pages/materials/sale_orders_list.html', '\0', '0392', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('241', '050202', '采购订单', '0502', '/pages/bill/purchase_orders_list.html', '\0', '0335', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('242', '060301', '销售订单', '0603', '/pages/bill/sale_orders_list.html', '\0', '0392', '', '电脑版', '1,2', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('243', '000108', '机构管理', '0001', '/pages/manage/organization.html', '', '0150', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('244', '030112', '库存预警', '0301', '/pages/reports/stock_warning_report.html', '\0', '0670', '', '电脑版', '', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('245', '000107', '插件管理', '0001', '/pages/manage/plugin.html', '\0', '0170', '', '电脑版', '1', 'icon-notebook', '0'); @@ -421,7 +421,7 @@ CREATE TABLE `jsh_log` ( `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', PRIMARY KEY (`id`), KEY `FKF2696AA13E226853` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=6798 DEFAULT CHARSET=utf8 COMMENT='操作日志'; +) ENGINE=InnoDB AUTO_INCREMENT=6800 DEFAULT CHARSET=utf8 COMMENT='操作日志'; -- ---------------------------- -- Records of jsh_log @@ -464,7 +464,7 @@ INSERT INTO `jsh_material` VALUES ('570', '17', '商品3', '', '300.000000', 'sp INSERT INTO `jsh_material` VALUES ('577', null, '商品8', '', null, 'sp8', '', '', '', '', '15', '', '', '', '', '0', '63', '0'); INSERT INTO `jsh_material` VALUES ('579', '21', '商品17', '', null, 'sp17', '', '', '', '', '15', '', '', '', '', '0', '63', '0'); INSERT INTO `jsh_material` VALUES ('586', '17', '序列号商品测试', '', null, 'xlh123', '', '', '个', '', null, '', '', '', '', '1', '63', '0'); -INSERT INTO `jsh_material` VALUES ('587', '17', '商品test1', '南通中远', null, '', 'test1', '', '个', '', null, '\0', '', '', '', '0', '63', '0'); +INSERT INTO `jsh_material` VALUES ('587', '17', '商品test1', '南通中远', null, '', 'test1', '', '个', '', null, '', '', '', '', '0', '63', '0'); INSERT INTO `jsh_material` VALUES ('588', '21', '商品200', '', '112.000000', '', '300ml', '', '个', '', null, '', '', '', '', '0', '63', '0'); -- ---------------------------- @@ -736,7 +736,7 @@ CREATE TABLE `jsh_sequence` ( -- ---------------------------- -- Records of jsh_sequence -- ---------------------------- -INSERT INTO `jsh_sequence` VALUES ('depot_number_seq', '1', '999999999999999999', '352', '1', '单据编号sequence'); +INSERT INTO `jsh_sequence` VALUES ('depot_number_seq', '1', '999999999999999999', '353', '1', '单据编号sequence'); -- ---------------------------- -- Table structure for jsh_serial_number diff --git a/erp_web/js/common/common.js b/erp_web/js/common/common.js index 29ba0be5..bd5e071c 100644 --- a/erp_web/js/common/common.js +++ b/erp_web/js/common/common.js @@ -415,7 +415,7 @@ } function turnBillDetailPage(number, type) { - js.addTabPage(null, "单据明细", "/pages/materials/bill_detail.html?n="+ number + "&type=" + type); + js.addTabPage(null, "单据明细", "/pages/bill/bill_detail.html?n="+ number + "&type=" + type); } /** diff --git a/erp_web/js/pages/bill/add_temp.js b/erp_web/js/pages/bill/add_temp.js new file mode 100644 index 00000000..78402957 --- /dev/null +++ b/erp_web/js/pages/bill/add_temp.js @@ -0,0 +1,333 @@ +$.get("../../pages/template/base.html?7891", function(tem) { + if(tem) { + var template = Handlebars.compile(tem); + /** + * 加载供应商、客户模块 + */ + $("#supplier").html(template({ + supplierSelect: true + })); + $('#supplierDlg').dialog({ + closed: true, + modal: true, + collapsible: false, + closable: true + }); + $("#supplierDlg #supplier").textbox({ + required: true, + validType: 'length[2,30]' + }); + $("#supplierDlg #email").textbox({ + validType: 'email' + }); + $("#BeginNeedGet,#BeginNeedPay,#AllNeedGet,#AllNeedPay").numberbox({ + min:0, + precision:2 + }); + $("#taxRate").textbox({ + validType: 'length[1,2]' + }); + $("#saveSupplier").linkbutton({ + iconCls: 'icon-ok' + }); + $("#cancelSupplier").linkbutton({ + iconCls: 'icon-cancel' + }); + $("#contacts,#telephone,#email,#phonenum,#fax,#taxNum,#bankName,#accountNumber,#address").textbox(); + $("#description").textbox({ + multiline:true + }); + + /** + * 加载仓库 + */ + $("#depot").html(template({ + depotSelect: true + })); + $('#depotDlg').dialog({ + closed: true, + modal: true, + collapsible: false, + closable: true + }); + $("#depotDlg #name").textbox({ + required: true, + validType: 'length[2,30]' + }); + $("#depotDlg #address").textbox({ + validType: 'length[2,30]' + }); + $("#depotDlg #warehousing,#depotDlg #truckage").numberbox({ + min:0, + precision:2 + }); + $("#saveDepot").linkbutton({ + iconCls: 'icon-ok' + }); + $("#cancelDepot").linkbutton({ + iconCls: 'icon-cancel' + }); + $("#sort").textbox(); + $("#depotDlg #remark").textbox({ + multiline:true + }); + + /** + * 加载账户 + */ + $("#account").html(template({ + accountSelect: true + })); + $('#accountDlg').dialog({ + closed: true, + modal: true, + collapsible: false, + closable: true + }); + $("#accountDlg #name,#accountDlg #serialNo").textbox({ + required: true, + validType: 'length[2,30]' + }); + $("#accountDlg #initialAmount").numberbox({ + min:0, + precision:2 + }); + $("#saveAccount").linkbutton({ + iconCls: 'icon-ok' + }); + $("#cancelAccount").linkbutton({ + iconCls: 'icon-cancel' + }); + } +}); + +//绑定供应商、客户事件 +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 () { + if(!$('#depotFM').form('validate')){ + return; + } + 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; + } + if(!$('#accountFM').form('validate')){ + return; + } else { + $.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/bill/bill_detail.js b/erp_web/js/pages/bill/bill_detail.js new file mode 100644 index 00000000..c28e677c --- /dev/null +++ b/erp_web/js/pages/bill/bill_detail.js @@ -0,0 +1,560 @@ + var accountList; //账户列表 + var listSubType = ""; //采购 销售等 + var depotHeadID = 0; //主表id + var mPropertyList = ""; //商品属性列表 + var outItemList; //支出项目列表 + var otherColumns = true; //明细中的‘别名’列是否显示 + var payTypeTitle = "";//收入 支出 + var itemType = true; //隐藏当前列 + var moneyType = true; //隐藏当前列 + + $(function() { + initSystemData_account(); //获取账户信息 + initMProperty(); //初始化商品属性 + initOutItemList(); //初始化支出项目 + initialize();//初始化系统基础信息 + + }); + + //获取账户信息 + function initSystemData_account(){ + $.ajax({ + type:"get", + url: "/account/getAccount", + //设置为同步 + async:false, + dataType: "json", + success: function (res) { + if(res && res.code === 200){ + accountList = res.data.accountList; + } + } + }); + } + //初始化商品属性 + function initMProperty(){ + $.ajax({ + type: "get", + url: "/materialProperty/list", + dataType: "json", + data: ({ + search: JSON.stringify({ + name: "" + }), + currentPage: 1, + pageSize: 100 + }), + //设置为同步 + async:false, + success: function (res) { + if(res && res.code === 200){ + if(res.data && res.data.page) { + var thisRows = res.data.page.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 initOutItemList(){ + $.ajax({ + type:"get", + url: "/inOutItem/findBySelect?type=out", + //设置为同步 + async:false, + dataType: "json", + success: function (res){ + if(res){ + outItemList = res; + } + }, + error:function(){ + + } + }); + } + function initialize() { + var url = location.href; //获取浏览器地址 + var params = url.substring(url.indexOf("?")+1); + var number = params.substring(params.indexOf("n=")+2, params.indexOf("&")); + var billType = ""; + var listSubType = params.substring(params.indexOf("&type=")+6); + if(listSubType) { + listSubType = decodeURI(listSubType); + } + if(listSubType == "采购入库") { + billType = "material"; + $("#bill .purchase_in").show(); + tableString = $(".purchase_in").html(); + } + else if(listSubType == "采购退货出库") { + billType = "material"; + $("#bill .purchase_back").show(); + tableString = $(".purchase_back").html(); + } + else if(listSubType == "销售出库") { + billType = "material"; + $("#bill .sale_out").show(); + tableString = $(".sale_out").html(); + } + else if(listSubType == "销售退货入库") { + billType = "material"; + $("#bill .sale_back").show(); + tableString = $(".sale_back").html(); + } + else if(listSubType == "零售出库") { + billType = "material"; + $("#bill .retail_out").show(); + tableString = $(".retail_out").html(); + } + else if(listSubType == "零售退货入库") { + billType = "material"; + $("#bill .retail_back").show(); + tableString = $(".retail_back").html(); + } + else if(listSubType == "其它入库") { + billType = "material"; + $("#bill .other_in").show(); + tableString = $(".other_in").html(); + } + else if(listSubType == "其它出库") { + billType = "material"; + $("#bill .other_out").show(); + tableString = $(".other_out").html(); + } + else if(listSubType == "调拨出库") { + billType = "material"; + $("#bill .allocation_out").show(); + tableString = $(".allocation_out").html(); + } + else if(listSubType == "组装单") { + billType = "material"; + $("#bill .allocation_out").show(); + tableString = $(".allocation_out").html(); + } + else if(listSubType == "拆卸单") { + billType = "material"; + $("#bill .allocation_out").show(); + tableString = $(".allocation_out").html(); + } + else if(listSubType == "盘点复盘") { + billType = "material"; + $("#bill .stock_check_replay").show(); + tableString = $(".stock_check_replay").html(); + } + else if(listSubType == "收入") { + billType = "account"; + payTypeTitle = "收入项目"; + itemType = false; //显示当前列 + moneyType = true; //隐藏当前列 + $("#bill .item_in").show(); + tableString = $(".item_in").html(); + } + else if(listSubType == "支出") { + billType = "account"; + payTypeTitle = "支出项目"; + itemType = false; //显示当前列 + moneyType = true; //隐藏当前列 + $("#bill .item_out").show(); + tableString = $(".item_out").html(); + } + else if(listSubType == "收款") { + billType = "account"; + payTypeTitle = "无标题"; + itemType = true; //隐藏当前列 + moneyType = false; //显示当前列 + $("#bill .money_in").show(); + tableString = $(".money_in").html(); + } + else if(listSubType == "付款") { + billType = "account"; + payTypeTitle = "无标题"; + itemType = true; //隐藏当前列 + moneyType = false; //显示当前列 + $("#bill .money_out").show(); + tableString = $(".money_out").html(); + } + else if(listSubType == "转账") { + billType = "account"; + payTypeTitle = "无标题"; + itemType = true; //隐藏当前列 + moneyType = false; //显示当前列 + $("#bill .giro").show(); + tableString = $(".giro").html(); + } + else if(listSubType == "收预付款") { + billType = "account"; + payTypeTitle = "无标题"; + itemType = true; //隐藏当前列 + moneyType = false; //显示当前列 + $("#bill .advance_in").show(); + tableString = $(".advance_in").html(); + } + + //如果是进货、销售 + if(billType == "material"){ + $.ajax({ + url: "/depotHead/getDetailByNumber", + data: { + number: number + }, + type: "get", + success: function (res) { + if(res && res.code === 200){ + var data = res.data; + var manyAccountMoney = 0; //多账户合计-零售 + if(data.accountName){ + $("#bill .AccountIdShow").text(data.accountName); //结算账户 + } + else if(data.accountIdList && data.accountMoneyList) { + var accountArr = data.accountIdList.split(","); //账户id列表 + var accountMoneyArr = data.accountMoneyList.split(","); //账户金额列表 + var accountIdShow = ""; + for (var j = 0; j < accountArr.length; j++) { + if (accountList != null) { + for (var i = 0; i < accountList.length; i++) { + var account = accountList[i]; + if (accountArr[j] == account.id) { + var currentAccountMoney = accountMoneyArr[j] - 0; + if (currentAccountMoney < 0) { + currentAccountMoney = 0 - currentAccountMoney; + } + accountIdShow = accountIdShow + account.name + "(" + currentAccountMoney + "元) "; + manyAccountMoney += accountMoneyArr[j] - 0; //多账户合计-零售 + } + } + } + } + $("#bill .AccountIdShow").text(accountIdShow); + } + $("#bill .OrganIdShow").text(data.organName); + $("#bill .OperTimeShow").text(data.operTimeStr); + $("#bill .NumberShow").text(data.number); + $("#bill .LinkNumberShow").text(data.linkNumber? data.linkNumber : ""); + $("#bill .RemarkShow").text(data.remark); + $("#bill .DiscountShow").text(data.discount); + $("#bill .DiscountMoneyShow").text(data.discountMoney); + $("#bill .DiscountLastMoneyShow").text(data.discountLastMoney); + $("#bill .ChangeAmountShow").text(data.changeAmount==null ? "":data.changeAmount); + $("#bill .DebtShow").text((data.discountLastMoney+data.otherMoney-data.changeAmount).toFixed(2)); + $("#bill .OtherMoneyShow").text(data.otherMoney==null ? "": data.otherMoney); + $("#bill .AccountDayShow").text(data.accountDay==null ? "": data.accountDay); //结算天数 + if(data.otherMoney && data.otherMoneyList && data.otherMoneyItem) { + var itemArr = data.otherMoneyList.split(","); //支出项目id列表 + var itemMoneyArr = null; + if (data.otherMoneyItem != null) { + itemMoneyArr = eval("([" + data.otherMoneyItem + "])"); //支出项目金额列表 + } + var otherMoneyShow = ""; + for(var j =0;j",""); + } + else { + salesmanStr += arr[i].replace("<","").replace(">","") + ","; + } + } + } + $.ajax({ + type: "get", + url: "/person/getPersonByIds", + data: { + personIDs: salesmanStr + }, + success:function(res){ + if(res && res.code === 200 && res.data){ + $("#bill .SalesmanShow").text(res.data.names); //销售人员列表 + } + }, + error:function(){ + + } + }); + } + } + } + } + }); + } + //如果是财务单据 + else if(billType == "account"){ + $.ajax({ + url: "/accountHead/getDetailByNumber", + data: { + billNo: number + }, + type: "get", + success: function (res) { + if(res && res.code === 200){ + var data = res.data; + $("#bill .BillNoShow").text(data.billNo); + $("#bill .BillTimeShow").text(data.billTimeStr); + $("#bill .RemarkShow").text(data.remark); + $("#bill .AccountIdShow").text(data.accountName); + $('#bill .OrganIdShow').text(data.organName); + $("#bill .HandsPersonIdShow").text(data.handsPersonName); + $("#bill .ChangeAmountShow").text(data.changeAmount==null ? "":data.changeAmount); + var totalprice = data.totalPrice; + var accountHeadID = data.id; + initTableData_account_show(totalprice, accountHeadID); //明细列表-查看状态 + } + } + }); + } + //打印table + $("#print_bill_detail").off("click").on("click",function(){ + var tableString = "";//打印table + if(listSubType == "采购入库") { + tableString = $(".purchase_in").html(); + } + else if(listSubType == "采购退货出库") { + tableString = $(".purchase_back").html(); + } + else if(listSubType == "销售出库") { + tableString = $(".sale_out").html(); + } + else if(listSubType == "销售退货入库") { + tableString = $(".sale_back").html(); + } + else if(listSubType == "零售出库") { + tableString = $(".retail_out").html(); + } + else if(listSubType == "零售退货入库") { + tableString = $(".retail_back").html(); + } + else if(listSubType == "其它入库") { + tableString = $(".other_in").html(); + } + else if(listSubType == "其它出库") { + tableString = $(".other_out").html(); + } + else if(listSubType == "调拨出库") { + tableString = $(".allocation_out").html(); + } + else if(listSubType == "盘点复盘") { + tableString = $(".stock_check_replay").html(); + } + else if(listSubType == "收入") { + tableString = $(".item_in").html(); + } + else if(listSubType == "支出") { + tableString = $(".item_out").html(); + } + else if(listSubType == "收款") { + tableString = $(".money_in").html(); + } + else if(listSubType == "付款") { + tableString = $(".money_out").html(); + } + else if(listSubType == "转账") { + tableString = $(".giro").html(); + } + else if(listSubType == "收预付款") { + tableString = $(".advance_in").html(); + } + localStorage.setItem("tableString",tableString); + window.open("../../js/print/print_form.html","location:No;status:No;help:No;dialogWidth:800px;dialogHeight:600px;scroll:auto;"); + }); + } + + //初始化表格数据-商品列表-查看状态 + function initTableData_material_show(TotalPrice,listSubType){ + var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示 + var anotherDepotHeadName = ""; //对方仓库的列的标题 + var depotHeadName = ""; //仓库的列的标题 + if(listSubType == "调拨出库"){ + isShowAnotherDepot = false; //调拨时候显示对方仓库 + anotherDepotHeadName = "调入仓库"; + } else { + depotHeadName = "仓库名称"; + } + var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示 + if(listSubType == "调拨出库" || listSubType == "其它出库" || listSubType == "其它入库" || + listSubType == "零售出库" || listSubType == "零售退货入库" || listSubType == "盘点复盘"){ + isShowTaxColumn = true; //隐藏 + } + var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示 + if(listSubType == "组装单" || listSubType == "拆卸单"){ + isShowMaterialTypeColumn = false; //显示 + } + $('#bill .materialDataShow').datagrid({ + height:245, + rownumbers: true, + //动画效果 + animate:false, + //选中单行 + singleSelect : true, + collapsible:false, + selectOnCheck:false, + pagination: false, + //交替出现背景 + striped : true, + showFooter: true, + columns:[[ + { title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn}, + { title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90}, + { title: '名称(型号)(扩展信息)(单位)',field: 'MaterialName',width:230}, + { title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90}, + { title: '单位',field: 'Unit',editor:'validatebox',width:60}, + { title: '数量',field: 'OperNumber',editor:'validatebox',width:60}, + { title: '单价',field: 'UnitPrice',editor:'validatebox',width:60}, + { title: '含税单价',field: 'TaxUnitPrice',editor:'validattebox',hidden:isShowTaxColumn,width:75}, + { title: '金额',field: 'AllPrice',editor:'validatebox',width:75}, + { title: '税率',field: 'TaxRate',editor:'validatebox',hidden:isShowTaxColumn,width:75}, + { title: '税额',field: 'TaxMoney',editor:'validatebox',hidden:isShowTaxColumn,width:75}, + { title: '价税合计',field: 'TaxLastMoney',editor:'validatebox',hidden:isShowTaxColumn,width:75}, + { title: '备注',field: 'Remark',editor:'validatebox',width:120}, + { title: '名称-别',field: 'OtherField1',editor:'validatebox',hidden:otherColumns,width:60}, + { title: '型号-别',field: 'OtherField2',editor:'validatebox',hidden:otherColumns,width:60}, + { title: '颜色-别',field: 'OtherField3',editor:'validatebox',hidden:otherColumns,width:60}, + { title: '备注1',field: 'OtherField4',editor:'validatebox',hidden:true,width:60}, + { title: '备注2',field: 'OtherField5',editor:'validatebox',hidden:true,width:60} + ]], + onLoadError:function() { + $.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error'); + return; + } + }); + $.ajax({ + type:"get", + url: '/depotItem/getDetailList', + data: { + headerId: depotHeadID, + mpList: mPropertyList + }, + dataType: "json", + success: function (res) { + if(res && res.code === 200) { + var data = res.data; + var AllPrice = TotalPrice; + var DiscountMoney = $("#bill .DiscountMoneyShow:visible").text() - 0; //优惠金额 + var DiscountLastMoney = $("#bill .DiscountLastMoneyShow:visible").text() - 0; //优惠后金额 + var array = []; + array.push({ + "AllPrice": AllPrice, + "TaxLastMoney": DiscountMoney + DiscountLastMoney + }); + data.footer = array; + $("#bill .materialDataShow").datagrid('loadData', data); + } + }, + error:function() { + $.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); + } + }); + } + + //初始化表格数据-明细列表-查看状态 + function initTableData_account_show(totalprice, accountHeadID){ + $('#bill .accountDataShow').datagrid({ + height:280, + rownumbers: true, + //动画效果 + animate:false, + //选中单行 + singleSelect : true, + collapsible:false, + selectOnCheck:false, + //单击行是否选中 + checkOnSelect : false, + pagination: false, + //交替出现背景 + striped : true, + showFooter: true, + columns:[[ + { title: payTypeTitle, field: 'InOutItemName', width:230, hidden:itemType}, + { title: '账户名称', field: 'AccountName', width:230, hidden:moneyType}, + { title: '金额',field: 'EachAmount',width:70}, + { title: '备注',field: 'Remark',width:150} + ]], + onLoadError:function() + { + $.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error'); + return; + } + }); + $.ajax({ + type:"get", + url: '/accountItem/getDetailList', + data: { + headerId: accountHeadID + }, + dataType: "json", + success: function (res) { + if(res && res.code === 200) { + var data = res.data; + var EachAmount = totalprice; + var array = []; + array.push({ + "EachAmount": EachAmount + }); + data.footer = array; + $("#bill .accountDataShow").datagrid('loadData', data); + } + }, + error:function() { + $.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); + } + }); + } + + function print(){ + alert(listSubType); + } diff --git a/erp_web/js/pages/bill/in_out.js b/erp_web/js/pages/bill/in_out.js new file mode 100644 index 00000000..ac92b12e --- /dev/null +++ b/erp_web/js/pages/bill/in_out.js @@ -0,0 +1,1486 @@ + //初始化界面 + var defDepotId = null; + var kid = sessionStorage.getItem("userId"); + var pageType = getUrlParam('t'); //获取页面类型传值 + var depotList = null; + var userBusinessList=null; + var userdepot=null; + var url; + var depotHeadID = 0; + var preTotalPrice = 0; //前一次加载的金额 + var editIndex = undefined; + var listTitle = ""; //单据标题 + var listType = ""; //入库 出库 + var listSubType = ""; //采购 销售等 + var payTypeTitle = "";//付款 收款 + var organUrl = ""; //组织数据接口地址 + var amountNum = ""; //单据编号开头字符 + var depotString = ""; //店铺id列表 + var orgDefaultId=''; //单位默认编号 + var orgDefaultList; //存储查询出来的会员列表 + var accountList; //账户列表 + var outItemList; //支出项目列表 + var oldNumber = ""; //编辑前的单据编号 + var oldId = 0; //编辑前的单据Id + var otherColumns = true; //明细中的‘别名’列是否显示 + var btnEnableList = getBtnStr(); //获取按钮的权限 + var mPropertyList = ""; //商品属性列表 + var defaultAccountId = 0; //默认账户id + var roleType = ""; //角色类型 + var inOutService = { + getRoleType: function () { + $.ajax({ + type:"get", + url: "/user/getRoleTypeByUserId", + async: false, + success: function (res) { + if (res && res.code === 200) { + roleType = res.data.roleType; + } + else { + roleType = null; + } + } + }); + }, + //初始化系统基础信息 + initSystemData_UB: function () { + $.ajax({ + type:"get", + url: "/userBusiness/getBasicData", + data: ({ + KeyId:kid, + Type:"UserDepot" + }), + //设置为同步 + async:false, + dataType: "json", + success: function (res) { + if (res && res.code === 200) { + userBusinessList = res.data.userBusinessList; + if(userBusinessList !=null) { + if(userBusinessList.length>0) { + //用户对应的仓库列表 [1][2][3]... + userdepot =userBusinessList[0].value; + } + } + } + else { + userBusinessList = null; + } + } + }); + }, + //初始化系统仓库信息 + initSystemData_depot: function () { + var config = getSystemConfig(); + var depotList = getSystemDepot(); + if(depotList !=null) { + for(var i = 0 ;i < depotList.length;i++) { + var depot = depotList[i]; + if(config && config.depotFlag == "1") { + if(userdepot!=null) { + if(userdepot.indexOf("["+depot.id+"]")!=-1) { + if(depot.isDefault){ + defDepotId = depot.id; + } + depotString = depotString + depot.id + ","; + } + } + } else { + if(depot.isDefault){ + defDepotId = depot.id; + } + } + } + depotString = depotString.substring(0, depotString.length-1); + } + }, + //初始化供应商、客户、散户信息 + initSupplier: function () { + $('#OrganId').combobox({ + url: organUrl, + valueField:'id', + textField:'supplier', + filter: function(q, row){ + var opts = $(this).combobox('options'); + return row[opts.textField].indexOf(q) >-1; + }, + onLoadSuccess: function(res) { + var data = $(this).combobox('getData'); + for(var i = 0; i<= data.length; i++){ + if(data && data[i] && data[i].supplier === "非会员"){ + orgDefaultId = data[i].id; + } + } + if(listSubType === "零售"){ + orgDefaultList = res; + } + }, + onSelect: function(rec){ + if(listSubType === "零售"){ + var option = ""; + if(rec.supplier !== "非会员" && rec.advanceIn >0){ + option = ''; + option += ''; + } + else { + option += ''; + } + $("#payType").empty().append(option); + } + } + }); + }, + //初始化销售人员 + initSalesman: function () { + $('#Salesman').combobox({ + url: "/person/getPersonByNumType?type=1", + valueField:'id', + textField:'name', + multiple: true + }); + }, + //初始化收入项目列表 + initOutItemList: function () { + $.ajax({ + type:"get", + url: "/inOutItem/findBySelect?type=out", + //设置为同步 + async:false, + dataType: "json", + success: function (res){ + if(res){ + outItemList = res; + } + }, + error:function(){ + + } + }); + }, + //初始化商品属性 + initMProperty: function () { + $.ajax({ + type: "get", + url: "/materialProperty/list", + dataType: "json", + data: ({ + search: JSON.stringify({ + name: "" + }), + currentPage: 1, + pageSize: 100 + }), + success: function (res) { + if(res && res.code === 200){ + if(res.data && res.data.page) { + var thisRows = res.data.page.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; + } + }); + }, + //获取账户信息 + initSystemData_account: function () { + $.ajax({ + type:"get", + url: "/account/getAccount", + //设置为同步 + async:false, + dataType: "json", + success: function (res) { + if(res && res.code === 200) { + if(res.data) { + accountList = res.data.accountList; + var options = ""; + if(accountList !=null){ + options = ""; + options += ""; + for(var i = 0 ;i < accountList.length;i++) { + var account = accountList[i]; + options += ''; + if(account.isDefault) { + defaultAccountId = account.id; //给账户赋值默认id + } + } + $("#AccountId").empty().append(options); + } + } + } + } + }); + }, + //防止表单提交重复 + initForm: function () { + $('#depotHeadFM').form({ + onSubmit: function(){ + return false; + } + }); + }, + //查找库存的方法 + findStockNumById: function (depotId, meId, monthTime, body, input, ratio, type) { + var thisRatio = 1; //比例 + $.ajax({ + url: "/material/findByIdWithBarCode", + type: "get", + dataType: "json", + data: { + meId: meId + }, + success: function (rec) { + if(rec && rec.code === 200) { + var info = rec.data; + var commodityUnit = info.commodityUnit; //商品单位 + var loadRatio = 1; //在单位输入框上面加载比例字段 + if(info.unit) { //如果存在计量单位信息 + loadRatio = 1; + } + else{ + var unitName = info.unitName; + if(unitName) { + thisRatio = unitName.substring(unitName.indexOf(":")+1).replace(")",""); + unitName = unitName.substring(0, unitName.indexOf("(")); + } + var unitArr = unitName.split(","); + var basicUnit = unitArr[0]; //基础单位 + var otherUnit = unitArr[1]; //副单位 + if(basicUnit==commodityUnit){ //基础单位等于选择的单位 + loadRatio = 1; + } + else if(otherUnit==commodityUnit){ //副单位等于选择的单位 + loadRatio = thisRatio; + } + } + //查询库存 + $.ajax({ + type: "get", + url: '/depotItem/findStockNumById', + data:{ + depotId: depotId, + mId: info.id + }, + dataType: "json", + success: function (res) { + if(res && res.code === 200) { + if (res.data) { + var thisStock = res.data.stock; + if (type == "select") { //选择下拉框的时候 + if (ratio != undefined && ratio != 1) { + loadRatio = ratio; + } + } + else if (type == "click") { //点击库存的时候 + if (ratio != undefined) { + loadRatio = ratio; + } + } + thisStock = (thisStock / loadRatio).toFixed(2); + body.find("[field='Stock']").find(input).val(thisStock).attr("data-stock", thisStock); //加载库存数据 + } + else { + body.find("[field='Stock']").find(input).val(0).attr("data-stock", 0); //加载库存数据 + } + body.find("[field='Stock']").find(input).prop("readonly", "readonly"); //设置库存数据为只读 + } + }, + error:function() { + $.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); + } + }); + } + }, + error: function () { + $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error'); + } + }); + }, + //优惠率、合计的统计方法 + statisticsFun: function (body,UnitPrice,OperNumber,footer,taxRate) { + var TotalPrice = 0; + var taxLastMoneyTotal = 0; + //金额的合计 + body.find("[field='AllPrice']").each(function(){ + if($(this).find("div").text()!==""){ + TotalPrice = TotalPrice + parseFloat($(this).find("div").text().toString()); + } + }); + TotalPrice = TotalPrice + UnitPrice*OperNumber; + footer.find("[field='AllPrice']").find("div").text((TotalPrice).toFixed(2)); //金额的合计 + //价税合计的总计 + body.find("[field='TaxLastMoney']").each(function(){ + if($(this).find("div").text()!==""){ + taxLastMoneyTotal = taxLastMoneyTotal + (parseFloat($(this).find("div").text().toString())-0); + } + }); + taxLastMoneyTotal = taxLastMoneyTotal + (UnitPrice*OperNumber*(1+taxRate/100)); + footer.find("[field='TaxLastMoney']").find("div").text((taxLastMoneyTotal).toFixed(2)); //价税合计的页脚总计 + var discount = $("#Discount").val(); //优惠率 + var discountMoney = (taxLastMoneyTotal*discount/100).toFixed(2); + $("#DiscountMoney").val(discountMoney);//优惠金额 + var discountLastMoney = (taxLastMoneyTotal*(1-discount/100)).toFixed(2); + $("#DiscountLastMoney").val(discountLastMoney);//优惠后金额 + if($("#AccountId").val()!=="many"){ + var otherMoney = $("#OtherMoney").val()-0; + var changeAmount = discountLastMoney-0+otherMoney; + $("#ChangeAmount").val(changeAmount.toFixed(2)); //本次付、收款 + } + var changeAmountNum = $("#ChangeAmount").val()-0; //本次付款或者收款 + $("#Debt").val((discountLastMoney-0+otherMoney-changeAmountNum).toFixed(2)); //本次欠款 + + if(listSubType == "零售" || listSubType == "零售退货") { + $("#ChangeAmount, #getAmount").val((TotalPrice).toFixed(2)); + $("#backAmount").val(0); + } + }, + //分页信息处理 + ininPager: function () { + var self = this; + try { + var opts = $("#tableData").datagrid('options'); + var pager = $("#tableData").datagrid('getPager'); + pager.pagination({ + onSelectPage:function(pageNum, pageSize) { + opts.pageNumber = pageNum; + opts.pageSize = pageSize; + pager.pagination('refresh', { + pageNumber:pageNum, + pageSize:pageSize + }); + self.showDepotHeadDetails(pageNum,pageSize); + } + }); + } + catch (e) { + $.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error'); + } + }, + //删除单据信息 + deleteDepotHead: function (depotHeadID, thisOrganId, totalPrice, status) { + if(status == "1" || status == "2") { + $.messager.alert('删除提示','已审核和已转的单据不能删除!','warning'); + return; + } + $.messager.confirm('删除确认','确定要删除此单据信息吗?',function(r) { + if (r) { + $.ajax({ + type:"post", + url: "/depotHead/deleteDepotHeadAndDetail", + dataType: "json", + data:{ + id: depotHeadID + }, + success: function (res) { + if(res && res.code == 200) { + $("#searchBtn").click(); + } else { + $.messager.alert('删除提示', '删除单据信息失败,请稍后再试!', 'error'); + } + }, + //此处添加错误处理 + error:function() { + $.messager.alert('删除提示','删除单据信息异常,请稍后再试!','error'); + return; + } + }); + + //更新会员的预收款信息 + if(listSubType === "零售") { + $.ajax({ + type:"post", + url: "/supplier/updateAdvanceIn", + dataType: "json", + data:{ + supplierId: thisOrganId, //会员id + advanceIn: totalPrice //删除时同时返还用户的预付款 + }, + success: function(res){ + if(res && res.code === 200) { + //保存会员预收款成功 + } + }, + error: function(){ + $.messager.alert('提示','保存信息异常,请稍后再试!','error'); + return; + } + }); + } + } + }); + }, + //批量删除单据信息 + batDeleteDepotHead: function () { + var row = $('#tableData').datagrid('getChecked'); + if(row.length == 0) { + $.messager.alert('删除提示','没有记录被选中!','info'); + return; + } + if(row.length > 0) { + $.messager.confirm('删除确认','确定要删除选中的' + row.length + '条单据信息吗?',function(r) { + if (r) { + var ids = ""; + for (var i = 0; i < row.length; i++) { + if (i == row.length - 1) { + if (row[i].status == 0) { + ids += row[i].id; + } + break; + } + ids += row[i].id + ","; + } + if (ids) { + //批量更新会员的预收款信息 + for (var i = 0; i < row.length; i++) { + if (listSubType === "零售") { + $.ajax({ + type: "post", + url: "/supplier/updateAdvanceIn", + dataType: "json", + data: { + supplierId: row[i].organId, //会员id + advanceIn: row[i].totalPrice //删除时同时返还用户的预付款 + }, + success: function (res) { + if (res && res.code === 200) { + //保存会员预收款成功 + } + }, + error: function () { + $.messager.alert('提示', '保存信息异常,请稍后再试!', 'error'); + return; + } + }); + } + } + //批量删除 + $.ajax({ + type: "post", + url: "/depotHead/batchDeleteDepotHeadAndDetail", + dataType: "json", + async: false, + data: ({ + ids: ids + }), + success: function (res) { + if (res && res.code === 200) { + $("#searchBtn").click(); + $(":checkbox").attr("checked", false); + } else { + $.messager.alert('删除提示', '删除单据信息失败,请稍后再试!', 'error'); + } + }, + //此处添加错误处理 + error: function () { + $.messager.alert('删除提示', '删除单据信息异常,请稍后再试!', 'error'); + return; + } + }); + } else { + $.messager.alert('删除提示','没有能删除的单据!','warning'); + } + } + }); + } + }, + //批量审核|反审核 + setStatusFun: function (status) { + var row = $('#tableData').datagrid('getChecked'); + if(row.length == 0) { + $.messager.alert('提示','没有记录被选中!','info'); + return; + } + if(row.length > 0) { + $.messager.confirm('确认','确定要操作选中的' + row.length + '条信息吗?',function(r) { + if (r) { + var ids = ""; + for(var i = 0;i < row.length; i ++) { + if(i == row.length-1) { + if(row[i].status != "2") { + ids += row[i].id; + } + break; + } + ids += row[i].id + ","; + } + if(ids) { + $.ajax({ + type:"post", + url: "/depotHead/batchSetStatus", + dataType: "json", + async : false, + data: ({ + status: status, + depotHeadIDs : ids + }), + success: function (res) { + if(res && res.code === 200) { + $("#searchBtn").click(); + $(":checkbox").attr("checked", false); + } else { + $.messager.alert('提示', '操作信息失败,请稍后再试!', 'error'); + } + }, + //此处添加错误处理 + error:function() { + $.messager.alert('提示','操作信息异常,请稍后再试!','error'); + return; + } + }); + } else { + $.messager.alert('提示','没有能操作的单据!','warning'); + } + } + }); + } + }, + //生成单据编号 + buildNumber: function () { + $.ajax({ + type: "get", + url: "/depotHead/buildNumber", + success:function(res){ + if(res && res.code === 200){ + var obj = res.data; + var defaultNumber = obj.DefaultNumber; + var newNumber = amountNum + defaultNumber; + $("#Number").val(newNumber).attr("data-defaultNumber",newNumber); + } + }, + error:function(){ + $.messager.alert('提示','生成单据编号失败!','error'); + } + }); + }, + //绑定操作事件 + bindEvent: function () { + var self = this; + self.showDepotHeadDetails(1,initPageSize); //初始化时自动查询 + //搜索处理 + $("#searchBtn").off("click").on("click",function(){ + self.showDepotHeadDetails(1,initPageSize); + var opts = $("#tableData").datagrid('options'); + var pager = $("#tableData").datagrid('getPager'); + opts.pageNumber = 1; + opts.pageSize = initPageSize; + pager.pagination('refresh', + { + pageNumber:1, + pageSize:initPageSize + }); + }); + + //重置按钮 + $("#searchResetBtn").unbind().bind({ + click:function(){ + $("#searchNumber").textbox("clear"); + $("#searchMaterial").textbox("clear"); + $("#searchBeginTime").datebox("clear"); + $("#searchEndTime").datebox("clear"); + //加载完以后重新初始化 + $("#searchBtn").click(); + } + }); + + //检查单据编号是否存在 + function checkDepotHeadNumber() { + var thisNumber = $.trim($("#Number").val()); + //表示是否存在 true == 存在 false = 不存在 + var flag = false; + //开始ajax名称检验,不能重名 + if(thisNumber.length > 0 &&( oldNumber.length ==0 || thisNumber != oldNumber)) + { + $.ajax({ + type:"get", + url: "/depotHead/checkIsNumberExist", + dataType: "json", + async : false, + data: ({ + DepotHeadID : oldId, + Number : thisNumber + }), + success: function (tipInfo) + { + flag = tipInfo; + if(tipInfo) + { + $.messager.alert('提示','抱歉,该单据编号已经存在','warning'); + return; + } + }, + //此处添加错误处理 + error:function() + { + $.messager.alert('提示','检查单据编号是否存在异常,请稍后再试!','error'); + return; + } + }); + } + return flag; + } + + //打印单据 + $("#printDepotHeadShow").off("click").on("click",function(){ + var tableString = $("#depotHeadDlgShow").html(); + localStorage.setItem("tableString",tableString); + window.open("../../js/print/print_form.html","location:No;status:No;help:No;dialogWidth:800px;dialogHeight:600px;scroll:auto;"); + }); + + //初始化键盘enter事件 + $(document).keydown(function(event){ + //兼容 IE和firefox 事件 + var e = window.event || event; + var k = e.keyCode||e.which||e.charCode; + //兼容 IE,firefox 兼容 + var obj = e.srcElement ? e.srcElement : e.target; + //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 + if(k == "13"&&(obj.id=="State"||obj.id=="Number")) + { + $("#saveDepotHead").click(); + } + //搜索按钮添加快捷键 + if(k == "13"&&(obj.id=="searchState"||obj.id=="searchNumber"||obj.id=="searchMaterial")) + { + $("#searchBtn").click(); + } + }); + + //优惠率输入框事件 + $("#Discount").off("keyup").on("keyup",function(){ + var footer =$("#depotHeadFM .datagrid-footer"); + var totalPrice = footer.find("[field='TaxLastMoney']").find("div").text(); + var discountNum = $(this).val(); + var discountMoney = (discountNum/100*totalPrice).toFixed(2); + var discountLastMoney = (totalPrice - discountMoney).toFixed(2); + $("#DiscountMoney").val(discountMoney); //优惠金额 + $("#DiscountLastMoney").val(discountLastMoney); //优惠后金额 + if($("#AccountId").val()!=="many"){ + var otherMoney = $("#OtherMoney").val()-0; + var changeAmount = discountLastMoney-0+otherMoney; + $("#ChangeAmount").val(changeAmount.toFixed(2)); //本次付、收款 + } + var changeAmountNum = $("#ChangeAmount").val()-0; //本次付款或者收款 + $("#Debt").val((discountLastMoney-0+otherMoney-changeAmountNum).toFixed(2)); //本次欠款 + }); + + //优惠金额输入框事件 + $("#DiscountMoney").off("keyup").on("keyup",function(){ + var footer =$("#depotHeadFM .datagrid-footer"); + var totalPrice = footer.find("[field='TaxLastMoney']").find("div").text(); + var discountMoney = $(this).val(); + var discount = (discountMoney/totalPrice).toFixed(2)*100; + var discountLastMoney = (totalPrice - discountMoney).toFixed(2); + $("#Discount").val(discount); //优惠金额 + $("#DiscountLastMoney").val(discountLastMoney); //优惠后金额 + if($("#AccountId").val()!=="many"){ + var otherMoney = $("#OtherMoney").val()-0; + var changeAmount = discountLastMoney-0+otherMoney; + $("#ChangeAmount").val(changeAmount.toFixed(2)); //本次付、收款 + } + var changeAmountNum = $("#ChangeAmount").val()-0; //本次付款或者收款 + $("#Debt").val((discountLastMoney-0+otherMoney-changeAmountNum).toFixed(2)); //本次欠款 + }); + + //付款、收款输入框事件 + $("#ChangeAmount").off("keyup").on("keyup",function(){ + var discountLastMoney = $("#DiscountLastMoney").val()-0; + var otherMoney = $("#OtherMoney").val()-0; + var changeAmount = $(this).val(); + var debtMoney = (discountLastMoney + otherMoney - changeAmount).toFixed(2); + $("#Debt").val(debtMoney); //本次欠款 + }); + + //多账户结算窗口弹出事件 + function depotHeadAccountDlgFun(){ + $('#depotHeadAccountDlg').dialog('open').dialog('setTitle',' 多账户结算'); + $("#depotHeadAccountDlg .account-dlg .account-content-tmp").remove(); //先移除输入栏目 + $("#accountMoneyTotalDlg").text(0); //将合计初始化为0 + for(var i=0; i<6; i++) { + $("#depotHeadAccountDlg .tabs-tmp .account-content-tmp").attr("data-index",5-i); //添加索引 + var contentTmp = $("#depotHeadAccountDlg .tabs-tmp tbody").html(); + var accountDlgHead = $("#depotHeadAccountDlg .account-head-tmp"); + accountDlgHead.after(contentTmp); + } + + //获取账户信息 + function accountDlgFun() { + var options = ""; + if(accountList !=null){ + for(var i = 0 ;i < accountList.length;i++) { + var account = accountList[i]; + options += ''; + } + $(".account-id-dlg").empty().append("").append(options); + } + } + accountDlgFun(); //获取账户信息 + $("#depotHeadAccountDlg .tabs-tmp").hide(); //隐藏模板 + + //账户金额输入框事件-多账户 + $("#depotHeadAccountDlg .account-dlg .account-money-dlg").off("keyup").on("keyup",function(){ + var totalAccoutNum = 0; + $("#depotHeadAccountDlg .account-dlg .account-content-tmp").each(function(){ + var eachAccountMoney = $(this).find(".account-money-dlg").val()-0; + totalAccoutNum += eachAccountMoney; + }); + $("#accountMoneyTotalDlg").text(totalAccoutNum); + }); + + //结算多账户列表的切换事件 + $("#depotHeadAccountDlg .account-dlg .account-id-dlg").off("change").on("change",function(){ + var selectAccount = $(this).children('option:selected').text(); + if(selectAccount === ""){ + var thisMoneyDom = $(this).closest(".account-content-tmp").find(".account-money-dlg"); + var thisMoney = thisMoneyDom.val()-0; + var accountMoneyTotal = $("#accountMoneyTotalDlg").text() - 0; + $("#accountMoneyTotalDlg").text(accountMoneyTotal - thisMoney); + thisMoneyDom.val(""); //账户为空时候,将金额也置为空 + } + }); + + //保存按钮事件 + $("#saveDepotHeadAccountDlg").off("click").on("click", function(){ + //完成多账户的json数据存储 + var accountArr = []; //账户id数组 + var accountMoneyArr = []; //账户金额数组 + var errorIndex = -1; + $("#depotHeadAccountDlg .account-dlg .account-content-tmp").each(function(){ + var thisAccId = $(this).find(".account-id-dlg").val(); + var thisAccMoney = $(this).find(".account-money-dlg").val(); + if(!thisAccId && thisAccMoney) { + errorIndex = $(this).attr("data-index")-0; + return; + } + if(thisAccId && !thisAccMoney) { + errorIndex = $(this).attr("data-index")-0; + return; + } + if(thisAccId && thisAccMoney) { + accountArr.push(thisAccId); + accountMoneyArr.push(thisAccMoney); + } + }); + if(errorIndex >-1){ + $.messager.alert('错误提示',"第" + (errorIndex+1) + "行数据存在问题,请修改",'warning'); + return; + } + var discountLastMoneyNum =$("#DiscountLastMoney").val()-0; //优惠后金额 + var accountMoneyTotal = $("#accountMoneyTotalDlg").text()-0; //本次付款或者收款 + if(accountMoneyTotal===0){ + $.messager.alert('错误提示',"请填写金额后保存",'warning'); + return; + } + if(accountArr.length && accountMoneyArr.length) { + $("#AccountId").attr("data-accountArr",JSON.stringify(accountArr)).attr("data-accountMoneyArr",JSON.stringify(accountMoneyArr)); //json数据存储 + } + if(listSubType==="零售" || listSubType==="零售退货") { + $("#getAmount").val(accountMoneyTotal); //给付款或者收款金额赋值 + var backAmount = $("#getAmount").val() - $("#ChangeAmount").val(); + $("#backAmount").val((backAmount - 0).toFixed(2)); //计算找零金额 + } + else { + $("#ChangeAmount").val(accountMoneyTotal); //给付款或者收款金额赋值 + } + var otherMoney = $("#OtherMoney").val()-0; + $("#Debt").val((discountLastMoneyNum+otherMoney-accountMoneyTotal).toFixed(2)); //本次欠款 + $("#depotHeadAccountDlg").dialog('close'); + }); + + //取消事件 + function cancelFun(){ + if($("#AccountId").attr("data-accountArr")){ + $("#depotHeadAccountDlg").dialog('close'); + } + else { + $("#depotHeadAccountDlg").dialog('close'); + $("#AccountId").val("").removeAttr("data-accountArr").removeAttr("data-accountMoneyArr"); //将下拉置空并把缓存参数清空 + if(listSubType==="零售" || listSubType==="零售退货"){ + $("#ChangeAmount").prop("readonly","readonly"); + } + else { + $("#ChangeAmount").removeProp("readonly","readonly"); + } + $(".many-account-ico").hide(); //隐藏多账户小图标 + } + } + //多账户-取消按钮 + $("#cancelDepotHeadAccountDlg").off("click").on("click", function(){ + cancelFun(); + }); + + //多账户-右上角的关闭按钮 + $("#depotHeadAccountDlg").prev().find(".panel-tool-close").off("click").on("click", function(){ + cancelFun(); + }); + } + //点击多账户,弹出输入框 + $("#AccountId").off("change").on("change",function(){ + var selectText = $(this).children('option:selected').text(); + if(selectText === "多账户"){ + $("#ChangeAmount").prop("readonly","readonly"); + depotHeadAccountDlgFun(); + $(".many-account-ico").show(); //显示多账户小图标 + } + else{ + $(this).removeAttr("data-accountArr").removeAttr("data-accountMoneyArr"); //将下拉置空并把缓存参数清空 + if(listSubType==="零售" || listSubType==="零售退货"){ + $("#ChangeAmount").prop("readonly","readonly"); + } + else { + $("#ChangeAmount").removeProp("readonly","readonly"); + } + $(".many-account-ico").hide(); //隐藏多账户小图标 + } + }); + + //结算账户-多账户小图标-点击事件 + $(".many-account-ico").off("click").on("click",function(){ + depotHeadAccountDlgFun(); + //给弹窗赋值-多账户数据 + var accountArr = $("#AccountId").attr("data-accountArr"); + accountArr = JSON.parse(accountArr); + var accountMoneyArr = $("#AccountId").attr("data-accountMoneyArr"); + accountMoneyArr = JSON.parse(accountMoneyArr); + $("#depotHeadAccountDlg .account-dlg .account-content-tmp").each(function(){ + var index = $(this).attr("data-index"); + $(this).find(".account-id-dlg").val(accountArr[index]); + $(this).find(".account-money-dlg").val(accountMoneyArr[index]); + }); + if(listSubType==="零售" || listSubType==="零售退货") { + $("#accountMoneyTotalDlg").text($("#getAmount").val()); + } + else { + $("#accountMoneyTotalDlg").text($("#ChangeAmount").val()); + } + }); + + //点击其它费用的事件 + $(".other-money-ico").off("click").on("click",function(){ + $('#otherMoneyDlg').dialog('open').dialog('setTitle',' 其它费用'); + $("#otherMoneyDlg .money-dlg .money-content-tmp").remove(); //先移除输入栏目 + $("#otherMoneyTotalDlg").text(0); //将合计初始化为0 + for(var i=0; i<6; i++) { + $("#otherMoneyDlg .tabs-tmp .money-content-tmp").attr("data-index",5-i); //添加索引 + var contentTmp = $("#otherMoneyDlg .tabs-tmp tbody").html(); + var moneyDlgHead = $("#otherMoneyDlg .money-head-tmp"); + moneyDlgHead.after(contentTmp); + } + + //获取支出项目信息 + function moneyDlgFun() { + var options = ""; + if(outItemList !=null){ + for(var i = 0 ;i < outItemList.length;i++) { + var money = outItemList[i]; + options += ''; + } + $(".money-id-dlg").empty().append("").append(options); + } + } + moneyDlgFun(); //获取支出项目信息 + $("#otherMoneyDlg .tabs-tmp").hide(); //隐藏模板 + + //支出项目的金额输入框事件 + $("#otherMoneyDlg .money-dlg .other-money-dlg").off("keyup").on("keyup",function(){ + var totalMoneyNum = 0; + $("#otherMoneyDlg .money-dlg .money-content-tmp").each(function(){ + var eachOtherMoney = $(this).find(".other-money-dlg").val()-0; + totalMoneyNum += eachOtherMoney; + }); + $("#otherMoneyTotalDlg").text(totalMoneyNum); + }); + + //支出项目列表的切换事件 + $("#otherMoneyDlg .money-dlg .money-id-dlg").off("change").on("change",function(){ + var selectItem = $(this).children('option:selected').text(); + if(selectItem === ""){ + var thisMoneyDom = $(this).closest(".money-content-tmp").find(".other-money-dlg"); + var thisMoney = thisMoneyDom.val()-0; + var otherMoneyTotal = $("#otherMoneyTotalDlg").text() - 0; + $("#otherMoneyTotalDlg").text(otherMoneyTotal - thisMoney); + thisMoneyDom.val(""); //支出项目为空时候,将金额也置为空 + } + }); + + //保存按钮事件 + $("#saveOtherMoneyDlg").off("click").on("click", function(){ + //完成支出项目的json数据存储 + var itemArr = []; //支出项目id数组 + var itemMoneyArr = []; //支出项目金额数组 + var errorIndex = -1; + $("#otherMoneyDlg .money-dlg .money-content-tmp").each(function(){ + var thisId = $(this).find(".money-id-dlg").val(); + var thisMoney = $(this).find(".other-money-dlg").val(); + if(!thisId && thisMoney) { + errorIndex = $(this).attr("data-index")-0; + return; + } + if(thisId && !thisMoney) { + errorIndex = $(this).attr("data-index")-0; + return; + } + if(thisId && thisMoney) { + itemArr.push(thisId); + var itemMoneyObj = {}; + itemMoneyObj.otherId = thisId; + itemMoneyObj.otherMoney = thisMoney; + itemMoneyArr.push(itemMoneyObj); + } + }); + if(errorIndex >-1){ + $.messager.alert('错误提示',"第" + (errorIndex+1) + "行数据存在问题,请修改",'warning'); + return; + } + var otherMoneyTotal = $("#otherMoneyTotalDlg").text()-0; //合计金额 + if(otherMoneyTotal === 0){ //0的时候清空缓存数据 + $("#OtherMoney").removeAttr("data-itemArr").removeAttr("data-itemMoneyArr"); + } + if(itemArr.length && itemMoneyArr.length) { + $("#OtherMoney").attr("data-itemArr",JSON.stringify(itemArr)).attr("data-itemMoneyArr",JSON.stringify(itemMoneyArr)); //json数据存储 + } + $("#OtherMoney").val(otherMoneyTotal); //给其它费用赋值 + var discountLastMoney = $("#DiscountLastMoney").val()-0; + var changeAmount = (discountLastMoney + otherMoneyTotal).toFixed(2); + $("#ChangeAmount").val(changeAmount); //付款或者收款 + $("#otherMoneyDlg").dialog('close'); + }); + + //取消事件 + function cancelFun(){ + if($("#OtherMoney").attr("data-itemArr")){ + $("#otherMoneyDlg").dialog('close'); + } + else { + $("#otherMoneyDlg").dialog('close'); + $("#OtherMoney").val("").removeAttr("data-itemArr").removeAttr("data-itemMoneyArr"); //将下拉置空并把缓存参数清空 + } + } + //费用-取消按钮 + $("#cancelOtherMoneyDlg").off("click").on("click", function(){ + cancelFun(); + }); + + //费用-右上角的关闭按钮 + $("#otherMoneyDlg").prev().find(".panel-tool-close").off("click").on("click", function(){ + cancelFun(); + }); + + //给弹窗赋值-其它费用数据 + var itemArr = $("#OtherMoney").attr("data-itemArr"); + if(itemArr) { + itemArr = JSON.parse(itemArr); + var itemMoneyArr = $("#OtherMoney").attr("data-itemMoneyArr"); + itemMoneyArr = JSON.parse(itemMoneyArr); + $("#otherMoneyDlg .money-dlg .money-content-tmp").each(function(){ + var index = $(this).attr("data-index"); + $(this).find(".money-id-dlg").val(itemArr[index]); + if(itemMoneyArr[index]!="undefined"){ + for(var k =0;k 0){ + mTypeValue = "普通子件"; + } + if(listSubType == "组装单" || listSubType == "拆卸单"){ + mType.find(input).val(mTypeValue).prop("readonly","readonly"); + } + },500); + }, + //新增明细 + append: function () { + if (endEditing()) { + $('#materialData').datagrid('appendRow', {DepotId:defDepotId}); + editIndex = $('#materialData').datagrid('getRows').length - 1; + $('#materialData').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex); + this.autoReckon(); + } + }, + //批量删除明细 + batchDel: function () { + /** + * 1、删除之前必须先调用endEditing结束编辑 + * 2、如果只是调用endEditing结束编辑那么正在编辑行的被选中状态会被去掉 + * 所以要在调用endEditing先获取选中的行 + */ + var self = this; + var row = $('#materialData').datagrid('getChecked'); + if (endEditing()) { + if (row.length == 0) { + $.messager.alert('删除提示', '没有记录被选中!', 'info'); + return; + } + if (row.length > 0) { + $.messager.confirm('删除确认', '确定要删除选中的' + row.length + '条单据信息吗?', function (r) { + if (r) { + var body =$("#depotHeadFM .datagrid-body"); + var footer =$("#depotHeadFM .datagrid-footer"); + for (var i = 0; i < row.length; i++) { + $('#materialData').datagrid('deleteRow', $('#materialData').datagrid("getRowIndex", row[i])); + self.statisticsFun(body,0,0,footer,0); + } + } + }); + } + } + }, + //单行删除明细 + removeit: function () { + if (editIndex == undefined) { return } + $('#materialData').datagrid('cancelEdit', editIndex) + .datagrid('deleteRow', editIndex); + editIndex = undefined; + }, + //撤销明细 + reject: function () { + $('#materialData').datagrid('rejectChanges'); + editIndex = undefined; + }, + //新增仓库 + appendDepot: function () { + $('#depotDlg').dialog('open').dialog('setTitle', ' 增加仓库信息'); + $(".window-mask").css({width: webW, height: webH}); + $('#depotFM').form('clear'); + bindDepotEvent(); + }, + //新增商品 + appendMaterial: function () { + js.addTabPage(null, "商品信息", "/pages/materials/material.html"); + }, + //判断明细 + CheckData: function (type) { + this.append(); + this.removeit(); + var change = $('#materialData').datagrid('getChanges').length; + if(type =="add" && !change) { + $.messager.alert('提示','请输入明细信息!','warning'); + return false; + } + var row = $('#materialData').datagrid('getRows'); + if(!row.length){ + $.messager.alert('提示',"请输入明细信息!",'info'); + return false; + } + var totalRowNum = ""; + for (var i = 0; i < row.length; i++) { + if (row[i].DepotId == "" || row[i].MaterialExtendId == "" || row[i].OperNumber == "" || row[i].UnitPrice === "" || row[i].AllPrice === "") { + totalRowNum += (i + 1) + "、"; + } + } + if (totalRowNum != "") { + var totalRowNum = totalRowNum.substring(0, totalRowNum.length - 1); + $.messager.alert('提示',"第" + totalRowNum + "行数据填写不完整!",'info'); + return false; + } + return true; + }, + //选择商品 + materialSelect: function(rec,monthTime) { + var self = this; + var body,footer,input; //定义表格和文本框 + var ratio = 1; //比例-名称专用 + var loadRatio = 1; //在单位输入框上面加载比例字段 + if(rec) { + var meId = rec.Id; + $.ajax({ + url: "/material/findByIdWithBarCode", + type: "get", + dataType: "json", + data: { + meId: meId + }, + success: function (res) { + if(res && res.code === 200) { + var info = res.data; + var commodityDecimal = info.commodityDecimal-0; //零售价 + var purchaseDecimal = info.purchaseDecimal-0; //采购价 + var wholesaleDecimal = info.wholesaleDecimal-0; //销售价 + var lowDecimal = info.lowDecimal-0; //最低售价 + var commodityUnit = info.commodityUnit; //商品单位 + body =$("#depotHeadFM .datagrid-body"); + footer =$("#depotHeadFM .datagrid-footer"); + input = ".datagrid-editable-input"; + body.find("[field='Unit']").find(input).prop("readonly","readonly"); //设置计量单位为只读 + body.find("[field='Unit']").find(input).val(commodityUnit); //设置单位 + if(info.unit){ //如果存在计量单位信息 + ratio = 1; //重置比例为1 + loadRatio = ratio; + } + else { + var unitName = info.unitName; + if(unitName) { + ratio = unitName.substring(unitName.indexOf(":")+1).replace(")",""); //给比例赋值 + unitName = unitName.substring(0, unitName.indexOf("(")); + } + var unitArr = unitName.split(","); + var basicUnit = unitArr[0]; //基础单位 + var otherUnit = unitArr[1]; //副单位 + if(basicUnit==commodityUnit){ //基础单位等于选择的单位 + loadRatio = 1; + } + else if(otherUnit==commodityUnit){ //副单位等于选择的单位 + loadRatio = ratio; + } + } + var detailPrice = 0; //明细列表-单价 + if(listSubType == "零售" || listSubType == "零售退货") { + detailPrice = commodityDecimal; + } + else if(listTitle == "采购订单列表" || listTitle == "采购入库列表" || listTitle == "采购退货列表" || listTitle == "其它入库列表") { + detailPrice = purchaseDecimal; + } + else if(listTitle == "销售订单列表" || listTitle == "销售出库列表" || listTitle == "销售退货列表" || listTitle == "其它出库列表" || listTitle == "调拨出库列表") { + detailPrice = wholesaleDecimal; + } + //单价和总价赋值 + if(!detailPrice) { + detailPrice = 0; + } + var operNumber = 1; + body.find("[field='OperNumber']").find(input).val(operNumber); //数量初始化 + body.find("[field='UnitPrice']").find(input).val(detailPrice); + body.find("[field='AllPrice']").find(input).val(detailPrice); + var taxRate = body.find("[field='TaxRate']").find(input).val()-0; //获取税率 + body.find("[field='TaxUnitPrice']").find(input).val((detailPrice*(1+taxRate/100)).toFixed(2)); //含税单价 + body.find("[field='TaxMoney']").find(input).val((detailPrice*(taxRate/100)).toFixed(2)); //税额 + body.find("[field='TaxLastMoney']").find(input).val((detailPrice*(1+taxRate/100)).toFixed(2)); //价税合计 + self.statisticsFun(body,detailPrice,1,footer,taxRate); + + //查询库存信息 + var depotId = body.find("[field='DepotId']").find(".textbox-value").val(); + if(depotId) { + var type = "select"; //type 类型:点击 click,选择 select + self.findStockNumById(depotId, meId, monthTime, body, input, loadRatio, type); + } + } + }, + error: function() { + $.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error'); + } + }); + } + }, + //新增单据主表及单据子表 + addDepotHeadAndDetail: function (url,infoStr) { + var self = this; + if(pageType=="skip") { + sessionStorage.removeItem("rowInfo"); + } + var inserted = $("#materialData").datagrid('getRows'); + var deleted = []; + var updated = []; + $.ajax({ + type:"post", + url: url, + contentType:"application/json", + dataType: "json", + async : false, + data: JSON.stringify({ + info:infoStr, + inserted: JSON.stringify(inserted), + deleted: JSON.stringify(deleted), + updated: JSON.stringify(updated) + }), + success: function (tipInfo){ + if(tipInfo){ + if(tipInfo.code!=200){ + $.messager.alert('提示', tipInfo.msg, 'warning'); + return; + } + $.messager.alert('提示','保存成功!','info'); + $('#depotHeadDlg').dialog('close'); + var opts = $("#tableData").datagrid('options'); + self.showDepotHeadDetails(opts.pageNumber,opts.pageSize); + }else { + $.messager.show({ + title: '错误提示', + msg: '保存信息失败,请稍后重试!' + }); + } + }, + //此处添加错误处理 + error:function() { + $.messager.alert('提示','保存信息异常,请稍后再试!','error'); + return; + } + }); + }, + //修改单据主表及单据子表 + updateDepotHeadAndDetail: function (url,infoStr,preTotalPrice) { + var self = this; + var inserted = $("#materialData").datagrid('getChanges', "inserted"); + var deleted = $("#materialData").datagrid('getChanges', "deleted"); + var updated = $("#materialData").datagrid('getChanges', "updated"); + $.ajax({ + type:"post", + url: url, + contentType:"application/json", + dataType: "json", + async : false, + data: JSON.stringify({ + id:url.substring(url.lastIndexOf("?id=")+4,url.length), + info:infoStr, + inserted: JSON.stringify(inserted), + deleted: JSON.stringify(deleted), + updated: JSON.stringify(updated), + preTotalPrice:preTotalPrice + }), + success: function (tipInfo){ + if(tipInfo){ + if(tipInfo.code!=200){ + $.messager.alert('提示', tipInfo.msg, 'warning'); + return; + } + $.messager.alert('提示','保存成功!','info'); + $('#depotHeadDlg').dialog('close'); + var opts = $("#tableData").datagrid('options'); + self.showDepotHeadDetails(opts.pageNumber,opts.pageSize); + if (endEditing()) { + $('#materialData').datagrid('acceptChanges'); + } + }else { + $.messager.show({ + title: '错误提示', + msg: '保存信息失败,请稍后重试!' + }); + } + }, + //此处添加错误处理 + error:function() { + $.messager.alert('提示','保存信息异常,请稍后再试!','error'); + return; + } + }); + } + } + //结束编辑明细 + function endEditing() { + if (editIndex == undefined) { return true } + if ($('#materialData').datagrid('validateRow', editIndex)) { + //仓库信息 + var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'}); + if(edDepot) { + var DepotName = $(edDepot.target).combobox('getText'); + $('#materialData').datagrid('getRows')[editIndex]['DepotName'] = DepotName; + } + //商品信息 + var edMaterial = $('#materialData').datagrid('getEditor', {index:editIndex,field:'MaterialExtendId'}); + if(edMaterial) { + var MaterialName = $(edMaterial.target).next().find('input.textbox-text').val(); + $('#materialData').datagrid('getRows')[editIndex]['MaterialName'] = MaterialName; + } + //其它信息 + $('#materialData').datagrid('endEdit', editIndex); + editIndex = undefined; + return true; + } else { + return false; + } + } + //单击明细 + function onClickRow(index) { + if (editIndex != index) { + if (endEditing()) { + $('#materialData').datagrid('selectRow', index).datagrid('beginEdit', index); + editIndex = index; + inOutService.autoReckon(); + setTimeout(function() { + var edMaterial = $('#materialData').datagrid('getEditor', {index:editIndex,field:'MaterialExtendId'}); + $(edMaterial.target).next().find('input.textbox-text').mouseup(); + },550); + } else { + $('#materialData').datagrid('selectRow', editIndex); + } + } + } diff --git a/erp_web/pages/bill/allocation_out_list.html b/erp_web/pages/bill/allocation_out_list.html new file mode 100644 index 00000000..240e22df --- /dev/null +++ b/erp_web/pages/bill/allocation_out_list.html @@ -0,0 +1,868 @@ + + + + 调拨出库 + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + - + +
+
+
+ 查询  + 重置 +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
单据日期 + + 单据编号 + +
+ +
+
+ +
+ +
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + + + + + + + + + +
单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
+
+
+ 打印 + 取消 +
+
+ + + \ No newline at end of file diff --git a/erp_web/pages/bill/assemble_list.html b/erp_web/pages/bill/assemble_list.html new file mode 100644 index 00000000..667a1d5b --- /dev/null +++ b/erp_web/pages/bill/assemble_list.html @@ -0,0 +1,865 @@ + + + + 组装单 + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + - + +
+
+
+ 查询  + 重置 +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
单据日期 + + 单据编号 + +
+ +
+
+ +
+
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + + + + + + + + + +
单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
+
+
+ 打印 + 取消 +
+
+ + + \ No newline at end of file diff --git a/erp_web/pages/bill/bill_detail.html b/erp_web/pages/bill/bill_detail.html new file mode 100644 index 00000000..46add577 --- /dev/null +++ b/erp_web/pages/bill/bill_detail.html @@ -0,0 +1,869 @@ + + + + 单据明细 + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + +
会员卡号: + + 单据日期: + + 单据编号: + + 付款类型: + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
实收金额
+ +
收款金额
+ +
找零
+ +
收款账户: + +
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + +
会员卡号: + + 单据日期: + + 单据编号: + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
实付金额
+ +
付款金额
+ +
找零
+ +
付款账户: + +
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
供应商: + + 单据日期: + + 单据编号: + + 关联订单: + +
+ +
+
单据备注: + +
优惠率: + + % + 付款优惠: + + 优惠后金额: + + 其它费用: + +
结算账户: + + 本次付款: + + 本次欠款: + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
供应商: + + 单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
优惠率: + + % + 付款优惠: + + 优惠后金额: + + 其它费用: + +
结算账户: + + 本次付款: + + 本次欠款: + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
客户: + + 单据日期: + + 单据编号: + + 关联订单: + +
+ +
+
单据备注: + +
优惠率: + + % + 收款优惠: + + 优惠后金额: + + 其它费用: + +
结算账户: + + 本次收款: + + 本次欠款: + + 销售人员: + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
客户: + + 单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
优惠率: + + % + 退款优惠: + + 优惠后金额: + + 其它费用: + +
结算账户: + + 本次退款: + + 本次欠款: + + 销售人员: + +
+
+ +
+ + + + + + + + + + + + + + + + + + + +
供应商: + + 单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
+
+ +
+ + + + + + + + + + + + + + + + + + + +
客户: + + 单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
+
+ +
+ + + + + + + + + + + + + + + + + + + +
单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
+
+ +
+ + + + + + + + + + + + + + + + + + + +
单据日期: + + 单据编号: + + 关联订单: + +
+ +
+
单据备注: + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
往来单位: + + 经手人: + + 单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
收款账户: + + 收款金额: + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
往来单位: + + 单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
付款账户: + + 付款金额: + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
付款单位: + + 经手人: + + 单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
优惠金额: + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
收款单位: + + 经手人: + + 单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
优惠金额: + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
经手人: + + 单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
付款账户: + + 实付金额: + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
付款会员: + + 经手人: + + 单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
优惠金额: + +
+
+ +
+ 打印 +
+
+ + diff --git a/erp_web/pages/bill/disassemble_list.html b/erp_web/pages/bill/disassemble_list.html new file mode 100644 index 00000000..ebe336ea --- /dev/null +++ b/erp_web/pages/bill/disassemble_list.html @@ -0,0 +1,866 @@ + + + + 拆卸单 + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + - + +
+
+
+ 查询  + 重置 +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
单据日期 + + 单据编号 + +
+ +
+
+ +
+ +
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + + + + + + + + + +
单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
+
+
+ 打印 + 取消 +
+
+ + + \ No newline at end of file diff --git a/erp_web/pages/bill/other_in_list.html b/erp_web/pages/bill/other_in_list.html new file mode 100644 index 00000000..da4549e3 --- /dev/null +++ b/erp_web/pages/bill/other_in_list.html @@ -0,0 +1,883 @@ + + + + 其它入库 + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + - + +
+
+
+ 查询  + 重置 +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
供应商 +
+ +
+
+ 增加供应商 +
+
单据日期 + + 单据编号 + + +
+ +
+
+ +
+
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + + + + + + + + + +
供应商: + + 单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
+
+
+ 打印 + 取消 +
+
+
+ + + diff --git a/erp_web/pages/bill/other_out_list.html b/erp_web/pages/bill/other_out_list.html new file mode 100644 index 00000000..4b2706cc --- /dev/null +++ b/erp_web/pages/bill/other_out_list.html @@ -0,0 +1,876 @@ + + + + 其它出库 + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + - + +
+
+
+ 查询  + 重置 +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
客户 + + 单据日期 + + 单据编号 + + +
+ +
+
+ +
+
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + + + + + + + + + +
客户: + + 单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
+
+
+ 打印 + 取消 +
+
+ + + \ No newline at end of file diff --git a/erp_web/pages/bill/purchase_back_list.html b/erp_web/pages/bill/purchase_back_list.html new file mode 100644 index 00000000..0b7a4191 --- /dev/null +++ b/erp_web/pages/bill/purchase_back_list.html @@ -0,0 +1,1018 @@ + + + + 采购退货 + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + - + +
+
+
+ 查询  + 重置 +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
供应商 + + 单据日期 + + 单据编号 + + +
+ +
+
+ +
优惠率 + + % + 退款优惠 + + 优惠后金额 + + 其它费用 + + +
结算账户 + + + 本次退款 + + 本次欠款 + + +
+ +
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
供应商: + + 单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
优惠率: + + % + 付款优惠: + + 优惠后金额: + + 其它费用: + +
结算账户: + + 本次付款: + + 本次欠款: + + +
+
+
+ 打印 + 取消 +
+
+ + + + + + + + + + + + + + + + + + +
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + +
支出项目金额
合计:
+ + + + + + +
+
+
+ 保存 + 取消 +
+
+ + + diff --git a/erp_web/pages/bill/purchase_in_list.html b/erp_web/pages/bill/purchase_in_list.html new file mode 100644 index 00000000..c22c178e --- /dev/null +++ b/erp_web/pages/bill/purchase_in_list.html @@ -0,0 +1,1036 @@ + + + + 采购入库 + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + - + +
+
+
+ 查询  + 重置 +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
供应商 +
+ +
+
+ 增加供应商 +
+
单据日期 + + 单据编号 + + 关联订单 + +
+ +
+
+ +
优惠率 + + % + 付款优惠 + + 优惠后金额 + + 其它费用 +
+ +
+ +
结算账户 + + + + 本次付款 + + 本次欠款 + + +
+ +
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
供应商: + + 单据日期: + + 单据编号: + + 关联订单: + +
+ +
+
单据备注: + +
优惠率: + + % + 付款优惠: + + 优惠后金额: + + 其它费用: + +
结算账户: + + 本次付款: + + 本次欠款: + +
+
+
+ 打印 + 取消 +
+
+ + + + + + + + + + + + + + + + + + +
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + +
支出项目金额
合计:
+ + + + + + +
+
+
+ 保存 + 取消 +
+
+
+
+ + + diff --git a/erp_web/pages/bill/purchase_orders_list.html b/erp_web/pages/bill/purchase_orders_list.html new file mode 100644 index 00000000..e5ca5024 --- /dev/null +++ b/erp_web/pages/bill/purchase_orders_list.html @@ -0,0 +1,970 @@ + + + + 采购订单 + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + - + +
+
+
+ 查询  + 重置 +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
供应商 +
+ +
+
+ 增加供应商 +
+
单据日期 + + 单据编号 + + +
+ +
+
+ +
+ +
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + + + + + + + + + +
供应商: + + 单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
+
+
+ 打印 + 取消 +
+
+ + + + + + + + + + + + + + + + + + +
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + +
支出项目金额
合计:
+ + + + + + +
+
+
+ 保存 + 取消 +
+
+
+ + + diff --git a/erp_web/pages/bill/retail_back_list.html b/erp_web/pages/bill/retail_back_list.html new file mode 100644 index 00000000..4325db3a --- /dev/null +++ b/erp_web/pages/bill/retail_back_list.html @@ -0,0 +1,1035 @@ + + + + 零售退货 + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + - + +
+
+
+ 查询  + 重置 +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
会员卡号 + + 单据日期 + + 单据编号 + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
实付金额
+ +
付款金额
+ +
找零
+ +
付款账户 + + +
+
+ +
+ +
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + + + + + + + + +
会员卡号: + + 单据日期: + + 单据编号: + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
实付金额
+ +
付款金额
+ +
找零
+ +
付款账户: + +
+
+ +
+
+
+ 打印 + 取消 +
+
+ + + \ No newline at end of file diff --git a/erp_web/pages/bill/retail_out_list.html b/erp_web/pages/bill/retail_out_list.html new file mode 100644 index 00000000..0f2dac88 --- /dev/null +++ b/erp_web/pages/bill/retail_out_list.html @@ -0,0 +1,1075 @@ + + + + 零售出库 + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + - + +
+
+
+ 查询  + 重置 +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
会员卡号 +
+ +
+
+ 增加会员 +
+
单据日期 + + 单据编号 + + 付款类型 + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
实收金额
+ +
收款金额
+ +
找零
+ +
收款账户 + + +
+
+ +
+ +
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + + + + + + + + +
会员卡号: + + 单据日期: + + 单据编号: + + 付款类型: + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
实收金额
+ +
收款金额
+ +
找零
+ +
收款账户: + +
+
+ +
+
+
+ 打印 + 取消 +
+
+ + + + + + + + + + + + + + + + + + +
+
+
+ 保存 + 取消 +
+
+
+ + + diff --git a/erp_web/pages/bill/sale_back_list.html b/erp_web/pages/bill/sale_back_list.html new file mode 100644 index 00000000..74f94c63 --- /dev/null +++ b/erp_web/pages/bill/sale_back_list.html @@ -0,0 +1,1063 @@ + + + + 销售退货 + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + - + +
+
+
+ 查询  + 重置 +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
客户 + + 单据日期 + + 单据编号 + +
+ +
+
+ +
优惠率 + + % + 退款优惠 + + 优惠后金额 + + 其它费用 + + +
结算账户 + + + 本次退款 + + 本次欠款 + + 销售人员 + +
+
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
客户: + + 单据日期: + + 单据编号: + +
+ +
+
单据备注: + +
优惠率: + + % + 退款优惠: + + 优惠后金额: + + 其它费用: + +
结算账户: + + 本次退款: + + 本次欠款: + + 销售人员: + +
+
+
+ 打印 + 取消 +
+
+ + + + + + + + + + + + + + + + + + +
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + +
支出项目金额
合计:
+ + + + + + +
+
+
+ 保存 + 取消 +
+
+ + + \ No newline at end of file diff --git a/erp_web/pages/bill/sale_orders_list.html b/erp_web/pages/bill/sale_orders_list.html new file mode 100644 index 00000000..d75b3242 --- /dev/null +++ b/erp_web/pages/bill/sale_orders_list.html @@ -0,0 +1,1018 @@ + + + + 销售订单 + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + - + +
+
+
+ 查询  + 重置 +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
客户 +
+ +
+
+ 增加客戶 +
+
单据日期 + + 单据编号 + + 销售人员 + +
+ +
+
+ +
+
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + + + + + + + + + +
客户: + + 单据日期: + + 单据编号: + + 销售人员: + +
+ +
+
单据备注: + +
+
+
+ 打印 + 取消 +
+
+ + + + + + + + + + + + + + + + + + +
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + +
支出项目金额
合计:
+ + + + + + +
+
+
+ 保存 + 取消 +
+
+
+ + + diff --git a/erp_web/pages/bill/sale_out_list.html b/erp_web/pages/bill/sale_out_list.html new file mode 100644 index 00000000..96868353 --- /dev/null +++ b/erp_web/pages/bill/sale_out_list.html @@ -0,0 +1,1099 @@ + + + + 销售出库 + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + - + +
+
+
+ 查询  + 重置 +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
客户 +
+ +
+
+ 增加客戶 +
+
单据日期 + + 单据编号 + + 关联订单 + +
+ +
+
+ +
优惠率 + + % + 收款优惠 + + 优惠后金额 + + 其它费用 +
+ +
+ +
结算账户 + + + + 本次收款 + + 本次欠款 + + 销售人员 + +
+
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
客户: + + 单据日期: + + 单据编号: + + 关联订单: + +
+ +
+
单据备注: + +
优惠率: + + % + 收款优惠: + + 优惠后金额: + + 其它费用: + +
结算账户: + + 本次收款: + + 本次欠款: + + 销售人员: + +
+
+
+ 打印 + 取消 +
+
+ + + + + + + + + + + + + + + + + + +
+
+
+ 保存 + 取消 +
+
+ + + + + + + + + + + +
支出项目金额
合计:
+ + + + + + +
+
+
+ 保存 + 取消 +
+
+
+
+ + + diff --git a/erp_web/pages/manage/person.html b/erp_web/pages/manage/person.html new file mode 100644 index 00000000..a40db30b --- /dev/null +++ b/erp_web/pages/manage/person.html @@ -0,0 +1,453 @@ + + + + 经手人管理 + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ 查询  + 重置 +
+
+
+
+ +
+
+ + + + + + + + + +
姓名 + +
类型 + +
+
+
+
+ 保存 + 取消 +
+ + + + \ No newline at end of file