大型商贸系统(进货管理)技术解析(二)自营进仓单录入

功能介绍:

     自营进仓单录入为进货店的客户进行开单,是根据商品订单来进仓。对于商品进仓,系统提供了2种方式:(1)实现一次性全部将需求的商品信息进行进货。实现一次进货需要选择相应的订货单,录入到相应的进仓单,根据需要进行修改后经过审核来实现一次性进货。(2)实现分批进货。在选择相应的订单或者合同后,新增相应的进仓单,根据需要进行相应修改,然后审核,在审核中可以改变每种商品的入库件数来进行分批入库,在改变件数时入库件数与还缺入库数的比较,待分批进货到还缺入库数为”0“时,才把进仓单的审核否改为”true“,把订单中的订单状态改为”已进货“,从而实现了商品的分批进货。

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

 图2.1

自营进仓单录入用到的控件有:

    控件名称

说明

       

下拉框(easyui-combobox)

设置该控件的ID,设置其大小,若不设置也用默认值,可以在data-options进行数据操作:设置该控件的一些属性和事件。

   日期时间控件

(easyui-datetimebox)

日期时间输入框允许用户选择日期和指定的时间并按照指定的输出格式显示。相比日期输入框,它在下拉面板中添加了一个时间微调器。可以在data-options进行数据操作:设置该控件的一些属性和事件

   文本框(text)

在Input中可以设置其一些属性和事件

 

功能实现:

第一步:数据库:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

表1:进仓单表(Repertory_enter)

用于存放商品进仓单信息

  列名

 数据类型

  主键/外键

  说明

Repertory_enter_id

  int

   主键

  进仓单id

Repertory_place_id

  int

   外键

仓库地点id

Indent_id

  int

   外键

 订单id

Hava_indent_deny

  Bit

 

 有无订单否

Receiver_id

  int

   外键

 收货人id

Record_number

 nchar(20)

 

 记录编号

Registrant_id

  int

  外键

 登记人id

Register_time

 datetime

 

 登记时间

Auditor_id

  int

  外键

 审核人id

Review_time

  datetime

 

 审核时间

Affix_count

nchar(10)

 

附件张数

Type_of_operation_pubid

  int

外键

经营方式pubid

Original_number

nchar(20)

 

原始单号

Agreement_id

  int

外键

合同id

Review_deny

 Bit

 

 审核否

YouXiaoFou

 Bit

 

 有效否

表2:进仓明细表(Repertory_enter_detail)

用于记录进仓明细单信息

  列名

数据类型

主键/外键

说明

Repertory_enter_detail_id

int

主键

进仓明细id

Repertory_enter_detail_Farid

int

外键

进仓明细farid

Repertory_enter_id

int

外键

进仓id

Goods_id

int

外键

商品id

Repertory_enter_packages

decimal(18,0)

 

入库件数

Repertory_enter_quantity

decimal(18,0)

 

入库细数

Giveaway_quantity

decimal(18,0)

 

物扣数量

Review_deny

bit

 

审核否

Auditor_id

int

外键

审核人id

Review_time

datetime

 

审核时间

ChongHong_deny

Bit

 

冲红否

 

 

表3:商品订单表(Goods_indent)

用于记录所选商品定单信息

列名

数据类型

  主键/外键

  说明

Indent_id

    int

  主键

  订单id

Agreement_id

   int

外键

合同id

Indent_number

 nchar(10)

 

订单号

Indent_type_pubid

 int

外键

订单类型id

Settle_accounts_way_pubid

  int

外键

结算方式pubid

Indent_begin_date

datetime

 

订单开始时间

Indent_end_date

datetime

 

订单结束时间

Voluntarily_indent_deny

Bit

 

自动订单否

Delivery_indent

nchar(10)

 

交货订单

Indent_time

datetime

 

订单时间

Delivery_way_pubid

int

外键

交货方式pubid

Indent_status_pubid

int

外键

订单状态Pubid

Indent_execute_situation_pubid

int

外键

订单执行情况Pubid

Registrant_id

int

外键

登记人id

Register_time

datetime

 

登记时间

Auditor_id

int

外键

审核人id

Review_time

datetime

 

审核时间

Cancel_person_id

int

外键

取消人id

Cancel_time

datetime

 

取消人时间

Indent_price_person_id

int

外键

定价人Pubid

Prices_auditor_id

int

外键

物价审核人pubid

Department_id

int

外键

部门id

Place_of_delivery

nchar(10)

 

交货地点

Review_deny

Bit

 

审核否

表4:商品订单明细表(Goods_indent_detail)

用于记录所选商品定单明细信息

列名

数据类型

主键/外键

说明

Goods_indent_detail_id

int

主键

商品订单明细id

Goods_id

int

外键

商品id

Indent_id

int

外键

订单id

Repertory_enter_packages

int

 

入库件数

Purchase_number

int

 

物购数量

表5:仓库地点表(Repertory_place)

用于记录仓库地点信息

列名

数据类型

主键/外键

说明

Repertory_place_id

int

主键

仓库地点id

Responsible_person_id

int

外键

负责人id

Department_id

int

主键

部门id

Repertory_place_name

nchar(10)

 

仓库地点名称

Contact_way

nchar(10)

 

联系方式

Address

nchar(10)

 

地址

Effective_deny

nchar(10)

 

有效否

Remarks

nchar(10)

 

备注

Repertory_place_identifier

nchar(10)

 

仓库地点编号

表六:员工表(Eemployee)

用于记录员工信息

列名

数据类型

主键/外键

说明

Employee_id

int

主键

员工id

Employee_number

nchar(12)

 

员工编号

Employee_name

nchar(10)

 

员工名称

Department_id

int

外键

部门id

Duties_id

int

外键

职务id

Sex

int

外键

性别pubid

 

控件使用方法:

1.     下拉框控件(easyui-combobox)

作用:同一性质的事物放在一起,用户可以进行方便快捷选择一个或多个当前列表中的值。

下拉框控件截图:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

绑定下拉框的存储过程:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

绑定下拉框的界面代码:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

获取下拉框的值代码:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

绑定下拉框控制器代码:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

绑定下拉框逻辑层代码:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

2.     日期时间控件(easyui-datetimebox)

作用:日期时间输入框允许用户选择日期和指定的时间并按照指定的输出格式显示。

日期时间控件截图:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

创建日期时间控件界面代码:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

在javascript中创建日期时间格式代码:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

获取界面时间日期控件值代码:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

3.     文本框控件(text)

作用:是一个增强的输入字段组件,它允许用户非常简单的创建一组表单。

文本框值的获取代码:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

第二步:实现界面上由系统自动生成的“记录编号“功能

1.效果截图

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

2.实现记录编号的界面上代码:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

3.在JavaScript中代码:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

4.控制器代码:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

5.逻辑层代码实现:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

6.存储过程:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

第三步:大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网对此按钮功能实现:

1.         点击添加后的效果截图如下:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

2.点击“添加”按钮的功能实现:

点击“添加”按钮,将会弹出“选择订货清单”的窗口,界面代码:


大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

<bodystyle="text-align:center"></body>中代码可以实现“选择订货清单”的界面效果:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

3.对此功能在JavaScript中的代码:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网
大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

4.对此功能控制器实现代码:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

5.对此功能逻辑层代码实现:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网
大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

6.存储过程代码:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

7.要实现在界面中datagrit里面有日期的单元格格式转换可以在存储过程中进行操作:

效果图:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

在存储过程操作:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

第四步:对“商品进仓单”界面窗口实现

1.         效果图:

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

界面代码:

<!DOCTYPE html>
<html>
<head><meta content="text/javascript;charset=utf-8" /><title>自营进窗单处理</title><link href="../../Content/yxsss/js_css/yu.css" rel="stylesheet" /><link href="../../Content/jquery-easyui-1.3.3/themes/icon.css" rel="stylesheet" /><link href="../../Content/jquery-easyui-1.3.3/demo/demo.css" rel="stylesheet" /><link href="../../Content/WuYinCSS/PublicCSS.css" rel="stylesheet" /><link href="../../Content/jquery-easyui-1.3.3/themes/default/easyui.css" rel="stylesheet" /><script src="../../Content/jquery-easyui-1.3.3/jquery.min.js"></script><script src="../../Content/jquery-easyui-1.3.3/jquery.easyui.min.js"></script><script src="../../Content/jquery-easyui-1.3.3/easyloader.js"></script><script src="../../Content/yxsss/js_css/yu.js"></script><style type="text/css">body { text-align: center; font-size: 20px; }input { margin-top: 1px; margin-left: 5px; margin-right: 5px; font-size: 15px; }button { height: 24px; font-size: 20px; margin: 1px 3px 1px 3px; border: 1px inset #b0e0e6; background-color: #b0e0e6; }</style>
</head>
<script type="text/javascript">$(document).ready(function () {$("#wShangPinJinCangDan").show(700);$('#DaYin').attr("disabled", true);$("#ConsignmentDepartmentCode").attr("disabled", true);SelectJiLuBianHao();});//开始编辑var editIndex = undefined;function onClickRowMingXi(index) {if (editIndex != index) {$('#tb进窗信息').datagrid('beginEdit', index);$('#tb进窗信息').datagrid('endEdit', editIndex);editIndex = index;} else {$('#tb进窗信息').datagrid('endEdit', index);$('#tb进窗信息').datagrid('beginEdit', index);}}function ashda() {var updaterrows = $('#tb进窗信息').datagrid('getChanges');var jinCangXinXi = $('#tb进窗信息').datagrid('getSelected');var rowsCount = updaterrows.length;if (rowsCount > 0) {var wuKouShuLiang = parseFloat(jinCangXinXi.Purchase_number);var haiYaoRuKuShu = parseFloat(jinCangXinXi.HaiYaoRuKuShu);var aaa = parseFloat(jinCangXinXi.AAA);var zongYaoRuKuShu = parseFloat(aaa + wuKouShuLiang);if (zongYaoRuKuShu > haiYaoRuKuShu) {ui.error('入库数必须要小于还缺入库数', 1000, false);} else {}}}//计算function onAfterEdit(rowIndex) {//通过计算价款 税金 价税合计 入库细数,(零售单价,包装含量,入库件数,进项税率,含税进价)var dataMingXi = $('#tb进窗信息').datagrid('getRows');var jianShu = dataMingXi[rowIndex].Repertory_enter_packages;var baoZhuangHanLiang = dataMingXi[rowIndex].Quality_content;var rowMingXi = dataMingXi[rowIndex];rowMingXi.AAA = jianShu * baoZhuangHanLiang;var dataMingXi = $('#tb进窗信息').datagrid('getRows');var jiaKuan = 0;var shuijiaheji = 0;var shuijin = 0;for (var i = 0; i < dataMingXi.length; i++) {shuijin += parseFloat(parseFloat(dataMingXi[i].Purchase_bid) * parseFloat(dataMingXi[i].Input_ratio / 100) * parseFloat(dataMingXi[i].AAA));shuijiaheji += parseFloat(parseFloat(dataMingXi[i].AAA) * parseFloat(dataMingXi[i].BBB));}jiaKuan = parseFloat((shuijiaheji - shuijin));if (!isNaN(shuijin)) {$('#txtShuiJin').val("¥" + shuijin).css('color', 'red');}if (!isNaN(shuijiaheji)) {$('#txtJiaShuiHeJi').val("¥" + shuijiaheji).css('color', 'red');}if (!isNaN(jiaKuan)) {$('#txtJiaKuang').val("¥" + jiaKuan).css('color', 'red');}ashda();}//查询订货清单信息function OpenwXuanZeDingHuoQingDanXiAll() {$('#Auditor').combobox({ disabled: true });//对“审核人”文本框的禁用$('#datshenheshijian').datetimebox({ disabled: true });//对“审核时间”的日期时间控件的禁用//隐藏datagrit为:tb进窗信息中的列名为:YiRuKuShu,HaiYaoRuKuShu的列$("#tb进窗信息").datagrid('hideColumn', 'YiRuKuShu');$("#tb进窗信息").datagrid('hideColumn', 'HaiYaoRuKuShu');$('#wXuanZeDingHuoQingDanXiAll').window('open');//打开“选择订货清单”的窗口//绑定订货清单中的datagrit中的信息$.getJSON("/ShangPinJinChuangDan/SelectOrderGoodsSpecificationInformation", function (data) {$('#tbXuanZeDingHuoQingDanXiAll').datagrid({ loadFilter: pagerFilter }).datagrid('loadData', data);});//实现分页代码function pagerFilter(data) {if (typeof data.length == 'number' && typeof data.splice == 'function') {	// is arraydata = {total: data.length,rows: data}}var dg = $(this);var opts = dg.datagrid('options');var pager = dg.datagrid('getPager');pager.pagination({onSelectPage: function (pageNum, pageSize) {opts.pageNumber = pageNum;opts.pageSize = pageSize;pager.pagination('refresh', {pageNumber: pageNum,pageSize: pageSize});dg.datagrid('loadData', data);}});if (!data.originalRows) {data.originalRows = (data.rows);}var start = (opts.pageNumber - 1) * parseInt(opts.pageSize);var end = start + parseInt(opts.pageSize);data.rows = (data.originalRows.slice(start, end));return data;}}//模糊查询订货清单信息function MoHiuChaXunXuanZeDingHuoQingDanXiAll() {if ($("#strBlur").val() == "") {ui.alert("请输入查询内容!!!", 1000, false);}else {$.getJSON("/ShangPinJinChuangDan/VagueSelectChooseOrderGoodsSpecificationInformationAll?strBlur=" + $("#strBlur").val(),function (data) {$('#tbXuanZeDingHuoQingDanXiAll').datagrid('loadData', data);});}}//双击订货清单var Department_id = 0;var Indent_id = 0;function DblDingHuoQingDan(rowIndex, rowData) {$('#wXuanZeDingHuoQingDanXiAll').window('close');$('#IndentNumber').val(rowData.Indent_number);$('#IndentType').val(rowData.Attribute_gather_detail_name);$('#jiesuanfangshi').val(rowData.settlement);$('#ConsignmentDepartmentCode').val(rowData.ConsignmentDepartmentCode);$('#ConsignmentDepartmentName').val(rowData.ConsignmentDepartmentName);$('#AgreementCode').val(rowData.Agreement_code);$('#Buyer').val(rowData.Buyer);$('#SupplyUnits').val(rowData.Chinese);Department_id = rowData.Department_id;Indent_id = rowData.Indent_id;$.getJSON("/ShangPinJinChuangDan/SelectInventoryPlaceByDepartment_id?Department_id=" + rowData.Department_id, function (data) {$('#RepertoryPlaceIdentifier').combobox({data: data, valueField: 'Repertory_place_id',textField: 'Repertory_place_identifier'});});//获取收货人编号$.getJSON("/ShangPinJinChuangDan/SelectShouHuoRenBianHao?Department_id=" + rowData.Department_id, function (data) {$('#shouhuorenbianhao').combobox({data: data, valueField: 'Employee_id',textField: 'Employee_number'});});BindingIndentDetail(rowData.Indent_id);}//绑定订单单明细function BindingIndentDetail(indentId) {$.getJSON("/ShangPinJinChuangDan/BindingIndentDetail?Indent_id=" + indentId, function (result) {$('#tb进窗信息').datagrid('loadData', result);var rows = $('#tb进窗信息').datagrid('getRows');for (var i = 0; i < rows.length; i++) {onAfterEdit(i);}});}//获取库存地点名称function getRepertory_place_name() {var repertoryPlaceId = $('#RepertoryPlaceIdentifier').combobox('getValue');$.getJSON("/ShangPinJinChuangDan/SelectRepertory_place_nameByRepertory_place_id?Repertory_place_id=" + repertoryPlaceId, function (data1) {$('#kucunMC').val(data1[0].Repertory_place_name);});}//获取收货人名称function getReceiver_nam() {var employeeId = $('#shouhuorenbianhao').combobox('getValue');$.getJSON("/ShangPinJinChuangDan/SelectReceiver_namByEmployee_id?Employee_id=" + employeeId, function (data2) {$('#ReceiverName').val(data2[0].Receiver);});}//添加/修改进仓单function BaoCunJinCangDan() {if (Repertory_enter_id == 0) {ui.confirm('是否新增???', function (r) {if (r)if ($('#shouhuorenbianhao').combobox('getValue') == "" || $('#dengjiren').combobox('getValue') == "" ||$('#RepertoryPlaceIdentifier').combobox('getValue') == "" || $('#txtJiLuBianMa').val() == "" ||$('#datdengjishijian').datetimebox('getValue') == "") {ui.error("数据不完整,新增失败!", 1000, false);return false;}$.getJSON("/ShangPinJinChuangDan/Insert_Repertory_enter?indentId=" + Indent_id + "&"+ "receiverId=" + $('#shouhuorenbianhao').combobox('getValue') + "&"+ "recordNumber=" + $('#txtJiLuBianMa').val() + "&"+ "registrantId=" + $('#dengjiren').combobox('getValue') + "&"+ "registerTime=" + $('#datdengjishijian').datetimebox('getValue') + "&"+ "repertoryPlaceId=" + $('#RepertoryPlaceIdentifier').combobox('getValue') + "&"+ "affixCount=" + $('#txtFuJianZhangShu').val() + "&"+ "originalNumber=" + $('#Original_number').val() + "&",function (data) {if (data > 0) {var dataMingXi = $('#tb进窗信息').datagrid('getRows');var repertoryEnterId = data;for (var i = 0; i < dataMingXi.length; i++) {$.getJSON("/ShangPinJinChuangDan/InsertRepertoryEnterDetail?" +"Repertory_enter_id=" + repertoryEnterId + '&' +"Goods_id=" + dataMingXi[i].Goods_id + '&' +"Repertory_enter_quantity=" + dataMingXi[i].AAA + '&' +"Repertory_enter_packages=" + dataMingXi[i].Repertory_enter_packages + "&" +"Giveaway_quantity=" + dataMingXi[i].Purchase_number);}ui.alert("新增成功!!!", 1000, false);QingChu();SelectJiLuBianHao();} else {ui.error("新增失败!!!", 1000, false);}});});} else if (Repertory_enter_id > 0) {ui.confirm('是否修改???', function (r) {if (r)$.getJSON("/ShangPinJinChuangDan/Update_Repertory_enter?indentId=" + Indent_id + "&"+ "receiverId=" + $('#shouhuorenbianhao').combobox('getValue') + "&"+ "recordNumber=" + $('#txtJiLuBianMa').val() + "&"+ "registrantId=" + $('#dengjiren').combobox('getValue') + "&"+ "registerTime=" + $('#datdengjishijian').datetimebox('getValue') + "&"+ "repertoryPlaceId=" + $('#RepertoryPlaceIdentifier').combobox('getValue') + "&"+ "affixCount=" + $('#txtFuJianZhangShu').val() + "&"+ "originalNumber=" + $('#Original_number').val() + "&"+ "repertoryEnterId=" + Repertory_enter_id + "&",function (data) {if (data > 0) {var dataMingXi = $('#tb进窗信息').datagrid('getRows');var repertoryEnterId = data;for (var i = 0; i < dataMingXi.length; i++) {$.getJSON("/ShangPinJinChuangDan/InsertRepertoryEnterDetail?" +"Repertory_enter_id=" + repertoryEnterId + '&' +"Goods_id=" + dataMingXi[i].Goods_id + '&' +"Repertory_enter_quantity=" + dataMingXi[i].AAA + '&' +"Repertory_enter_packages=" + dataMingXi[i].Repertory_enter_packages + "&" +"Giveaway_quantity=" + dataMingXi[i].Purchase_number);}ui.alert("修改成功!", 1000, false);//$.getJSON("/ShangPinJinChuangDan/BindingIndentDetail?Indent_id=" + Indent_id, function (result) {//    $('#tb进窗信息').datagrid('loadData', result);//});} else {ui.error("修改失败!", 1000, false);}});});} else {ui.error("保存失败!", 1000, false);}}//打开自营进仓单查找窗口function OpenZiYingJinCangDanChaZhao() {$('#Auditor').combobox({ disabled: false });$('#datshenheshijian').datetimebox({ disabled: false });$("#tb进窗信息").datagrid('showColumn', 'YiRuKuShu');$("#tb进窗信息").datagrid('showColumn', 'HaiYaoRuKuShu');parent.document.getElementById("labTips").innerHTML = "";$.getJSON("/ShangPinJinChuangDan/SelectBuildByOneselfWarehouseEntry", function (data) {$('#tbZiYingJinCangDanChaXun').datagrid({ loadFilter: pagerFilter }).datagrid('loadData', data);});function pagerFilter(data) {if (typeof data.length == 'number' && typeof data.splice == 'function') {	// is arraydata = {total: data.length,rows: data}}var dg = $(this);var opts = dg.datagrid('options');var pager = dg.datagrid('getPager');pager.pagination({onSelectPage: function (pageNum, pageSize) {opts.pageNumber = pageNum;opts.pageSize = pageSize;pager.pagination('refresh', {pageNumber: pageNum,pageSize: pageSize});dg.datagrid('loadData', data);}});if (!data.originalRows) {data.originalRows = (data.rows);}var start = (opts.pageNumber - 1) * parseInt(opts.pageSize);var end = start + parseInt(opts.pageSize);data.rows = (data.originalRows.slice(start, end));return data;}//shenHe2();//shenHe3();$("#wZiYingJinCangDanChaXun").window('open');}//条件查询自营进仓单function SelectBuildByOneselfWarehouseEntry(value) {$('#tbZiYingJinCangDanChaXun').datagrid({ url: '/ShangPinJinChuangDan/SelectBuildByOneselfWarehouseEntry?strBlur=' + value });}//双击自营进仓单var Repertory_enter_id = 0;var Indent_id = 0;function DblZiYingJinCangDan(rowIndex, rowData) {Repertory_enter_id = rowData.Repertory_enter_id;Indent_id = rowData.Indent_id;$.getJSON("/ShangPinJinChuangDan/SelectInventoryPlaceByDepartment_id?Department_id=" + rowData.Department_id, function (data) {$('#RepertoryPlaceIdentifier').combobox({data: data, valueField: 'Repertory_place_id',textField: 'Repertory_place_identifier'});$('#RepertoryPlaceIdentifier').combobox('setValue', rowData.Repertory_place_id);});//获取收货人编号$.getJSON("/ShangPinJinChuangDan/SelectShouHuoRenBianHao?Department_id=" + rowData.Department_id, function (data) {$('#shouhuorenbianhao').combobox({data: data, valueField: 'Employee_id',textField: 'Employee_number'});$('#shouhuorenbianhao').combobox('setValue', rowData.Receiver_id);});$('#dengjiren').combobox('setValue', rowData.Registrant_id);$('#datdengjishijian').datetimebox('setValue', rowData.Register_time);bangDingJinCangDan(rowData);}//绑定进仓单function bangDingJinCangDan(rowData) {$("#txtJiLuBianMa").val(rowData.Record_number);$('#wZiYingJinCangDanChaXun').window('close');$('#ConsignmentDepartmentName').val(rowData.Department_name);$('#AgreementCode').val(rowData.Agreement_code);$('#SupplyUnits').val(rowData.Chinese);$('#IndentNumber').val(rowData.Indent_number);$('#IndentType').val(rowData.DingDanLeiXingMC);$('#ConsignmentDepartmentCode').val(rowData.Department_code);$('#jiesuanfangshi').val(rowData.JieSuanFangShiMC);$('#Buyer').val(rowData.Buyer);$('#txtFuJianZhangShu').val(rowData.Affix_count);$('#Original_number').val(rowData.Original_number);$('#kucunMC').val(rowData.Repertory_place_name);$('#ReceiverName').val(rowData.Receiver);BindingRepertoryEnterDetail(rowData.Repertory_enter_id);}//绑定进仓明细function BindingRepertoryEnterDetail(repertoryEnterId) {$.getJSON("/ShangPinJinChuangDan/BindingRepertoryEnterDetail?Repertory_enter_id=" + repertoryEnterId +"&Review_deny=false", function (result) {$('#tb进窗信息').datagrid('loadData', result);onAfterEdit(0);//$('#tb进窗信息').datagrid('selectRow', 0).datagrid('beginEdit', 0);//$('#tb进窗信息').datagrid('selectRow', 0).datagrid('endEdit', 0);});}//放弃进仓单function GiveUpJin() {location.reload([window.bFrceGet]);}//删除进仓单function delete_Repertory_enter() {ui.confirm('是否删除???', function (r) {if (r)$.getJSON("/ShangPinJinChuangDan/delete_Repertory_enter_detail?Repertory_enter_id=" + Repertory_enter_id,function (data) {$.getJSON("/ShangPinJinChuangDan/delete_Repertory_enter?Repertory_enter_id=" + Repertory_enter_id,function (data2) {if (data2 > 0) {ui.error("删除成功", 1000, false);QingChu();}});});});}//查询记录编号function SelectJiLuBianHao() {$.getJSON("/ShangPinJinChuangDan/SelectJiLuBianHao", function (data) {$('#txtJiLuBianMa').val(data);});$('#FaHuoBuMenDaiMa').combobox({ url: '/KuCunGuanLi/GetFaHuoBuMen' });$('#ShouHuoBuMenDaiMa').combobox({ url: '/KuCunGuanLi/GetFaHuoBuMen' });}//生成序列号function returnIndex(field, data, index) {return index + 1;}//日期格式function myformatter(date) {var y = date.getFullYear();var m = date.getMonth() + 1;var d = date.getDate();var h = date.getHours();var min = date.getMinutes();var s = date.getSeconds();return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d) + " " + h + ":" + min + ":" + s;}//修改function UpdataJinCangDan() {$('#Auditor').combobox({ disabled: true });$('#datshenheshijian').datetimebox({ disabled: true });$('#TianJia').attr("disabled", true);$('#ShanChu').attr("disabled", true);$('#txtJiLuBianMa').attr("disabled", true);}//审核function ShenHe() {var jinCangMingXi = $('#tb进窗信息').datagrid('getRows');var strs = "";parent.document.getElementById("labTips").innerHTML = "";for (var i = 0; i < jinCangMingXi.length; i++) {strs += jinCangMingXi[i].AAA + ',';strs += jinCangMingXi[i].Repertory_enter_detail_id + ',';strs += jinCangMingXi[i].AAA1 + ',';strs += jinCangMingXi[i].Repertory_enter_packages + ',';strs += jinCangMingXi[i].Goods_name + ',';strs += jinCangMingXi[i].Purchase_number + '.';}var auditor = $('#Auditor').combobox('getValue');var reviewTime = $('#datshenheshijian').datetimebox('getValue');var jiLuBianMa = $('#txtJiLuBianMa').val();$.getJSON("/ShangPinJinChuangDan/shenhe?strs=" + strs + "&" +"repertoryEnterid=" + Repertory_enter_id + "&" +"auditor=" + auditor + "&" +"reviewTime=" + reviewTime + "&" +"jiLuBianMa=" + jiLuBianMa,function (data) {var tip = "";if (data == "审核成功!") {ui.alert("审核成功!", 1000, false);QingChu();} else {var strs1 = data.split('+');for (var j = 0; j < strs1.length - 1; j++) {tip += "<li style='font-size:15px;margin-left:1px;'>" + strs1[j] + "</li>";}}if (tip != "") {parent.document.getElementById("labTips").innerHTML = "<ol >" + tip + "</ol>";}});}//对放弃按钮的操作function QingChu() {$('#txtJiLuBianMa').val('');$('#ConsignmentDepartmentCode').val('');$('#ConsignmentDepartmentName').val('');$('#AgreementCode').val('');$('#IndentNumber').val('');$('#IndentType').val('');$('#jiesuanfangshi').val('');$('#Buyer').val('');$('#SupplyUnits').val('');$('#RepertoryPlaceIdentifier').combobox('clear');$('#kucunMC').val('');$('#shouhuorenbianhao').combobox('clear');$('#ReceiverName').val('');$('#txtFuJianZhangShu').val('');$('#Original_number').val('');$('#txtJiaKuang').val('');$('#txtShuiJin').val('');$('#txtJiaShuiHeJi').val('');$('#dengjiren').combobox('clear');$('#datdengjishijian').datetimebox('clear');$('#Auditor').combobox('clear');$('#datshenheshijian').datetimebox('clear');$('#tb进窗信息').datagrid('loadData', { total: 0, rows: [] });}function TuiChu() {$('#wXuanZeDingHuoQingDanXiAll').window('close');}function cellStyler(value) {if (value != "") {return 'background-color:#FFEBCD;color:red';}}</script>
<body style="text-align: center"><div class="easyui-window" id="wXuanZeDingHuoQingDanXiAll" title="选择订货清单" style="width: 700px; height: 300px;"data-options="resizable:false,minimizable:false,closable:false,collapsible:false,maximizable:false,closed:true,"><table style="width: 686px; height: 28px; padding: 0; border-spacing: 0"><tr><td style="vertical-align: middle; font-size: 15px;">请输入订货订单号查找:<input type="text" id="strBlur" style="width: 200px; height: 15px;" /></td><td><button οnclick="MoHiuChaXunXuanZeDingHuoQingDanXiAll();"><img src="../../Content/image/2012092109942.png" />查询</button><button οnclick="TuiChu();"><img src="../../Content/image/2012080412301.png" />退出</button></td></tr></table><div class="easyui-panel" style="width: 686px; height: 233px;"><table id="tbXuanZeDingHuoQingDanXiAll" class="easyui-datagrid" style="width: 3360px;"data-options="rownumbers:true,striped:true,pagination:true,idField:'Goods_id',singleSelect:true,fit:true,fitColumns:false,onDblClickRow: DblDingHuoQingDan"><thead><tr><th data-options="field:'Indent_id',hidden:true, align:'center'">订单ID</th><th data-options="field:'Department_id',width:80,hidden:true, align:'center'">部门ID</th><th data-options="field:'Indent_number',width:80,align:'center'">订单号</th><th data-options="field:'Attribute_gather_detail_name',width:80,align:'center'">订单类型</th><th data-options="field:'Indent _status',width:80,align:'center'">订单状态</th><th data-options="field:'settlement',width:80,align:'center'">结算方式</th><th data-options="field:'ConsignmentDepartmentName',width:80,align:'center'">进货部门</th><th data-options="field:'ConsignmentDepartmentCode',width:80,align:'center'">部门代码</th><th data-options="field:'Contract_number',width:80,align:'center'">合同号</th><th data-options="field:'Indent_begin_date',width:80,align:'center'">订单开始时间</th><th data-options="field:'Indent_end_date',width:80,align:'center'">订单结束时间</th><th data-options="field:'Voluntarily_indent_deny',width:80,align:'center'">自动订单否</th><th data-options="field:'Place_of_delivery',width:80,align:'center'">交货地点</th><th data-options="field:'Indent_time',width:80,align:'center'">订货时间</th><th data-options="field:'Buyer',width:80,align:'center'">买手</th><th data-options="field:'Delivery_way',width:80,align:'center'">交货方式</th><th data-options="field:'Chinese',width:80,align:'center'">供应单位</th><th data-options="field:'Indent_execute_situation',width:80,align:'center'">订单执行情况</th><th data-options="field:'Employee_name',width:80,align:'center'">登记人</th><th data-options="field:'Register_time',width:80,align:'center'">登记时间</th><th data-options="field:'Auditor',width:80,align:'center'">审核人</th><th data-options="field:'Review_time',width:80,align:'center'">审核时间</th><th data-options="field:'Cancel_person',width:80,align:'center'">注销人</th><th data-options="field:'Cancel_time',width:80,align:'center'">注销时间</th><th data-options="field:'Indent_price_person',width:80,align:'center'">定价人</th><th data-options="field:'Prices_auditor',width:80,align:'center'">物价审核人</th></tr></thead></table></div></div><div class="easyui-window" id="wZiYingJinCangDanChaXun" title="自营进仓单查询" style="width: 500px; height: 300px; top: 100px; left: 150px" data-options="resizable:false,minimizable:false,closable:true,collapsible:false,maximizable:false,closed:true"><table style="height: 25px; padding: 0; border-spacing: 0"><tr><td style="vertical-align: middle; font-size: 15px;">请输入记录编号查找:</td><td style="vertical-align: middle; text-align: left;"><input class="easyui-searchbox" data-options="prompt:'Please Input Value',searcher:SelectBuildByOneselfWarehouseEntry" style="width: 180px; height: 23px;" /></td></tr></table><div class="easyui-panel" style="width: 480px; height: 250px; border: 1px solid red"><table id="tbZiYingJinCangDanChaXun" class="easyui-datagrid" style="width: auto;"data-options="rownumbers:true,onDblClickRow: DblZiYingJinCangDan,striped:true,pagination:true,idField:'Repertory_enter_id',singleSelect:true,fit:true"><thead><tr><th data-options="field:'Repertory_enter_id',hidden:true,width:90,align:'center'">进仓单ID</th><th data-options="field:'Department_id',hidden:true,width:90,align:'center'">部门ID</th><th data-options="field:'Record_number',width:110,align:'center'">记录编号</th><th data-options="field:'Indent_number',width:90,align:'center'">订单号</th><th data-options="field:'Department_name',width:90,align:'center'">进货部门</th><th data-options="field:'Repertory_place_name',width:90,align:'center'">库存地点</th><th data-options="field:'Chinese',width:90,align:'center'">供应单位</th><th data-options="field:'Agreement_code',hidden:true,width:90,align:'center'">合同号</th><th data-options="field:'DingDanLeiXingMC',hidden:true,width:90,align:'center'">订单类型</th><th data-options="field:'JieSuanFangShiMC',hidden:true,width:90,align:'center'">结算方式</th><th data-options="field:'Buyer',hidden:true,width:90,align:'center'">买家</th><th data-options="field:'Department_code',hidden:true,width:90,align:'center'">部门代码</th><th data-options="field:'Repertory_place_identifier',hidden:true,width:90,align:'center'">库存地点编号</th><th data-options="field:'Affix_count',hidden:true,width:90,align:'center'">附件张数</th><th data-options="field:'Original_number',hidden:true,width:90,align:'center'">原始进货单号</th><th data-options="field:'Receiver',hidden:true,width:90,align:'center'">收货人</th><th data-options="field:'Repertory_place_id',hidden:true"></th><th data-options="field:'Registrant_id',hidden:true"></th><th data-options="field:'Register_time',hidden:true"></th><th data-options="field:'Receiver_id',hidden:true"></th><th data-options="field:'Indent_id',hidden:true"></th><th data-options="field:'oldRecord_number',width:100">111</th></tr></thead></table></div></div><div class="easyui-window" title="" id="wShangPinJinCangDan" style="display: none; text-align: center; border-spacing: 0; padding: 0; border: 0 solid white"data-options="fit:true,collapsible:false,minimizable:false,maximizable:false,closable:false,draggable:false,resizable:false,shadow:false,modal:true,center:true"><div style="padding: 5px; background: #e0ffff; color: #4169e1; font-size: 20px; margin: 0 0 auto;">@*<span style="float: right"><img οnclick="parent.jinCang();" id="dimg" src="../../Content/image/delete.png" /></span>*@商品进仓单</div><table id="tbShangPinJinCangDan" style="width: 780px; height: 20px; padding: 0; border: none;"><tr><td style="vertical-align: middle"><input type="button" value="记录编号" οnclick="OpenZiYingJinCangDanChaZhao()" style="width: 100px;" /><input type="text" οnclick="    SelectJiLuBianHao()" id="txtJiLuBianMa" style="width: 120px; color: red" /></td><td style="vertical-align: middle"><input type="button" value="进货部门:" style="width: 100px;" /><input type="text" id="ConsignmentDepartmentCode" style="width: 120px; text-align: center" /></td><td style="vertical-align: middle"><div style="border-bottom: #000 1px solid; width: 200px;"><input id="ConsignmentDepartmentName" readonly="readonly" style="width: 200px; border: none; color: #0000FF; font-size: 23px;" /></div></td></tr></table><table style="width: 780px; height: 150px; padding: 0; border: none;"><tr><td style="width: 300px;"><table style="width: 300px; height: 150px; padding: 0; border: none;"><tr><td style="width: 110px; text-align: right; font-size: 15px;">合同号:</td><td><div style="border-bottom: #000 1px solid; width: 180px;"><input id="AgreementCode" readonly="readonly" style="width: 180px; border: none; color: #0000FF; font-size: 17px;" /></div></td></tr><tr><td style="width: 110px; text-align: right; font-size: 15px;">订单号:</td><td><div style="border-bottom: #000 1px solid; width: 180px;"><input readonly="readonly" id="IndentNumber" style="width: 180px; border: none; color: #0000FF; font-size: 17px;" /></div></td></tr><tr><td style="width: 110px; text-align: right; font-size: 15px;">订单类型:</td><td><div style="border-bottom: #000 1px solid; width: 180px;"><input readonly="readonly" id="IndentType" style="width: 180px; border: none; color: #0000FF; font-size: 17px;" /></div></td></tr><tr><td style="width: 110px; text-align: right; font-size: 15px;">结算方式:</td><td><div style="border-bottom: #000 1px solid; width: 180px;"><input readonly="readonly" id="jiesuanfangshi" style="width: 180px; border: none; color: #0000FF; font-size: 17px;" /></div></td></tr><tr><td style="width: 110px; text-align: right; font-size: 15px;">买家:</td><td><div style="border-bottom: #000 1px solid; width: 180px;"><input readonly="readonly" id="Buyer" style="width: 180px; border: none; color: #0000FF; font-size: 17px;" /></div></td></tr></table></td><td><table style="width: 467px; height: 150px; padding: 0; border: none;"><tr><td style="width: 120px; text-align: right; font-size: 15px;">供应单位:</td><td style="width: 160px;" colspan="2"><div style="border-bottom: #000 1px solid; width: 300px;"><input readonly="readonly" id="SupplyUnits" style="width: 300px; border: none; color: #0000FF; font-size: 17px;" /></div></td></tr><tr><td style="text-align: right; font-size: 15px;">库存地点:</td><td><input class="easyui-combobox" id="RepertoryPlaceIdentifier" data-options="onSelect:getRepertory_place_name,required:true, panelHeight:100" style="width: 145px; text-align: center" /></td><td><div style="border-bottom: #000 1px solid; width: 180px;"><input readonly="readonly" id="kucunMC" style="width: 180px; border: none; color: #0000FF; font-size: 17px;" /></div></td></tr><tr><td style="text-align: right; font-size: 15px;">收货人:</td><td><input class="easyui-combobox" id="shouhuorenbianhao" data-options="onSelect:getReceiver_nam,required:true, panelHeight:100" style="width: 145px; text-align: center" /></td><td><div style="border-bottom: #000 1px solid; width: 180px;"><input readonly="readonly" id="ReceiverName" style="width: 180px; border: none; color: #0000FF; font-size: 17px;" /></div></td></tr><tr><td style="text-align: right; font-size: 15px;">附件<input type="text" id="txtFuJianZhangShu" style="width: 40px" />张数</td><td></td><td></td></tr><tr><td style="text-align: right; font-size: 15px;">原始进货单号:</td><td style="width: 160px;" colspan="2"><div style="border-bottom: #000 1px solid; width: 300px;"><input id="Original_number" style="width: 300px; border: none; color: #0000FF; font-size: 17px;" /></div></td></tr></table></td></tr></table><div class="easyui-panel" style="width: 785px; height: 233px;"><table id="tb进窗信息" class="easyui-datagrid" style="width: 3780px;" data-options="rownumbers:true,idField:'Goods_id',singleSelect:true, onClickRow:onClickRowMingXi ,onAfterEdit:onAfterEdit,fit:true,pagination:true"><thead><tr><th data-options="field:'Goods_id',hidden:true,width:80,align:'center'">商品ID</th>@*<th data-options="field:'ShangPinDingDanMingXiID',hidden:true,width:80,align:'center'">商品订单明细ID</th>*@<th data-options="field:'Repertory_enter_detail_id',width:80,hidden:true,align:'center'">Repertory_enter_detail_id</th><th data-options="field:'Indent_id',width:80,hidden:true,align:'center'">Indent_id</th><th data-options="field:'Goods_code',width:80,align:'center'">商品代码</th><th data-options="field:'Goods_bar_code',width:80,align:'center'">商品条码</th><th data-options="field:'Goods_name',width:80,align:'center'">商品名称</th><th data-options="field:'Art_No',width:80,align:'center'">货号</th><th data-options="field:'Repertory_enter_packages',editor:{type:'numberbox'},width:80,align:'center'">入库件数</th><th data-options="field:'AAA',width:80,editor:{type:'numberbox'},align:'center'">入库细数</th><th data-options="field:'Purchase_number',editor:{type:'numberbox'},width:80,align:'center'">物扣数量</th><th data-options="field:'AAA1',width:80,align:'center'">总要入库数</th><th data-options="field:'YiRuKuShu',width:80,align:'center'">已入库数</th><th data-options="field:'HaiYaoRuKuShu',width:80,align:'center',styler:cellStyler">还缺入库数</th><th data-options="field:'BBB',width:80,align:'center'">含税进价</th><th data-options="field:'Purchase_bid',width:80,align:'center'">采购进价</th><th data-options="field:'Retail_unit_price',width:80,align:'center'">零售单价</th><th data-options="field:'Format_model',width:80,align:'center'">规格型号</th><th data-options="field:'Unit_of_measurement',width:80,align:'center'">计量单位</th><th data-options="field:'Quality_content',width:80,align:'center'">包装含量</th><th data-options="field:'Buyer',width:80,hidden:true,align:'center'">买手</th><th data-options="field:'Vender_bar_code_deny',width:80,align:'center'">厂家条码否</th><th data-options="field:'Goods_abbreviation',width:80,align:'center'">商品简称</th><th data-options="field:'Plncode_PLN',width:80,align:'center'">PLN码</th><th data-options="field:'Goods_tab_pubid',width:80,align:'center'">商品标记</th><th data-options="field:'Copy_record_deny',width:80,align:'center'">复制记录否</th><th data-options="field:'Agreement_code',width:80,align:'center'">合同号</th><th data-options="field:'Manufacturer_name',width:80,align:'center'">生产厂家</th><th data-options="field:'Producing_area_name',width:80,align:'center'">产地</th><th data-options="field:'Art_No',width:80,align:'center'">货号</th><th data-options="field:'Unit_of_measurement',width:80,align:'center'">计量单位</th><th data-options="field:'Use_target',width:80,align:'center'">使用对象</th><th data-options="field:'Goods_colours',width:80,align:'center'">商品花色</th><th data-options="field:'Goods_tab_pubid',width:80,align:'center'">商品商标</th><th data-options="field:'Quality_guarantee_period_pubid',width:80,align:'center'">保质期</th><th data-options="field:'Input_ratio',width:80,align:'center'">进项税率</th><th data-options="field:'Output_ratio',width:80,align:'center'">销项税率</th><th data-options="field:'Count_scale',width:80,align:'center'">统计比例</th><th data-options="field:'Quality_content',width:80,align:'center'">质地含量</th><th data-options="field:'Quality_grade_pubid',width:80,align:'center'">质量等级</th><th data-options="field:'Manage_season_name',width:80,align:'center'">经营季节</th><th data-options="field:'Permit_decimal_deny',width:80,align:'center'">允许销售否</th><th data-options="field:'Employee_name',width:80,align:'center'">登记人</th><th data-options="field:'Register_time',width:80,align:'center'">登记时间</th><th data-options="field:'Auditor',width:80,align:'center'">审核人</th><th data-options="field:'Review_time',width:80,align:'center'">审核时间</th><th data-options="field:'GengXinRen',width:80,align:'center'">更新人</th><th data-options="field:'Update_Time',width:80,align:'center'">更新时间</th><th data-options="field:'Self_fix_goods_deny',width:80,align:'center'">自订货否</th><th data-options="field:'Mini_fix_goods_deny',width:80,align:'center'">最小订货数</th></tr></thead></table></div><table style="width: 715px; height: 30px"><tr><td style="font-size: 15px; width: 50px; left: 30px">价款</td><td style="width: 50px"><div style="border-bottom: #000 1px solid; width: 100px;"><input id="txtJiaKuang" readonly="readonly" style="width: 100px; border: none" /></div></td><td style="font-size: 15px">税金</td><td style="width: 50px"><div style="border-bottom: #000 1px solid; width: 100px;"><input id="txtShuiJin" readonly="readonly" style="width: 100px; border: none" /></div></td><td style="width: 50px"></td><td style="font-size: 15px">价格合计</td><td><div style="border-bottom: #000 1px solid; width: 110px;"><input id="txtJiaShuiHeJi" readonly="readonly" style="width: 110px; border: none" /></div></td></tr></table><div><div><table style="width: 715px; height: 30px"><tr><td style="font-size: 15px; width: 60px">登记人</td><td style="width: 50px"><div style="border-bottom: #000 1px solid; width: 180px;"><input class="easyui-combobox" id="dengjiren"data-options="url:'/ShangPinJinChuangDan/SelectEmployee',valueField:'ID',textField:'MC'" style="width: 180px; border: none; color: #0000FF; font-size: 17px;" /></div></td><td style="font-size: 15px">登记时间</td><td style="width: 50px"><div style="border-bottom: #000 1px solid; width: 180px;"><input class="easyui-datetimebox" data-options="formatter:myformatter" id="datdengjishijian" style="width: 180px; border: none; color: #0000FF; font-size: 17px;" /></div></td></tr><tr><td style="font-size: 15px; width: 60px">审核人</td><td style="width: 50px"><div style="border-bottom: #000 1px solid; width: 180px;"><input class="easyui-combobox" id="Auditor" data-options="url:'/ShangPinJinChuangDan/SelectEmployee',valueField:'ID',textField:'MC'" style="width: 180px; border: none; color: #0000FF; font-size: 17px;" /></div></td><td style="font-size: 15px">审核时间</td><td><div style="border-bottom: #000 1px solid; width: 180px;"><input class="easyui-datetimebox" data-options="formatter:myformatter,required:true" id="datshenheshijian" style="width: 180px; border: none; color: #0000FF; font-size: 17px;" /></div></td></tr></table></div><table style="width: 790px;"><tr><td><div style="width: 85px; height: 25px; text-align: center; vertical-align: middle"><button οnclick="OpenwXuanZeDingHuoQingDanXiAll();" id="TianJia"><img src="../../Content/image/add.png" />添加</button></div></td><td><div style="width: 85px; height: 25px; text-align: center; vertical-align: middle"><button id="XiuGai" οnclick="UpdataJinCangDan();"><img src="../../Content/image/table_edit.png" />修改</button></div></td><td><div style="width: 85px; height: 25px; text-align: center; vertical-align: middle"><button οnclick="delete_Repertory_enter();" id="ShanChu"><img src="../../Content/image/delete.png" />删除</button></div></td><td><div style="width: 85px; height: 25px; text-align: center; vertical-align: middle"><button id="BaoCun" οnclick="BaoCunJinCangDan();"><img src="../../Content/image/disk.png" />保存</button></div></td><td><div style="width: 85px; height: 25px; text-align: center; vertical-align: middle"><button οnclick="QingChu();" id="FanQi"><img src="../../Content/image/01.png" />放弃</button></div></td><td><div style="width: 85px; height: 25px; text-align: center; vertical-align: middle"><button οnclick="ShenHe();" id="ShenHe"><img src="../../Content/image/ok.gif" />审核</button></div></td><td><div style="width: 85px; height: 25px; text-align: center; vertical-align: middle"><button id="DaYin" οnclick="shenHe2()"><img src="../../Content/image/2012081511202.png" />打印</button></div></td><td><div style="width: 85px; height: 25px; text-align: center; vertical-align: middle"><button id="TuiChu" οnclick=" parent.jinCang()"><img src="../../Content/image/2012080412301.png" />退出</button></div></td></tr></table></div></div>
</body>
</html>

第五步控制器(Controllers)

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

using System;
using System.Collections.Generic;
using System.Web.Mvc;
using System.Data;
using BLL商品进仓单;namespace 大型商贸系统.Controllers
{public class ShangPinJinChuangDanController : Controller<span style="font-family:Arial, sans-serif;font-size:24px;"></span> {//// GET: /ShangPinJinChuangDan///实例化逻辑层对象readonly JinCangDan _myJinCangDan = new JinCangDan();//返回界面视图public ActionResult JinChuangDan(){return View();}#region 查询合同号public ActionResult SelectAgreement(){   //实例化DataTable接受对象_myJinCangDan的方法SelectAgreement中数据返回的数据<span style="font-family:Arial, sans-serif;font-size:24px;"></span>  DataTable dt = _myJinCangDan.SelectAgreement();//通过调用ConvertHelper里面的方法将DataTable中数据转化为List<Dictionary<string, object>> List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);//将listReturn数据返回return Json(listReturn, JsonRequestBehavior.AllowGet);}#endregion#region 查询订单号public ActionResult SelectIndent(){DataTable dt = _myJinCangDan.SelectIndent();List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);return Json(listReturn, JsonRequestBehavior.AllowGet);}<span style="font-family:Arial, sans-serif;font-size:24px;"></span>#endregion#region 查询订货清单信息public ActionResult SelectOrderGoodsSpecificationInformation(){//实例化对象dt接收方法SelectOrderGoodsSpecificationInformation的查找出“订货清单”数据DataTable dt = _myJinCangDan.SelectOrderGoodsSpecificationInformation();//实例化对象dt2接收方法SelectBuildByOneselfWarehouseEntry已添加到进仓单的数据DataTable dt2 = _myJinCangDan.SelectBuildByOneselfWarehouseEntry("");//for循环遍历获取所查找到的两个表中的订单idfor (int i = 0; i < dt2.Rows.Count; i++){int indentid = Convert.ToInt32(dt2.Rows[i]["Indent_id"]);for (int j=dt.Rows.Count-1; j >=0 ; j--){var indentid2 = Convert.ToInt32(dt.Rows[j]["Indent_id"]);//判断是否相等if (indentid == indentid2){//若相等,将会在表dt中移除dt.Rows.Remove(dt.Rows[j]);}<span style="font-family:Arial, sans-serif;font-size:24px;"></span>	}}List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);return Json(listReturn, JsonRequestBehavior.AllowGet);}#endregion#region 模糊查询清货订单信息public ActionResult VagueSelectChooseOrderGoodsSpecificationInformationAll(string strBlur){DataTable dt = _myJinCangDan.VagueSelectChooseOrderGoodsSpecificationInformationAll(strBlur);List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);return Json(listReturn, JsonRequestBehavior.AllowGet);}#endregion#region 查询商品资料public ActionResult SelectShangPinZiLiao(){DataTable dt = _myJinCangDan.SelectShangPinZiLiao();List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);return Json(listReturn, JsonRequestBehavior.AllowGet);}#endregion#region 根据ID查询商品资料public ActionResult SelectXinXiByID(int Goods_id){DataTable dt = _myJinCangDan.SelectXinXiByID(Goods_id);List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);return Json(listReturn, JsonRequestBehavior.AllowGet);}#endregion#region 根据部门ID查库存地点编号public ActionResult SelectInventoryPlaceByDepartment_id(int Department_id){DataTable dt = _myJinCangDan.SelectInventoryPlaceByDepartment_id(Department_id);List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);return Json(listReturn, JsonRequestBehavior.AllowGet);}#endregion#region 查库存名根据库存IDpublic ActionResult SelectRepertory_place_nameByRepertory_place_id(int Repertory_place_id){DataTable dt = _myJinCangDan.SelectRepertory_place_nameByRepertory_place_id(Repertory_place_id);List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);return Json(listReturn, JsonRequestBehavior.AllowGet);}#endregion#region 根据进货部门ID查收货人public ActionResult SelectShouHuoRenBianHao(int Department_id){DataTable dt = _myJinCangDan.SelectShouHuoRenByJinHuoBuMenId(Department_id);List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);return Json(listReturn, JsonRequestBehavior.AllowGet);}#endregion#region 根据员工ID查收货人名称public ActionResult SelectReceiver_namByEmployee_id(int Employee_id){DataTable dt = _myJinCangDan.SelectReceiver_namByEmployee_id(Employee_id);List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);return Json(listReturn, JsonRequestBehavior.AllowGet);}#endregion#region 根据订单ID查进仓明细public ActionResult BangDingDingDanMingXi(int Indent_id){DataTable dt = _myJinCangDan.BangDingDingDanMingXi(Indent_id);dt.Columns.Add("RuKuShuLiang1", typeof(int));dt.Columns.Add("AAA", typeof(int));for (int i = 0; i < dt.Rows.Count; i++){int RuKuShuLiang = Convert.ToInt32(dt.Rows[i]["Put_number"]);int ZhiDiHanLiang = Convert.ToInt32(dt.Rows[i]["ZhiDiHanLiang"]);dt.Rows[i]["RuKuShuLiang1"] = RuKuShuLiang;dt.Rows[i]["AAA"] = RuKuShuLiang * ZhiDiHanLiang;}dt.Columns.Add("CaiGouJinJia1", typeof(int));dt.Columns.Add("JinXiangShuiLv1", typeof(int));dt.Columns.Add("BBB", typeof(decimal));for (int j = 0; j < dt.Rows.Count; j++){decimal CaiGouJinJia = Convert.ToDecimal(dt.Rows[j]["CaiGouJinJia"]);decimal Input_ratio = Convert.ToDecimal(dt.Rows[j]["Input_ratio"]);dt.Rows[j]["CaiGouJinJia1"] = CaiGouJinJia;dt.Rows[j]["Input_ratio"] = Input_ratio;dt.Rows[j]["BBB"] = (Input_ratio / 100 + 1) * CaiGouJinJia;}List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);return Json(listReturn, JsonRequestBehavior.AllowGet);}#endregion#region 查询员工public ActionResult SelectEmployee(){   //实例化DataTable接受对象_myJinCangDan的方法SelectAgreement中数据返回的数据DataTable dt = _myJinCangDan.SelectEmployee();//通过调用ConvertHelper里面的方法将DataTable中数据转化为List<Dictionary<string, object>> List<Dictionary<string, object>> ListReturn = ConvertHelper.DtToList(dt);//将listReturn数据返回return Json(ListReturn, JsonRequestBehavior.AllowGet);}#endregion#region 插入进仓单public int Insert_Repertory_enter(string indentId, string receiverId, string recordNumber, string registrantId, string registerTime, string repertoryPlaceId, string affixCount, string originalNumber){DataTable dt = _myJinCangDan.Insert_Repertory_enter(Convert.ToInt32(indentId),Convert.ToInt32(receiverId),recordNumber,Convert.ToInt32(registrantId),Convert.ToDateTime(registerTime),Convert.ToInt32(repertoryPlaceId),affixCount, originalNumber);return Convert.ToInt32(dt.Rows[0][0].ToString());}#endregion#region 生成记录编号public ActionResult SelectJiLuBianHao(){//实例化DataTable接收对象_myJinCangDan的方法SelectAgreement中数据返回的数据DataTable dt = _myJinCangDan.SelectJiLuBianMa();//实例化strMon对象接收当前月份string strMon = DateTime.Now.Month.ToString();if (Convert.ToInt32(strMon) < 10)//对获取的月份进行数据类型转化,操作:若所得数小于10的要在前加上0{ strMon = "0" + strMon; }string strDay = DateTime.Now.Day.ToString(); //实例化strMon对象接收当前天数if (Convert.ToInt32(strDay) < 10)//对获取的天数进行数据类型转化,操作:若所得数小于10的要在前加上0{ strDay = "0" + strDay; }//实例化对象JinCangDan来接收拼接的年,月,日加上前缀“CD”string JinCangDan = "CD" + DateTime.Now.Year.ToString() + strMon + strDay + ((int)dt.Rows[0][0] + 1).ToString();//返回数据return Json(JinCangDan, JsonRequestBehavior.AllowGet);}#endregion#region 查询自营进仓单/模糊查询自营进仓单public ActionResult SelectBuildByOneselfWarehouseEntry(string strBlur){DataTable dt = _myJinCangDan.SelectBuildByOneselfWarehouseEntry(strBlur);List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);return Json(listReturn, JsonRequestBehavior.AllowGet);}#endregion#region 根据Repertory_enter_id查询自营进仓单public ActionResult SelectBuildByOneselfWarehouseEntryByRepertory_enter_id(int repertoryEnterId){DataTable dt = _myJinCangDan.SelectBuildByOneselfWarehouseEntryByRepertory_enter_id(repertoryEnterId);List<Dictionary<string, object>> ListReturn = ConvertHelper.DtToList(dt);return Json(ListReturn, JsonRequestBehavior.AllowGet);}#endregion#region 修改自营进仓单public int Update_Repertory_enter(string indentId, string receiverId, string recordNumber, string registrantId,string registerTime, string repertoryPlaceId, string affixCount,string originalNumber, string repertoryEnterId){int dt = _myJinCangDan.Update_Repertory_enter(Convert.ToInt32(indentId),Convert.ToInt32(receiverId),recordNumber,Convert.ToInt32(registrantId),Convert.ToDateTime(registerTime),Convert.ToInt32(repertoryPlaceId),affixCount,originalNumber,Convert.ToInt32(repertoryEnterId));return dt;}#endregion#region 删除进仓单public int delete_Repertory_enter(int Repertory_enter_id){return _myJinCangDan.delete_Repertory_enter(Repertory_enter_id);}#endregion#region 删除进仓明细public int delete_Repertory_enter_detail(int Repertory_enter_id){return _myJinCangDan.delete_Repertory_enter_detail(Repertory_enter_id);}#endregion#region 取两位小数public double ConvertToDouble(double shu){Double sa = Math.Round(Convert.ToDouble(shu), 2);return sa;}#endregion#region 审核查询库存的进仓单public ActionResult ShenHeaddJinCangDan(int Repertory_place_id, int Goods_id){DataTable dt = _myJinCangDan.ShenHeSelectKuCun(Repertory_place_id, Goods_id);List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);return Json(listReturn, JsonRequestBehavior.AllowGet);}#endregion#region 新增库存单public int InsertStock(string Repertory_place_id, string Goods_id, string KuCunShu){int dt = _myJinCangDan.InsertStock(Convert.ToInt32(Repertory_place_id),Convert.ToInt32(Goods_id),KuCunShu);return dt;}#endregion#region 新增进仓明细public void InsertRepertoryEnterDetail(string Repertory_enter_id, string Goods_id, string Repertory_enter_quantity, string Repertory_enter_packages, string Giveaway_quantity){_myJinCangDan.InsertRepertoryEnterDetail(Convert.ToInt32(Repertory_enter_id),Convert.ToInt32(Goods_id),Convert.ToDecimal(Repertory_enter_quantity),Convert.ToInt32(Repertory_enter_packages),Convert.ToDecimal(Giveaway_quantity));}#endregion#region 绑定订单明细public ActionResult BindingIndentDetail(int Indent_id){DataTable dt = _myJinCangDan.BindingIndentDetail(Indent_id);dt.Columns.Add("RuKuShuLiang1", typeof(int));dt.Columns.Add("AAA", typeof(int));dt.Columns.Add("AAA1", typeof(int));dt.Columns.Add("CaiGouJinJia1", typeof(int));dt.Columns.Add("JinXiangShuiLv1", typeof(int));dt.Columns.Add("BBB", typeof(decimal));dt.Columns.Add("WuGouShu1", typeof(string));dt.Columns.Add("HaiYaoRuKuShu", typeof(string));for (int i = 0; i < dt.Rows.Count; i++){int ruKuShuLiang = Convert.ToInt32(dt.Rows[i]["Repertory_enter_packages"]);int zhiDiHanLiang = Convert.ToInt32(dt.Rows[i]["Quality_content"]);dt.Rows[i]["RuKuShuLiang1"] = ruKuShuLiang;dt.Rows[i]["AAA"] = ruKuShuLiang * zhiDiHanLiang;dt.Rows[i]["AAA1"] = ruKuShuLiang * zhiDiHanLiang + Convert.ToInt32(dt.Rows[i]["Purchase_number"]);decimal caiGouJinJia = Convert.ToDecimal(dt.Rows[i]["Purchase_bid"]);decimal Input_ratio = Convert.ToDecimal(dt.Rows[i]["Input_ratio"]);dt.Rows[i]["CaiGouJinJia1"] = caiGouJinJia;dt.Rows[i]["JinXiangShuiLv1"] = Input_ratio;dt.Rows[i]["BBB"] = (Input_ratio / 100 + 1) * caiGouJinJia;            }List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);return Json(listReturn, JsonRequestBehavior.AllowGet);}#endregion#region 查询已审核进仓单/ 模糊查询已审核进仓单public ActionResult SelectYiShenHeJinCangDan(string strBlur){DataTable dt = _myJinCangDan.SelectYiShenHeJinCangDan(strBlur);List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);return Json(listReturn, JsonRequestBehavior.AllowGet);}#endregion#region 绑定进仓单明细public ActionResult BindingRepertoryEnterDetail(int Repertory_enter_id, bool Review_deny){DataTable dt = _myJinCangDan.BindingRepertoryEnterDetail(Repertory_enter_id, Review_deny);dt.Columns.Add("YiRuKuShu", typeof(string));dt.Columns.Add("RuKuShuLiang1", typeof(int));dt.Columns.Add("AAA", typeof(int));dt.Columns.Add("AAA1", typeof(int));dt.Columns.Add("CaiGouJinJia1", typeof(int));dt.Columns.Add("JinXiangShuiLv1", typeof(int));dt.Columns.Add("BBB", typeof(decimal));dt.Columns.Add("WuGouShu1", typeof(string));dt.Columns.Add("HaiYaoRuKuShu", typeof(string));for (int i = 0; i < dt.Rows.Count; i++){var mingxiid = Convert.ToInt32(dt.Rows[i][0]);DataTable dt1 = _myJinCangDan.CheckNeTamount(mingxiid);int shu = 0;if (dt1.Rows[0][0].ToString() != ""){shu = Convert.ToInt32(dt1.Rows[0][0]);}dt.Rows[i]["YiRuKuShu"] = shu;int ruKuShuLiang = Convert.ToInt32(dt.Rows[i]["Repertory_enter_packages"]);int zhiDiHanLiang = Convert.ToInt32(dt.Rows[i]["Quality_content"]);dt.Rows[i]["RuKuShuLiang1"] = ruKuShuLiang;dt.Rows[i]["AAA"] = ruKuShuLiang * zhiDiHanLiang;dt.Rows[i]["AAA1"] = ruKuShuLiang * zhiDiHanLiang + Convert.ToInt32(dt.Rows[i]["Purchase_number"]);decimal caiGouJinJia = Convert.ToDecimal(dt.Rows[i]["Purchase_bid"]);decimal Input_ratio = Convert.ToDecimal(dt.Rows[i]["Input_ratio"]);dt.Rows[i]["CaiGouJinJia1"] = caiGouJinJia;dt.Rows[i]["JinXiangShuiLv1"] = Input_ratio;dt.Rows[i]["BBB"] = (Input_ratio / 100 + 1) * caiGouJinJia;dt.Rows[i]["HaiYaoRuKuShu"] = ruKuShuLiang * zhiDiHanLiang + Convert.ToInt32(dt.Rows[i]["Purchase_number"]) - shu;}List<Dictionary<string, object>> ListReturn = ConvertHelper.DtToList(dt);return Json(ListReturn, JsonRequestBehavior.AllowGet);}#endregion#region 查询库存地点public ActionResult SelectStock(int Goods_id, int Repertory_place){DataTable dt = _myJinCangDan.SelectStock(Goods_id, Repertory_place);List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);return Json(listReturn, JsonRequestBehavior.AllowGet);}#endregion#region 审核public ActionResult Shenhe(string strs, int repertoryEnterid, int auditor, string reviewTime, string jiLuBianMa){string[] str2 = strs.Split('.');string msg = "";var shijishus = new List<int>();var repertoryEnterEetailids = new List<int>();var repertoryEnterPackagess = new List<decimal>();var yaorukushus = new List<int>();var purchaseNumbers = new List<int>();var bufuhe = new List<bool>();for (int i = 0; i < str2.Length - 1; i++){string[] str1 = str2[i].Split(',');var yaorukushu = Convert.ToInt32(str1[0].Trim());var repertoryEnterEetailid = Convert.ToInt32(str1[1].Trim());var zongYaoRuKuShu = Convert.ToInt32(str1[2].Trim());var repertoryEnterPackages = Convert.ToDecimal(str1[3].Trim());var goodsName = (str1[4].Trim());var purchaseNumber = Convert.ToInt32(str1[5].Trim());DataTable dt = _myJinCangDan.ShenheSelectStock(repertoryEnterEetailid);if (dt.Rows.Count > 0){var stockToplimit = Convert.ToInt32(dt.Rows[0]["Stock_toplimit"]);if (zongYaoRuKuShu <= stockToplimit){DataTable dt2 = _myJinCangDan.ShenHeSelectChildJinCangMingXi(repertoryEnterEetailid);var yiRuKuShu = Convert.ToInt32(dt2.Rows[0][0]);var shiJiRuKuShu = yaorukushu + yiRuKuShu + purchaseNumber;if (zongYaoRuKuShu >= shiJiRuKuShu){var shijiru = yaorukushu + purchaseNumber;shijishus.Add(shijiru);repertoryEnterEetailids.Add(repertoryEnterEetailid);repertoryEnterPackagess.Add(repertoryEnterPackages);yaorukushus.Add(yaorukushu);purchaseNumbers.Add(purchaseNumber);bool aa = (zongYaoRuKuShu == shiJiRuKuShu);//bufuhe.Add(zongYaoRuKuShu == shiJiRuKuShu)bufuhe.Add(aa);}else{msg += goodsName + "实际入库数大于总入库数!+";}}else{msg += goodsName + "总要入库数大于库存上限!+";}}else{_myJinCangDan.ShenheInsertStock(0, repertoryEnterEetailid);DataTable dt4 = _myJinCangDan.ShenheSelectStock(repertoryEnterEetailid);var stockToplimit = Convert.ToInt32(dt4.Rows[0]["Stock_toplimit"]);if (zongYaoRuKuShu <= stockToplimit){DataTable dt2 = _myJinCangDan.ShenHeSelectChildJinCangMingXi(repertoryEnterEetailid);var yiRuKuShu = Convert.ToInt32(dt2.Rows[0][0]);var shiJiRuKuShu = yaorukushu + yiRuKuShu + purchaseNumber;if (zongYaoRuKuShu >= shiJiRuKuShu){var shijiru = yaorukushu + purchaseNumber;shijishus.Add(shijiru);repertoryEnterEetailids.Add(repertoryEnterEetailid);repertoryEnterPackagess.Add(repertoryEnterPackages);yaorukushus.Add(yaorukushu);purchaseNumbers.Add(purchaseNumber);bool aa = (zongYaoRuKuShu == shiJiRuKuShu);//bufuhe.Add(zongYaoRuKuShu == shiJiRuKuShu)bufuhe.Add(aa);}else{msg += goodsName + "实际入库数大于总入库数!+";}}else{msg += goodsName + "总要入库数大于库存上限!+";}}}if (msg != ""){msg = "【<font style='font-size:15px;color:red'>" + jiLuBianMa + "</font>】审核失败,原因如下:+" + msg;}else{if (shijishus.Count > 0){for (int i = 0; i < shijishus.Count; i++){_myJinCangDan.AddJingCangMingXiChild(repertoryEnterEetailids[i], repertoryEnterPackagess[i], yaorukushus[i], purchaseNumbers[i], auditor, Convert.ToDateTime(reviewTime));_myJinCangDan.ShenHeUpdataStockShu(shijishus[i], repertoryEnterEetailids[i]);if (bufuhe[i]){_myJinCangDan.ShenHe_Update_JinCangMingXiDanShenHeFou(repertoryEnterEetailids[i]);}}}DataTable dt3 = _myJinCangDan.NoShenHeJinCangMingXi(repertoryEnterid);if (dt3.Rows.Count == 0){_myJinCangDan.ShenHe_Update_JinCangDanShenHeFou1(repertoryEnterid);_myJinCangDan.ShenHeInsertAuditorAndReviewTime(auditor, Convert.ToDateTime(reviewTime), repertoryEnterid);}msg = "审核成功!";}return Json(msg, JsonRequestBehavior.AllowGet);}#endregion}
}


第六步:逻辑层(BLL)

大型商贸系统(进货管理)技术解析(二)自营进仓单录入-编程知识网

using System;
using System.Data;
using System.Data.SqlClient;
using DALPublic;namespace BLL商品进仓单
{public class JinCangDan{readonly DALMethod _myDalMethod = new DALMethod();#region 查询清货订单信息public DataTable SelectOrderGoodsSpecificationInformation(){SqlParameter[] SQLCMDpas ={new SqlParameter ("@NB",SqlDbType.Char),};SQLCMDpas[0].Value = "SelectOrderGoodsSpecificationInformation";DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 模糊查询清货订单信息public DataTable VagueSelectChooseOrderGoodsSpecificationInformationAll(string strBlur){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter("@strBlur",SqlDbType.Char),};SQLCMDpas[0].Value = "VagueSelectChooseOrderGoodsSpecificationInformationAll";SQLCMDpas[1].Value = strBlur;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 根据部门ID查库存地点编号public DataTable SelectInventoryPlaceByDepartment_id(int Department_id){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter("@Department_id",SqlDbType.Int),};SQLCMDpas[0].Value = "SelectInventoryPlaceByDepartment_id";SQLCMDpas[1].Value = Department_id;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 查库存名根据库存IDpublic DataTable SelectRepertory_place_nameByRepertory_place_id(int Repertory_place_id){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter("@Repertory_place_id",SqlDbType.Int),};SQLCMDpas[0].Value = "SelectRepertory_place_nameByRepertory_place_id";SQLCMDpas[1].Value = Repertory_place_id;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 根据进货部门ID查收货人编号public DataTable SelectShouHuoRenByJinHuoBuMenId(int Department_id){SqlParameter[] SQLCMDpas ={new SqlParameter ("@NB",SqlDbType.Char),new SqlParameter ("@Department_id",SqlDbType.Int),};SQLCMDpas[0].Value = "SelectShouHuoRenByJinHuoBuMenId";SQLCMDpas[1].Value = Department_id;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 根据员工ID查收货人名称public DataTable SelectReceiver_namByEmployee_id(int Employee_id){SqlParameter[] SQLCMDpas ={new SqlParameter ("@NB",SqlDbType.Char),new SqlParameter ("@Employee_id",SqlDbType.Int),};SQLCMDpas[0].Value = "SelectReceiver_namByEmployee_id";SQLCMDpas[1].Value = Employee_id;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 根据订单ID查进仓明细public DataTable BangDingDingDanMingXi(int Indent_id){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter ("@Indent_id",SqlDbType.Int),};SQLCMDpas[0].Value = "BangDingDingDanMingXi";SQLCMDpas[1].Value = Indent_id;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 查询合同号public DataTable SelectAgreement(){SqlParameter[] SQlCMDpas ={new SqlParameter("@NB",SqlDbType.Char),};SQlCMDpas[0].Value = "SelectAgreement";DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQlCMDpas);return dt;}#endregion#region 查询订单号public DataTable SelectIndent(){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB",SqlDbType.Char),};SQLCMDpas[0].Value = "SelectIndent";DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#region 查询商品资料public DataTable SelectShangPinZiLiao(){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB",SqlDbType.Char),};SQLCMDpas[0].Value = "SelectShangPinZiLiao";DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 根据商品ID查询资料public DataTable SelectXinXiByID(int Goods_id){SqlParameter[] SQLCMDpas ={new SqlParameter ("@NB",SqlDbType.Char),new SqlParameter ("@Goods_id",SqlDbType.Int),};SQLCMDpas[0].Value = "SelectXinXiByID";SQLCMDpas[1].Value = Goods_id;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#endregion#region 新增进仓订单public DataTable Insert_Repertory_enter(int indentId, int receiverId, string recordNumber, int registrantId, DateTime registerTime, int repertoryPlaceId, string affixCount, string originalNumber){SqlParameter[] SQLCMDpas ={new SqlParameter ("@NB",SqlDbType.Char),new SqlParameter ("@Indent_id",SqlDbType.Int),new SqlParameter ("@Receiver_id",SqlDbType.Int),new SqlParameter ("@Record_number",SqlDbType.Char),new SqlParameter ("@Registrant_id",SqlDbType.Int),new SqlParameter ("@Register_time",SqlDbType.DateTime),new SqlParameter ("@Repertory_place_id",SqlDbType.Int),new SqlParameter ("@Affix_count",SqlDbType.Char),new SqlParameter ("@Original_number",SqlDbType.Char),};SQLCMDpas[0].Value = "Insert_Repertory_enter";SQLCMDpas[1].Value = indentId;SQLCMDpas[2].Value = receiverId;SQLCMDpas[3].Value = recordNumber;SQLCMDpas[4].Value = registrantId;SQLCMDpas[5].Value = registerTime;SQLCMDpas[6].Value = repertoryPlaceId;SQLCMDpas[7].Value = affixCount;SQLCMDpas[8].Value = originalNumber;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 新增进仓单明细public int InsertRepertoryEnterDetail(int Repertory_enter_id, int Goods_id, decimal Repertory_enter_quantity, int Repertory_enter_packages, decimal Giveaway_quantity){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Repertory_enter_id", SqlDbType.Int),new SqlParameter("@Goods_id", SqlDbType.Int),new SqlParameter("@Repertory_enter_quantity", SqlDbType.Decimal),new SqlParameter("@Repertory_enter_packages",SqlDbType.Int), new SqlParameter("@Giveaway_quantity",SqlDbType.Decimal), };SQLCMDpas[0].Value = "InsertRepertoryEnterDetail";SQLCMDpas[1].Value = Repertory_enter_id;SQLCMDpas[2].Value = Goods_id;SQLCMDpas[3].Value = Repertory_enter_quantity;SQLCMDpas[4].Value = Repertory_enter_packages;SQLCMDpas[5].Value = Giveaway_quantity;int dt = _myDalMethod.DAL_OPTableDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 生成记录编号public DataTable SelectJiLuBianMa(){SqlParameter[] SQLCMDpas ={new SqlParameter ("@NB",SqlDbType.Char),};SQLCMDpas[0].Value = "SelectJiLuBianMa";DataTable dt = _myDalMethod.DAL_SelectDB_Par("Update_Day_Max_Count", SQLCMDpas);return dt;}#endregion#region 查询员工public DataTable SelectEmployee(){SqlParameter[] SQLCMDpas ={new SqlParameter ("@NB",SqlDbType.Char),};SQLCMDpas[0].Value = "SelectEmployee";DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 查询自营进仓单/模糊查询自营进仓单public DataTable SelectBuildByOneselfWarehouseEntry(string strBlur){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter("@strBlur",SqlDbType.Char),};SQLCMDpas[0].Value = "SelectBuildByOneselfWarehouseEntry";SQLCMDpas[1].Value = strBlur;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 根据Repertory_enter_id查询自营进仓单public DataTable SelectBuildByOneselfWarehouseEntryByRepertory_enter_id(int Repertory_enter_id){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Repertory_enter_id",SqlDbType.Int),};SQLCMDpas[0].Value = "SelectBuildByOneselfWarehouseEntryByRepertory_enter_id";SQLCMDpas[1].Value = Repertory_enter_id;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 修改进仓单public int Update_Repertory_enter(int Indent_id, int Receiver_id, string Record_number,int Registrant_id, DateTime Register_time, int Repertory_place, string Affix_count,string Original_number, int Repertory_enter_id){SqlParameter[] SQLCMDpas ={new SqlParameter ("@NB",SqlDbType.Char),new SqlParameter("@Indent_id",SqlDbType.Int),new SqlParameter ("@Receiver_id",SqlDbType.Int),new SqlParameter("@Record_number",SqlDbType.Char),new SqlParameter ("@Registrant_id",SqlDbType.Int),new SqlParameter ("@Register_time",SqlDbType.DateTime),new SqlParameter ("@Repertory_place_id",SqlDbType.Int),new SqlParameter ("@Affix_count",SqlDbType.Char),new SqlParameter("@Original_number",SqlDbType.Char), new SqlParameter ("@Repertory_enter_id",SqlDbType.Int),};SQLCMDpas[0].Value = "Update_Repertory_enter";SQLCMDpas[1].Value = Indent_id;SQLCMDpas[2].Value = Receiver_id;SQLCMDpas[3].Value = Record_number;SQLCMDpas[4].Value = Registrant_id;SQLCMDpas[5].Value = Register_time;SQLCMDpas[6].Value = Repertory_place;SQLCMDpas[7].Value = Affix_count;SQLCMDpas[8].Value = Original_number;SQLCMDpas[9].Value = Repertory_enter_id;int dt = _myDalMethod.DAL_OPTableDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 删除进仓单public int delete_Repertory_enter(int Repertory_enter_id){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Repertory_enter_id", SqlDbType.Int),};SQLCMDpas[0].Value = "delete_Repertory_enter";SQLCMDpas[1].Value = Repertory_enter_id;int dt = _myDalMethod.DAL_OPTableDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 删除进仓明细public int delete_Repertory_enter_detail(int Repertory_enter_id){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Repertory_enter_id", SqlDbType.Int),};SQLCMDpas[0].Value = "delete_Repertory_enter_detail";SQLCMDpas[1].Value = Repertory_enter_id;int dt = _myDalMethod.DAL_OPTableDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 审核查询库存的进仓单public DataTable ShenHeSelectKuCun(int Repertory_place, int Goods_id){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Repertory_place_id", SqlDbType.Int),new SqlParameter("@Goods_id", SqlDbType.Int),};SQLCMDpas[0].Value = "ShenHeSelectKuCun";SQLCMDpas[1].Value = Repertory_place;SQLCMDpas[2].Value = Goods_id;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 新增库存单public int InsertStock(int Repertory_place, int Goods_id, string KuCunShu){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Repertory_place_id", SqlDbType.Int),new SqlParameter("@Goods_id", SqlDbType.Int),new SqlParameter("@Stock_quantity", SqlDbType.Char)};SQLCMDpas[0].Value = "InsertStock";SQLCMDpas[1].Value = Repertory_place;SQLCMDpas[2].Value = Goods_id;SQLCMDpas[3].Value = KuCunShu;int dt = _myDalMethod.DAL_OPTableDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 绑定订单明细public DataTable BindingIndentDetail(int Indent_id){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Indent_id", SqlDbType.Int),};SQLCMDpas[0].Value = "BindingIndentDetail";SQLCMDpas[1].Value = Indent_id;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 审核查细数public DataTable CheckNeTamount(int Repertory_enter_detail_Farid){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Repertory_enter_detail_Farid", SqlDbType.Int),};SQLCMDpas[0].Value = "CheckNeTamount";SQLCMDpas[1].Value = Repertory_enter_detail_Farid;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregion#region 审核查询进仓子明细public void AddJingCangMingXiChild(int repertoryEnterEetailid,decimal repertoryEnterPackages, decimal repertoryEnterQuantity,decimal giveawayQuantity, int auditor, DateTime reviewTime){SqlParameter[] sqlcmDpas ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter("@Repertory_enter_detail_id",SqlDbType.Int),new SqlParameter("@Repertory_enter_packages",SqlDbType.Decimal),new SqlParameter("@Repertory_enter_quantity",SqlDbType.Decimal), new SqlParameter("@Giveaway_quantity",SqlDbType.Decimal ),new SqlParameter("@Auditor_id",SqlDbType.Int),new SqlParameter("@Review_time",SqlDbType.DateTime), //new SqlParameter("@Repertory_place_id",SqlDbType.Int), };sqlcmDpas[0].Value = "AddJingCangMingXiChild";sqlcmDpas[1].Value = repertoryEnterEetailid;sqlcmDpas[2].Value = repertoryEnterPackages;sqlcmDpas[3].Value = repertoryEnterQuantity;sqlcmDpas[4].Value = giveawayQuantity;sqlcmDpas[5].Value = auditor;sqlcmDpas[6].Value = reviewTime;_myDalMethod.DAL_OPTableDB_Par("Commodity_Warehouse_Entry", sqlcmDpas);}#endregionpublic DataTable ShenHeJinCangMingXi(int intJingCangMingXiId){SqlParameter[] sql ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter("@Repertory_enter_detail_id",SqlDbType.Int)};sql[0].Value = "ShenHeJinCangMingXi";sql[1].Value = intJingCangMingXiId;return _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", sql);}public void ShenHe3(int intJingCangMingXiId){SqlParameter[] sql ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter("@Repertory_enter_detail_id",SqlDbType.Int)};sql[0].Value = "ShenHe3";sql[1].Value = intJingCangMingXiId;_myDalMethod.DAL_OPTableDB_Par("Commodity_Warehouse_Entry", sql);;}public DataTable ShenHe_Select_AllJinCangID(){SqlParameter[] sql ={new SqlParameter("@NB",SqlDbType.Char)};sql[0].Value = "ShenHe_Select_AllJinCangID";return _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", sql);}public DataTable ShenHe_Select_ShangPinDingDanIDInJinCangDan(int intJinCangDanId){SqlParameter[] sql ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter("@Repertory_enter_id",SqlDbType.Int), };sql[0].Value = "ShenHe_Select_ShangPinDingDanIDInJinCangDan";sql[1].Value = intJinCangDanId;return _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", sql);}public DataTable ShenHe_Select_JingCangDanByJinCangID(int jinCangDanId){SqlParameter[] sql ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter("@Repertory_enter_id",SqlDbType.Int), };sql[0].Value = "ShenHe_Select_JingCangDanByJinCangID";sql[1].Value = jinCangDanId;return _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", sql);}public void ShenHe_Update_JinCangMingXiDanShenHeFou(int repertoryEnterDetailId){SqlParameter[] sql ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter("@Repertory_enter_detail_id",SqlDbType.Int),};sql[0].Value = "ShenHe_Update_JinCangMingXiDanShenHeFou";sql[1].Value = repertoryEnterDetailId;_myDalMethod.DAL_OPTableDB_Par("Commodity_Warehouse_Entry", sql);}public DataTable checkKuCun(int intKuCunDiDianId, int intShangPinId){SqlParameter[] sql ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter("@Repertory_place_id",SqlDbType.Int),new SqlParameter("@Goods_id",SqlDbType.Int), };sql[0].Value = "checkKuCun";sql[1].Value = intKuCunDiDianId;sql[2].Value = intShangPinId;return _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", sql);}public int UpdateKuCunShu(decimal strRuKuXiShu, int intKuCunDiDianId, int intShangPinId){SqlParameter[] sql ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter("@Repertory_enter_quantity",SqlDbType.Decimal),new SqlParameter("@Repertory_place_id",SqlDbType.Int),new SqlParameter("@Goods_id",SqlDbType.Int), };sql[0].Value = "UpdateKuCunShu";sql[1].Value = strRuKuXiShu;sql[2].Value = intKuCunDiDianId;sql[3].Value = intShangPinId;return _myDalMethod.DAL_OPTableDB_Par("Commodity_Warehouse_Entry", sql);}public void InserKuCunJiLu(decimal strRuKuXiShu, int intKuCunDiDianId, int intShangPinId){SqlParameter[] sql ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter("@Repertory_enter_quantity",SqlDbType.Decimal),new SqlParameter("@Repertory_place_id",SqlDbType.Int),new SqlParameter("@Goods_id",SqlDbType.Int), };sql[0].Value = "InserKuCunJiLu";sql[1].Value = strRuKuXiShu;sql[2].Value = intKuCunDiDianId;sql[3].Value = intShangPinId;_myDalMethod.DAL_OPTableDB_Par("Commodity_Warehouse_Entry", sql);}#region 查询已审核进仓单 /模糊查询已审核进仓单public DataTable SelectYiShenHeJinCangDan(string strBlur){SqlParameter[] sqlcmDpas ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@strBlur", SqlDbType.Char),};sqlcmDpas[0].Value = "SelectYiShenHeJinCangDan";sqlcmDpas[1].Value = strBlur;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", sqlcmDpas);return dt;}#endregion#region 绑定进仓单明细public DataTable BindingRepertoryEnterDetail(int Repertory_enter_id, bool Review_deny){SqlParameter[] SQLCMDpas ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Repertory_enter_id", SqlDbType.Int),new SqlParameter("@Review_deny",SqlDbType.Bit), };SQLCMDpas[0].Value = "BindingRepertoryEnterDetail";SQLCMDpas[1].Value = Repertory_enter_id;SQLCMDpas[2].Value = Review_deny;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", SQLCMDpas);return dt;}#endregionpublic DataTable CheckRepertory_enter_packages2(int Repertory_enter_detail_id){SqlParameter[] sql ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter("@Repertory_enter_detail_id",SqlDbType.Int),};sql[0].Value = "CheckRepertory_enter_packages2";sql[1].Value = Repertory_enter_detail_id;return _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", sql);}public DataTable CheckRepertory_enter_packages1(int Repertory_enter_detail_id){SqlParameter[] sql ={new SqlParameter("@NB",SqlDbType.Char),new SqlParameter("@Repertory_enter_detail_id",SqlDbType.Int),};sql[0].Value = "CheckRepertory_enter_packages1";sql[1].Value = Repertory_enter_detail_id;return _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", sql);}public void ShenHe_Update_JinCangDanShenHeFou1(int intJinCangId){SqlParameter[] sql ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Repertory_enter_id", SqlDbType.Int),};sql[0].Value = "ShenHe_Update_JinCangDanShenHeFou1";sql[1].Value = intJinCangId;_myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", sql);}#region 查询库存地点public DataTable SelectStock(int goodsId, int repertoryPlaceId){SqlParameter[] sql ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Repertory_place_id", SqlDbType.Int),new SqlParameter("@Goods_id", SqlDbType.Int),};sql[0].Value = "SelectStock";sql[1].Value = repertoryPlaceId;sql[2].Value = goodsId;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", sql);return dt;}#endregion#region 查询审核库存public DataTable ShenheSelectStock(int repertoryEnterEetailid){SqlParameter[] sql ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Repertory_enter_detail_id", SqlDbType.Int),};sql[0].Value = "ShenheSelectStock";sql[1].Value = repertoryEnterEetailid;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", sql);return dt;}#endregion#region 审核新增库存public void ShenheInsertStock(decimal yaorukushu, int repertoryPlaceid){SqlParameter[] sql ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Stock_quantity", SqlDbType.Decimal),new SqlParameter("@Repertory_enter_detail_id", SqlDbType.Int),};sql[0].Value = "ShenheInsertStock";sql[1].Value = yaorukushu;sql[2].Value = repertoryPlaceid;_myDalMethod.DAL_OPTableDB_Par("Commodity_Warehouse_Entry", sql);}#endregion#region 审核修改入库数public void ShenHeUpdataStockShu(int yaorukushu, int repertoryEnterEetailid){SqlParameter[] sql ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@yaorukushu", SqlDbType.Decimal),new SqlParameter("@Repertory_enter_detail_id", SqlDbType.Int),};sql[0].Value = "ShenHeUpdataStockShu";sql[1].Value = yaorukushu;sql[2].Value = repertoryEnterEetailid;_myDalMethod.DAL_OPTableDB_Par("Commodity_Warehouse_Entry", sql);}#endregion#region 审核修改审核人和审核时间public void ShenHeInsertAuditorAndReviewTime(int auditorId, DateTime reviewTime, int repertoryEnterid){SqlParameter[] sql ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Auditor_id", SqlDbType.Int),new SqlParameter("@Review_time", SqlDbType.DateTime),new SqlParameter("@Repertory_enter_id",SqlDbType.Int), };sql[0].Value = "ShenHeInsertAuditorAndReviewTime";sql[1].Value = auditorId;sql[2].Value = reviewTime;sql[3].Value = repertoryEnterid;_myDalMethod.DAL_OPTableDB_Par("Commodity_Warehouse_Entry", sql);}#endregion#region 审核查询子进仓明细public DataTable ShenHeSelectChildJinCangMingXi(int repertoryEnterEetailid){SqlParameter[] sql ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Repertory_enter_detail_Farid", SqlDbType.Int),};sql[0].Value = "ShenHeSelectChildJinCangMingXi";sql[1].Value = repertoryEnterEetailid;return _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", sql);}#endregion#region 查询未审核进仓所有明细public DataTable NoShenHeJinCangMingXi(int repertoryEnterid){SqlParameter[] sql ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Repertory_enter_id", SqlDbType.Int),};sql[0].Value = "NoShenHeJinCangMingXi";sql[1].Value = repertoryEnterid;DataTable dt = _myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", sql);return dt;}#endregion#region 审核修改商品订单状态为“已进货”public void ShenHe_UpdateIndentStatus(int repertoryEnterId){SqlParameter[] sql ={new SqlParameter("@NB", SqlDbType.Char),new SqlParameter("@Repertory_enter_id", SqlDbType.Int),};sql[0].Value = "ShenHe_UpdateIndentStatus";sql[1].Value = repertoryEnterId;_myDalMethod.DAL_SelectDB_Par("Commodity_Warehouse_Entry", sql);}#endregion}
}

第七步:存储过程

USE [大型商贸系统]
GO
/****** Object:  StoredProcedure [dbo].[Commodity_Warehouse_Entry]    Script Date: 06/24/2015 14:19:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[Commodity_Warehouse_Entry]
@NB char(200)='',@Buyer char(10)='',
@Register_time datetime='',@Review_time datetime='',
@Agreement_id int=0,
@Indent_id int=0,@Receiver_id int=0,
@Record_number char(20)='',@Registrant_id int=0,
@Auditor_id int=0,@PiCi char(10)='',
@Repertory_place_id int=0,@Repertory_enter_id int=0,
@Goods_id int=0,@RuKuShuLiang char(10)='',
@strBlur char(200)='',@Department_id int=0,
@Employee_id int=0,@Hava_indent_deny bit=0,
@HangShuiJinHuoJia decimal=0,@Affix_count char(10)='',
@Original_number char(10)='',@Review_deny bit=0,
@Stock_quantity decimal=0,@Stock_toplimit decimal=0,
@Stock_floor decimal=0,@Stock_id int=0,
@Goods_indent_detail_id int=0,@Repertory_enter_quantity decimal=0,
@Repertory_enter_packages decimal=0,@Repertory_enter_detail_Farid int=0,
@Repertory_enter_detail_id int=0,@Giveaway_quantity decimal=0,
@KuCunShu decimal=0,@yaorukushu decimal=0
AS
BEGIN--查询合同号
if(@NB='SelectAgreement')
begin
SELECT     Agreement_id, Agreement_code
FROM        Agreement
end
--查询订单号
if(@NB='SelectIndent')
begin
SELECT     Indent_id , Indent_number
FROM        Goods_indent
end
--查询选择订货清单信息
if(@NB='SelectOrderGoodsSpecificationInformation')
begin
SELECT     Goods_indent.Indent_id, Goods_indent.Indent_number,Attribute_gather_detail.Attribute_gather_detail_name, attribute_gather_detail_1.Attribute_gather_detail_name AS settlement, 
CONVERT(varchar(20), Goods_indent.Indent_begin_date, 120) 
AS Indent_begin_date, CONVERT(varchar(20), Goods_indent.Indent_end_date, 120) 
AS Indent_end_date, Agreement.Agreement_code, 
Goods_indent.Voluntarily_indent_deny, Goods_indent.Place_of_delivery,CONVERT(varchar(20), Goods_indent.Indent_time, 120) AS Indent_time, CONVERT(varchar(20), Goods_indent.Register_time, 
120) AS Register_time, CONVERT(varchar(20), Goods_indent.Review_time, 120)AS Review_time, CONVERT(varchar(20), Goods_indent.Cancel_time, 120)AS Cancel_time, 
Eemployee_4.Employee_name AS Prices_auditor, Goods_indent.Department_id,Department.Department_name AS ConsignmentDepartmentName, 
Department.Department_code AS ConsignmentDepartmentCode, Goods_indent.Agreement_id,attribute_gather_detail_2.Attribute_gather_detail_name AS Delivery_way, Eemployee.Employee_name, 
Eemployee_1.Employee_name AS Auditor, attribute_gather_detail_4.Attribute_gather_detail_name ASIndent_execute_situation, Eemployee_3.Employee_name AS Indent_price_person, 
Enterprise_name.Chinese, Goods_indent.Cancel_person_id, Eemployee_2.Employee_name AS 
Cancel_person, attribute_gather_detail_3.Attribute_gather_detail_name AS [Indent _status], 
Eemployee_5.Employee_name AS Buyer, Agreement.Contract_number
FROM         Goods_indent INNER JOIN
Attribute_gather_detail ON Goods_indent.Indent_type_pubid = 
Attribute_gather_detail.Attribute_gather_detail_id INNER JOIN
Attribute_gather_detail AS attribute_gather_detail_1 ONGoods_indent.Settle_accounts_way_pubid = attribute_gather_detail_1.Attribute_gather_detail_id INNER JOIN
Department ON Goods_indent.Department_id = Department.Department_id INNER JOIN
Agreement ON Goods_indent.Agreement_id = Agreement.Agreement_id INNER JOIN
Attribute_gather_detail AS attribute_gather_detail_2 ON 
Goods_indent.Delivery_way_pubid = attribute_gather_detail_2.Attribute_gather_detail_id INNER JOIN
Attribute_gather_detail AS attribute_gather_detail_3 ON 
Goods_indent.Indent_status_pubid = attribute_gather_detail_3.Attribute_gather_detail_id INNER JOIN
Eemployee ON Goods_indent.Registrant_id = Eemployee.Employee_id INNER JOIN
Eemployee AS Eemployee_1 ON Goods_indent.Auditor_id = Eemployee_1.Employee_id INNER JOIN
Eemployee AS Eemployee_3 ON Goods_indent.Indent_price_person_id = Eemployee_3.Employee_id INNER JOIN
Eemployee AS Eemployee_4 ON Goods_indent.Prices_auditor_id = Eemployee_4.Employee_id INNER JOIN
Attribute_gather_detail AS attribute_gather_detail_4 ON 
Goods_indent.Indent_execute_situation_pubid = 
attribute_gather_detail_4.Attribute_gather_detail_id INNER JOIN
Supply_units ON Agreement.Supply_units_id = Supply_units.Supply_units_id INNER JOIN
Enterprise_name ON Supply_units.Enterprise_name_id = Enterprise_name.Enterprise_name_id INNER JOIN
Eemployee AS Eemployee_2 ON Goods_indent.Cancel_person_id = Eemployee_2.Employee_id INNER JOIN
Eemployee AS Eemployee_5 ON Agreement.Purchasing_agent_id = Eemployee_5.Employee_id
where Goods_indent.Indent_status_pubid=119
end--模糊查询选择订货清单所有信息                
if(@NB='VagueSelectChooseOrderGoodsSpecificationInformationAll')
begin
SELECT     Goods_indent.Indent_id, Goods_indent.Indent_number, Attribute_gather_detail.Attribute_gather_detail_name, attribute_gather_detail_1.Attribute_gather_detail_name AS settlement, CONVERT(varchar(20), Goods_indent.Indent_begin_date, 120) AS Indent_begin_date, CONVERT(varchar(20), Goods_indent.Indent_end_date, 120) AS Indent_end_date, Agreement.Agreement_code, Goods_indent.Voluntarily_indent_deny, Goods_indent.Place_of_delivery, CONVERT(varchar(20), Goods_indent.Indent_time, 120) AS Indent_time, CONVERT(varchar(20), Goods_indent.Register_time, 120) AS Register_time, CONVERT(varchar(20), Goods_indent.Review_time, 120) AS Review_time, CONVERT(varchar(20), Goods_indent.Cancel_time, 120) AS Cancel_time, Eemployee_4.Employee_name AS Prices_auditor, Goods_indent.Department_id, Department.Department_name AS ConsignmentDepartmentName, Department.Department_code AS ConsignmentDepartmentCode, Goods_indent.Agreement_id, attribute_gather_detail_2.Attribute_gather_detail_name AS Delivery_way, Eemployee.Employee_name, Eemployee_1.Employee_name AS Auditor, attribute_gather_detail_4.Attribute_gather_detail_name AS Indent_execute_situation, Eemployee_3.Employee_name AS Indent_price_person, Enterprise_name.Chinese, Goods_indent.Cancel_person_id, Eemployee_2.Employee_name AS Cancel_person, attribute_gather_detail_3.Attribute_gather_detail_name AS [Indent _status], Eemployee_5.Employee_name AS Buyer, Agreement.Contract_number
FROM         Goods_indent INNER JOINAttribute_gather_detail ON Goods_indent.Indent_type_pubid = Attribute_gather_detail.Attribute_gather_detail_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_1 ON Goods_indent.Settle_accounts_way_pubid = attribute_gather_detail_1.Attribute_gather_detail_id INNER JOINDepartment ON Goods_indent.Department_id = Department.Department_id INNER JOINAgreement ON Goods_indent.Agreement_id = Agreement.Agreement_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_2 ON Goods_indent.Delivery_way_pubid = attribute_gather_detail_2.Attribute_gather_detail_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_3 ON Goods_indent.Indent_status_pubid = attribute_gather_detail_3.Attribute_gather_detail_id INNER JOINEemployee ON Goods_indent.Registrant_id = Eemployee.Employee_id INNER JOINEemployee AS Eemployee_1 ON Goods_indent.Auditor_id = Eemployee_1.Employee_id INNER JOINEemployee AS Eemployee_3 ON Goods_indent.Indent_price_person_id = Eemployee_3.Employee_id INNER JOINEemployee AS Eemployee_4 ON Goods_indent.Prices_auditor_id = Eemployee_4.Employee_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_4 ON Goods_indent.Indent_execute_situation_pubid = attribute_gather_detail_4.Attribute_gather_detail_id INNER JOINSupply_units ON Agreement.Supply_units_id = Supply_units.Supply_units_id INNER JOINEnterprise_name ON Supply_units.Enterprise_name_id = Enterprise_name.Enterprise_name_id INNER JOINEemployee AS Eemployee_2 ON Goods_indent.Cancel_person_id = Eemployee_2.Employee_id INNER JOINEemployee AS Eemployee_5 ON Agreement.Purchasing_agent_id = Eemployee_5.Employee_idwhere Goods_indent.Indent_status_pubid=119 and Indent_number like '%'+RTRIM(@strBlur)+'%' 
end
--根部门id查询库存地点
if(@NB='SelectInventoryPlaceByDepartment_id')
begin
SELECT     Repertory_place_name, Repertory_place_identifier, Department_id, Repertory_place_id
FROM         Repertory_place
where Department_id=@Department_id
end
--根据库存地点id查询库存地点名称
if(@NB='SelectRepertory_place_nameByRepertory_place_id')
begin
SELECT     Repertory_place_name
FROM         Repertory_place
where Repertory_place_id=@Repertory_place_id
end
--根据部门id查询收货人编号
if(@NB='SelectShouHuoRenByJinHuoBuMenId')
begin
SELECT     Employee_id, Employee_name, Employee_number
FROM         Eemployee
where Department_id=@Department_id
end
--根据员工id查询收货人
if(@NB='SelectReceiver_namByEmployee_id')
beginSELECT     Employee_name As Receiver
FROM         Eemployeewhere Employee_id=@Employee_id
end
--绑定订单明细
if(@NB='BindingIndentDetail')
begin
SELECT     Goods_indent_detail.Goods_indent_detail_id, Goods_indent_detail.Goods_id AS Expr1, Goods_indent_detail.Indent_id, Goods_indent_detail.Repertory_enter_packages, attribute_gather_detail_3.Attribute_gather_detail_name AS Use_target, attribute_gather_detail_5.Attribute_gather_detail_name AS ZhiLiangDengJi, Agreement.Agreement_code, Goods_producing_area.Producing_area_name, Goods_rademark.Goods_rademark_name, Manage_season.Manage_season_name, Eemployee.Employee_name, Eemployee_1.Employee_name AS Auditor, Eemployee.Employee_name AS GengXinRen, Goods.Goods_id, Goods.Goods_code, Goods.Goods_bar_code, Goods.Vender_bar_code_deny, Goods.Goods_name, Goods.Goods_abbreviation, Goods.Agreement_id, Goods.Manufacturer_id, Goods.Producing_area_id, Goods.Art_No, Goods.Format_model, Goods.Unit_of_measurement_pubid, Goods.Use_target_pubid, Goods.Goods_colours, Goods.Goods_rademark_id, Goods.Goods_classify_pubid, Goods.Quality_guarantee_period_pubid, Goods.Input_ratio, Goods.Output_ratio, Goods.Count_scale, Goods.Quality_content, Goods.Quality_grade_pubid, Goods.Manage_season_id, Goods.Permit_decimal_deny, Goods.Product_status_pubid, Goods.Registrant_id, convert(varchar(20),Goods.Register_time,120)as Register_time, Goods.Auditor_id, convert(varchar(20),Goods.Review_time,120)as Review_time, Goods.Update_person_id, convert(varchar(20),Goods.Update_Time,120)as Update_Time, Goods.Purchase_bid, Goods.Self_fix_goods_deny, Goods.Mini_fix_goods_deny, Goods_indent_detail.Repertory_enter_packages AS Expr2, Goods.Plncode_PLN, Goods.Copy_record_deny, Goods.Goods_tab_pubid, Attribute_gather_detail.Attribute_gather_detail_name, Goods.Retail_unit_price, Goods_indent_detail.Purchase_number, attribute_gather_detail_2.Attribute_gather_detail_name AS Unit_of_measurement, Manufacturer.Manufacturer_name, attribute_gather_detail_4.Attribute_gather_detail_name AS Goods_classify, attribute_gather_detail_6.Attribute_gather_detail_name AS Product_status
FROM         Attribute_gather_detail INNER JOINGoods_indent_detail INNER JOINGoods ON Goods_indent_detail.Goods_id = Goods.Goods_id ON Attribute_gather_detail.Attribute_gather_detail_id = Goods.Goods_tab_pubid INNER JOINAttribute_gather_detail AS attribute_gather_detail_2 ON Goods.Unit_of_measurement_pubid = attribute_gather_detail_2.Attribute_gather_detail_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_3 ON Goods.Use_target_pubid = attribute_gather_detail_3.Attribute_gather_detail_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_4 ON Goods.Goods_classify_pubid = attribute_gather_detail_4.Attribute_gather_detail_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_5 ON Goods.Quality_grade_pubid = attribute_gather_detail_5.Attribute_gather_detail_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_6 ON Goods.Product_status_pubid = attribute_gather_detail_6.Attribute_gather_detail_id INNER JOINAgreement ON Goods.Agreement_id = Agreement.Agreement_id INNER JOINManufacturer ON Goods.Manufacturer_id = Manufacturer.Manufacturer_id INNER JOINGoods_producing_area ON Goods.Producing_area_id = Goods_producing_area.Producing_area_id INNER JOINGoods_rademark ON Goods.Goods_rademark_id = Goods_rademark.Goods_rademark_id INNER JOINManage_season ON Goods.Manage_season_id = Manage_season.Manage_season_id INNER JOINEemployee ON Goods.Registrant_id = Eemployee.Employee_id INNER JOINEemployee AS Eemployee_1 ON Goods.Auditor_id = Eemployee_1.Employee_id INNER JOINEemployee AS Eemployee_2 ON Goods.Update_person_id = Eemployee_2.Employee_idWHERE     (Goods_indent_detail.Indent_id  = @Indent_id)          
end
--查询员工
if(@NB='SelectEmployee')
begin
SELECT     Employee_id AS ID, Employee_name AS MC
FROM         Eemployee
end
--新增进仓单
if(@NB='Insert_Repertory_enter')
begin
begin tran
INSERT INTO Repertory_enter(Indent_id, Receiver_id, Record_number, Registrant_id, Register_time, Repertory_place_id, Affix_count, Original_number, Review_deny, Hava_indent_deny, Type_of_operation_pubid, YouXiaoFou, ChongHongFou)
VALUES     (@Indent_id,@Receiver_id,@Record_number,@Registrant_id,@Register_time,@Repertory_place_id,@Affix_count,@Original_number, 'false', 'true', '110','true','false')
select @@IDENTITY 
--新增单据数
UPDATE    Day_max_quantity
SET               Day_max_count = Day_max_count+1
where Odd_numbers_id=4
commit tran
end
--查询自营进仓单
if(@NB='SelectBuildByOneselfWarehouseEntry'  and @strBlur is null)
begin
SELECT     Repertory_enter.Repertory_enter_id, Goods_indent.Indent_number, 
Repertory_enter.Indent_id, Goods_indent.Department_id, Department.Department_name,Enterprise_name.Chinese, 
Repertory_enter.Repertory_place_id, Repertory_place.Repertory_place_name,Agreement.Agreement_code, Eemployee.Employee_name AS Buyer, Attribute_gather_detail.Attribute_code, 
Repertory_enter.Record_number, Department.Department_code,Repertory_place.Repertory_place_identifier, Repertory_enter.Affix_count,Repertory_enter.Original_number, 
Eemployee_1.Employee_number, Eemployee_1.Employee_name AS Receiver, 
Repertory_enter.Receiver_id, Repertory_enter.Registrant_id,convert(varchar(20),
Repertory_enter.Register_time,120)as Register_time, 
Repertory_enter.Review_deny, Attribute_gather_detail.Attribute_gather_detail_name AS 
DingDanLeiXingMC, attribute_gather_detail_1.Attribute_gather_detail_name AS JieSuanFangShiMC
FROM         Repertory_enter INNER JOIN
Goods_indent ON Repertory_enter.Indent_id = Goods_indent.Indent_id INNER JOIN
Department ON Goods_indent.Department_id = Department.Department_id INNER JOIN
Agreement ON Goods_indent.Agreement_id = Agreement.Agreement_id INNER JOIN
Supply_units ON Agreement.Supply_units_id = Supply_units.Supply_units_id INNER JOIN
Enterprise_name ON Supply_units.Enterprise_name_id = Enterprise_name.Enterprise_name_id INNER JOIN
Repertory_place ON Repertory_enter.Repertory_place_id = Repertory_place.Repertory_place_id INNER JOIN
Attribute_gather_detail ON Goods_indent.Indent_type_pubid = 
Attribute_gather_detail.Attribute_gather_detail_id INNER JOIN
Attribute_gather_detail AS attribute_gather_detail_1 ON 
Goods_indent.Settle_accounts_way_pubid = 
attribute_gather_detail_1.Attribute_gather_detail_id INNER JOIN
Eemployee ON Agreement.Purchasing_agent_id = Eemployee.Employee_id INNER JOIN
Eemployee AS Eemployee_1 ON Repertory_enter.Receiver_id = Eemployee_1.Employee_id
where Repertory_enter.Review_deny='false'
end--模糊查询自营进仓单else if(@NB='SelectBuildByOneselfWarehouseEntry' and @strBlur is not null)begin
SELECT     Repertory_enter.Repertory_enter_id, Goods_indent.Indent_number, 
Repertory_enter.Indent_id, Goods_indent.Department_id, Department.Department_name,
Enterprise_name.Chinese, 
Repertory_enter.Repertory_place_id, Repertory_place.Repertory_place_name,
Agreement.Agreement_code, Eemployee.Employee_name AS Buyer,
Attribute_gather_detail.Attribute_code, 
Repertory_enter.Record_number, Department.Department_code,
Repertory_place.Repertory_place_identifier, Repertory_enter.Affix_count,
Repertory_enter.Original_number, 
Eemployee_1.Employee_number, Eemployee_1.Employee_name AS Receiver,
Repertory_enter.Receiver_id, Repertory_enter.Registrant_id,
convert(varchar(20),Repertory_enter.Register_time,120)as Register_time, 
Repertory_enter.Review_deny,
Attribute_gather_detail.Attribute_gather_detail_name AS DingDanLeiXingMC, 
attribute_gather_detail_1.Attribute_gather_detail_name AS JieSuanFangShiMC
FROM         Repertory_enter INNER JOIN
Goods_indent ON Repertory_enter.Indent_id = Goods_indent.Indent_id INNER JOIN
Department ON Goods_indent.Department_id = Department.Department_id INNER JOIN
Agreement ON Goods_indent.Agreement_id = Agreement.Agreement_id INNER JOIN
Supply_units ON Agreement.Supply_units_id = Supply_units.Supply_units_id INNER JOIN
Enterprise_name ON Supply_units.Enterprise_name_id = Enterprise_name.Enterprise_name_id INNER JOIN
Repertory_place ON Repertory_enter.Repertory_place_id = Repertory_place.Repertory_place_id INNER JOIN
Attribute_gather_detail ON Goods_indent.Indent_type_pubid = 
Attribute_gather_detail.Attribute_gather_detail_id INNER JOIN
Attribute_gather_detail AS attribute_gather_detail_1 ONGoods_indent.Settle_accounts_way_pubid = attribute_gather_detail_1.Attribute_gather_detail_id INNER JOIN
Eemployee ON Agreement.Purchasing_agent_id = 
Eemployee.Employee_id INNER JOIN
Eemployee AS Eemployee_1 ON Repertory_enter.Receiver_id = Eemployee_1.Employee_id
where  Repertory_enter.Record_number like '%'+RTRIM(@strBlur)+'%'and 
Repertory_enter.Review_deny='false'
end
--根据进仓id查询自营进仓单
if(@NB='SelectBuildByOneselfWarehouseEntryByRepertory_enter_id')
begin
SELECT     Repertory_enter.Repertory_enter_id, Goods_indent.Indent_number, Repertory_enter.Indent_id, Goods_indent.Department_id, Department.Department_name, Enterprise_name.Chinese, Repertory_enter.Repertory_place_id, Repertory_place.Repertory_place_name, Agreement.Agreement_code, Eemployee.Employee_name AS Buyer, Attribute_gather_detail.Attribute_code, Repertory_enter.Record_number, Department.Department_code, Repertory_place.Repertory_place_identifier, Repertory_enter.Affix_count, Repertory_enter.Original_number, Eemployee_1.Employee_number, Eemployee_1.Employee_name AS Receiver, Repertory_enter.Receiver_id, Repertory_enter.Registrant_id, convert(varchar(20),Repertory_enter.Register_time,120)as Register_time, Attribute_gather_detail.Attribute_gather_detail_name AS DingDanLeiXingMC, attribute_gather_detail_1.Attribute_gather_detail_name AS JieSuanFangShiMC
FROM         Repertory_enter INNER JOINGoods_indent ON Repertory_enter.Indent_id = Goods_indent.Indent_id INNER JOINDepartment ON Goods_indent.Department_id = Department.Department_id INNER JOINAgreement ON Goods_indent.Agreement_id = Agreement.Agreement_id INNER JOINSupply_units ON Agreement.Supply_units_id = Supply_units.Supply_units_id INNER JOINEnterprise_name ON Supply_units.Enterprise_name_id = Enterprise_name.Enterprise_name_id INNER JOINRepertory_place ON Repertory_enter.Repertory_place_id = Repertory_place.Repertory_place_id INNER JOINAttribute_gather_detail ON Goods_indent.Indent_type_pubid = Attribute_gather_detail.Attribute_gather_detail_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_1 ON Goods_indent.Settle_accounts_way_pubid = attribute_gather_detail_1.Attribute_gather_detail_id INNER JOINEemployee ON Agreement.Purchasing_agent_id = Eemployee.Employee_id INNER JOINEemployee AS Eemployee_1 ON Repertory_enter.Receiver_id = Eemployee_1.Employee_id
where Repertory_enter_id=@Repertory_enter_id
end
if(@NB='Update_Repertory_enter')--修改进仓单
begin
UPDATE    Repertory_enter
SET              Indent_id=@Indent_id , Receiver_id = @Receiver_id, Record_number = @Record_number, Registrant_id = @Registrant_id, Register_time = @Register_time, Repertory_place_id = @Repertory_place_id, Affix_count = @Affix_count, Review_deny = 'false', Hava_indent_deny = 'true', Type_of_operation_pubid=110,Original_number=@Original_number
where Repertory_enter_id=@Repertory_enter_id
end
--删除进仓单明细
if(@NB='delete_Repertory_enter_detail')
begin
DELETE FROM Repertory_enter_detail
where Repertory_enter_id=@Repertory_enter_id
end
--删除进仓单
if(@NB='delete_Repertory_enter')
begin
DELETE FROM Repertory_enter
where Repertory_enter_id=@Repertory_enter_id
end
--新增库存单
if(@NB='InsertStock')
begin
begin tran
INSERT INTO Stock(Repertory_place_id, Goods_id, Stock_quantity, Stock_toplimit, Stock_floor)
VALUES     (@Repertory_place_id,@Goods_id,@Stock_quantity,100000,100)
commit tran
end
if(@NB='UpdateKuCunShu')
begin
UPDATE    Stock
SET              Stock_quantity =@Stock_quantity
where Stock_id=@Stock_id
end
--新增进仓明细
if(@NB='InsertRepertoryEnterDetail')
begin
INSERT INTO Repertory_enter_detail(Repertory_enter_detail_Farid, Repertory_enter_id, Goods_id, Repertory_enter_quantity, Review_deny,Repertory_enter_packages,Giveaway_quantity,ChongHong_deny)
VALUES     ('0',@Repertory_enter_id,@Goods_id,@Repertory_enter_quantity,'false',@Repertory_enter_packages,@Giveaway_quantity,'false')
end
--绑定进仓明细
if(@NB='BindingRepertoryEnterDetail')
begin
SELECT     Repertory_enter_detail.Repertory_enter_detail_id, Attribute_gather_detail.Attribute_gather_detail_name, attribute_gather_detail_2.Attribute_gather_detail_name AS Unit_of_measurement, attribute_gather_detail_3.Attribute_gather_detail_name AS Use_target, attribute_gather_detail_5.Attribute_gather_detail_name AS ZhiLiangDengJi, attribute_gather_detail_6.Attribute_gather_detail_name AS ChanPinZhuangTai, Agreement.Agreement_code, Manufacturer.Manufacturer_name, Goods_producing_area.Producing_area_name, Goods_rademark.Goods_rademark_name, Manage_season.Manage_season_name, Eemployee.Employee_name, Eemployee_1.Employee_name AS Auditor, Eemployee.Employee_name AS GengXinRen, Goods.Goods_id, Goods.Goods_code, Goods.Goods_bar_code, Goods.Vender_bar_code_deny, Goods.Goods_name, Goods.Goods_abbreviation, Goods.Plncode_PLN, Goods.Copy_record_deny, Goods.Goods_tab_pubid, Goods.Agreement_id, Goods.Manufacturer_id, Goods.Producing_area_id, Goods.Art_No, Goods.Format_model, Goods.Unit_of_measurement_pubid, Goods.Use_target_pubid, Goods.Goods_colours, Goods.Goods_rademark_id, Goods.Goods_classify_pubid, Goods.Quality_guarantee_period_pubid, Goods.Input_ratio, Goods.Output_ratio, Goods.Count_scale, Goods.Quality_content, Goods.Quality_grade_pubid, Goods.Manage_season_id, Goods.Permit_decimal_deny, Goods.Product_status_pubid, Goods.Registrant_id, convert(varchar(20),Goods.Register_time,120)as Register_time, Goods.Auditor_id, convert(varchar(20),Goods.Review_time,120)as Review_time, Goods.Update_person_id,convert(varchar(20),Goods.Update_Time,120)as Update_Time, Goods.Retail_unit_price, Goods.Purchase_bid, Goods.Self_fix_goods_deny, Goods.Mini_fix_goods_deny, Repertory_enter_detail.Repertory_enter_detail_Farid, Repertory_enter_detail.Repertory_enter_id, Repertory_enter_detail.Repertory_enter_quantity, Repertory_enter_detail.Repertory_enter_packages, Repertory_enter_detail.Review_deny, Repertory_enter_detail.Repertory_enter_quantity AS Expr1, Repertory_enter_detail.Giveaway_quantity AS Purchase_number
FROM         Attribute_gather_detail INNER JOINGoods ON Attribute_gather_detail.Attribute_gather_detail_id = Goods.Goods_tab_pubid INNER JOINAttribute_gather_detail AS attribute_gather_detail_2 ON Goods.Unit_of_measurement_pubid = attribute_gather_detail_2.Attribute_gather_detail_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_3 ON Goods.Use_target_pubid = attribute_gather_detail_3.Attribute_gather_detail_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_5 ON Goods.Quality_grade_pubid = attribute_gather_detail_5.Attribute_gather_detail_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_6 ON Goods.Product_status_pubid = attribute_gather_detail_6.Attribute_gather_detail_id INNER JOINAgreement ON Goods.Agreement_id = Agreement.Agreement_id INNER JOINManufacturer ON Goods.Manufacturer_id = Manufacturer.Manufacturer_id INNER JOINGoods_producing_area ON Goods.Producing_area_id = Goods_producing_area.Producing_area_id INNER JOINGoods_rademark ON Goods.Goods_rademark_id = Goods_rademark.Goods_rademark_id INNER JOINManage_season ON Goods.Manage_season_id = Manage_season.Manage_season_id INNER JOINEemployee ON Goods.Registrant_id = Eemployee.Employee_id INNER JOINEemployee AS Eemployee_1 ON Goods.Auditor_id = Eemployee_1.Employee_id INNER JOINEemployee AS Eemployee_2 ON Goods.Update_person_id = Eemployee_2.Employee_id INNER JOINRepertory_enter_detail ON Goods.Goods_id = Repertory_enter_detail.Goods_idWHERE     (Repertory_enter_detail.Repertory_enter_id = @Repertory_enter_id) AND (Repertory_enter_detail.Repertory_enter_detail_Farid = 0) AND (Repertory_enter_detail.Review_deny = @Review_deny)
end
--查询细数
if(@NB='CheckNeTamount')
begin
select SUM(Repertory_enter_quantity+Giveaway_quantity) as YiRuKuShu
from Repertory_enter_detail
where Repertory_enter_detail_Farid=@Repertory_enter_detail_Farid
--@MxFar_Id
end
--增加进仓明细Child
if(@NB='AddJingCangMingXiChild')
beginINSERT INTO Repertory_enter_detail(Repertory_enter_detail_Farid, Repertory_enter_id, Goods_id, Repertory_enter_packages, Repertory_enter_quantity,Giveaway_quantity, Review_deny,Auditor_id,Review_time,ChongHong_deny)
VALUES     (@Repertory_enter_detail_id,(SELECT     Repertory_enter_id
FROM         Repertory_enter_detail
WHERE     Repertory_enter_detail_id = @Repertory_enter_detail_id),(SELECT     Goods_id
FROM         Repertory_enter_detail where Repertory_enter_detail_id = @Repertory_enter_detail_id),@Repertory_enter_packages,@Repertory_enter_quantity,@Giveaway_quantity, 'true',@Auditor_id,@Review_time,'false');
end
if(@NB='ShenHe3')
begin
UPDATE    Repertory_enter_detail
SET              Review_deny ='true'
where Repertory_enter_detail_id=@Repertory_enter_detail_id
end
if(@NB='ShenHe_Select_AllJinCangID')
begin
SELECT     Repertory_enter_id
FROM         Repertory_enter
end
if(@NB='ShenHe_Select_ShangPinDingDanIDInJinCangDan')
begin
SELECT     Repertory_enter_id
FROM         Repertory_enter
where Repertory_enter_id=@Repertory_enter_id
end
if(@NB='ShenHe_Select_JingCangDanByJinCangID')
begin
SELECT     Repertory_enter_detail_id
FROM         Repertory_enter_detail
where Repertory_enter_id=@Repertory_enter_id and Review_deny='false'
end
if(@NB='ShenHe_Update_JinCangMingXiDanShenHeFou')
begin
UPDATE    Repertory_enter_detail
SET              Review_deny ='true',ChongHong_deny='false'
where Repertory_enter_detail_id=@Repertory_enter_detail_id
end
if(@NB='ShenHe_Update_JinCangDanShenHeFou1')
begin
UPDATE    Repertory_enter
SET              Review_deny ='true'
where Repertory_enter_id=@Repertory_enter_id 
end
if(@NB='checkKuCun')
begin
SELECT     Stock_id
FROM         Stock
where Repertory_place_id=@Repertory_place_id and Goods_id=@Goods_id
end
if(@NB='UpdateKuCunShu')
begin
UPDATE    Stock
SET      Stock_quantity =Stock_quantity+@Repertory_enter_quantity
where Repertory_place_id=@Repertory_place_id and Goods_id=@Goods_id
end
if(@NB='InserKuCunJiLu')
begin
INSERT INTO Stock(Repertory_place_id, Goods_id, Stock_quantity, Stock_toplimit, Stock_floor)
VALUES     (@Repertory_place_id,@Goods_id,@Repertory_enter_quantity,100000,100)
endif(@NB='bangJinCangDanMingXi')
begin
SELECT     Goods_indent.Indent_id, Goods_indent.Indent_number, Attribute_gather_detail.Attribute_gather_detail_name, attribute_gather_detail_1.Attribute_gather_detail_name AS settlement, Goods_indent.Indent_begin_date, Goods_indent.Indent_end_date, Agreement.Agreement_code, Goods_indent.Voluntarily_indent_deny, Goods_indent.Place_of_delivery, Goods_indent.Indent_time, attribute_gather_detail_2.Attribute_gather_detail_name AS Delivery_way, Eemployee.Employee_name, Goods_indent.Register_time, Eemployee_1.Employee_name AS Auditor, Goods_indent.Review_time, Eemployee.Employee_name AS ZhuXiaoRen, Goods_indent.Cancel_time, Eemployee_3.Employee_name AS Indent_price_person, Eemployee_4.Employee_name AS Prices_auditor, attribute_gather_detail_4.Attribute_gather_detail_id AS Indent_execute_situation, Department.Department_code AS ConsignmentDepartmentCode, Enterprise_name.Chinese, Department.Department_id, Repertory_enter.Review_deny, Repertory_enter.Repertory_enter_id, Department.Department_name AS ConsignmentDepartmentName, Eemployee_5.Employee_name AS Buyer, attribute_gather_detail_3.Attribute_gather_detail_name AS Indent_status, Eemployee_2.Employee_name AS Cancel_person
FROM         Goods_indent INNER JOINAttribute_gather_detail ON Goods_indent.Indent_type_pubid = Attribute_gather_detail.Attribute_gather_detail_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_1 ON Goods_indent.Settle_accounts_way_pubid = attribute_gather_detail_1.Attribute_gather_detail_id INNER JOINDepartment ON Goods_indent.Department_id = Department.Department_id INNER JOINAgreement ON Goods_indent.Agreement_id = Agreement.Agreement_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_2 ON Goods_indent.Delivery_way_pubid = attribute_gather_detail_2.Attribute_gather_detail_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_3 ON Goods_indent.Indent_status_pubid = attribute_gather_detail_3.Attribute_gather_detail_id INNER JOINEemployee ON Goods_indent.Registrant_id = Eemployee.Employee_id INNER JOINEemployee AS Eemployee_1 ON Goods_indent.Auditor_id = Eemployee_1.Employee_id INNER JOINEemployee AS Eemployee_2 ON Goods_indent.Cancel_person_id = Eemployee_2.Employee_id INNER JOINEemployee AS Eemployee_3 ON Goods_indent.Indent_price_person_id = Eemployee_3.Employee_id INNER JOINEemployee AS Eemployee_4 ON Goods_indent.Prices_auditor_id = Eemployee_4.Employee_id INNER JOINAttribute_gather_detail AS attribute_gather_detail_4 ON Goods_indent.Indent_execute_situation_pubid = attribute_gather_detail_4.Attribute_gather_detail_id INNER JOINSupply_units ON Agreement.Supply_units_id = Supply_units.Supply_units_id INNER JOINEnterprise_name ON Supply_units.Enterprise_name_id = Enterprise_name.Enterprise_name_id INNER JOINRepertory_enter ON Goods_indent.Indent_id = Repertory_enter.Indent_id INNER JOINEemployee AS Eemployee_5 ON Agreement.Purchasing_agent_id = Eemployee_5.Employee_id
endif(@NB='SelectYiShenHeJinCangDan'and @strBlur ='')
begin
SELECT     Repertory_enter.Repertory_enter_id, Goods_indent.Indent_number, Department.Department_name, Repertory_place.Repertory_place_name, Repertory_enter.Record_number, Repertory_enter.Original_number, Eemployee_1.Employee_name AS Receiver, Repertory_enter.Receiver_id, CONVERT(varchar(20), Repertory_enter.Register_time, 120) AS Register_time, Repertory_enter.Review_deny, Repertory_enter.Auditor_id, Repertory_enter.Review_time, Eemployee_2.Employee_name, Attribute_gather_detail.Attribute_gather_detail_name AS Indent_type_name, Agreement.Contract_number, Attribute_gather_detail_1.Attribute_gather_detail_name AS settlement, Goods_indent.Review_time AS Expr1, Attribute_gather_detail_2.Attribute_gather_detail_name AS Auditor, Department.Department_code, Enterprise_name.Chinese, Eemployee.Employee_name AS Buyer, Goods_indent.Department_id, Goods_indent.Indent_id, Eemployee_1.Employee_number AS Receiver_name, Repertory_place.Repertory_place_identifier, Repertory_enter.Affix_count, Repertory_enter.Registrant_id, Eemployee_3.Employee_name AS Registrant, Repertory_enter.Register_time AS Expr2, Repertory_place.Repertory_place_id
FROM         Repertory_place INNER JOINRepertory_enter INNER JOINGoods_indent ON Repertory_enter.Indent_id = Goods_indent.Indent_id INNER JOINDepartment ON Goods_indent.Department_id = Department.Department_id ON Repertory_place.Repertory_place_id = Repertory_enter.Repertory_place_id INNER JOINEemployee AS Eemployee_1 ON Repertory_enter.Receiver_id = Eemployee_1.Employee_id INNER JOINEemployee AS Eemployee_2 ON Repertory_enter.Auditor_id = Eemployee_2.Employee_id INNER JOINAttribute_gather_detail ON Goods_indent.Indent_type_pubid = Attribute_gather_detail.Attribute_gather_detail_id INNER JOINAttribute_gather_detail AS Attribute_gather_detail_1 ON Goods_indent.Settle_accounts_way_pubid = Attribute_gather_detail_1.Attribute_gather_detail_id INNER JOINAgreement ON Goods_indent.Agreement_id = Agreement.Agreement_id INNER JOINAttribute_gather_detail AS Attribute_gather_detail_2 ON Goods_indent.Auditor_id = Attribute_gather_detail_2.Attribute_gather_detail_id INNER JOINSupply_units ON Agreement.Supply_units_id = Supply_units.Supply_units_id INNER JOINEnterprise_name ON Supply_units.Enterprise_name_id = Enterprise_name.Enterprise_name_id INNER JOINEemployee ON Agreement.Purchasing_agent_id = Eemployee.Employee_id INNER JOINEemployee AS Eemployee_3 ON Repertory_enter.Registrant_id = Eemployee_3.Employee_id 
where Repertory_enter.Review_deny='True' and YouXiaoFou ='true'
end
--模糊查询已审核自营进仓单else if(@NB='SelectYiShenHeJinCangDan' and @strBlur <> '')begin
SELECT     Repertory_enter.Repertory_enter_id, Goods_indent.Indent_number, Department.Department_name, Repertory_place.Repertory_place_name, Repertory_enter.Record_number, Repertory_enter.Original_number, Eemployee_1.Employee_name AS Receiver, Repertory_enter.Receiver_id, CONVERT(varchar(20), Repertory_enter.Register_time, 120) AS Register_time, Repertory_enter.Review_deny, Repertory_enter.Auditor_id, Repertory_enter.Review_time, Eemployee_2.Employee_name, Attribute_gather_detail.Attribute_gather_detail_name AS Indent_type_name, Agreement.Contract_number, Attribute_gather_detail_1.Attribute_gather_detail_name AS settlement, Goods_indent.Review_time AS Expr1, Attribute_gather_detail_2.Attribute_gather_detail_name AS Auditor, Department.Department_code, Enterprise_name.Chinese, Eemployee.Employee_name AS Buyer, Goods_indent.Department_id, Goods_indent.Indent_id, Eemployee_1.Employee_number AS Receiver_name, Repertory_place.Repertory_place_identifier, Repertory_enter.Affix_count, Repertory_enter.Registrant_id, Eemployee_3.Employee_name AS Registrant, Repertory_enter.Register_time AS Expr2, Repertory_place.Repertory_place_id
FROM         Repertory_place INNER JOINRepertory_enter INNER JOINGoods_indent ON Repertory_enter.Indent_id = Goods_indent.Indent_id INNER JOINDepartment ON Goods_indent.Department_id = Department.Department_id ON Repertory_place.Repertory_place_id = Repertory_enter.Repertory_place_id INNER JOINEemployee AS Eemployee_1 ON Repertory_enter.Receiver_id = Eemployee_1.Employee_id INNER JOINEemployee AS Eemployee_2 ON Repertory_enter.Auditor_id = Eemployee_2.Employee_id INNER JOINAttribute_gather_detail ON Goods_indent.Indent_type_pubid = Attribute_gather_detail.Attribute_gather_detail_id INNER JOINAttribute_gather_detail AS Attribute_gather_detail_1 ON Goods_indent.Settle_accounts_way_pubid = Attribute_gather_detail_1.Attribute_gather_detail_id INNER JOINAgreement ON Goods_indent.Agreement_id = Agreement.Agreement_id INNER JOINAttribute_gather_detail AS Attribute_gather_detail_2 ON Goods_indent.Auditor_id = Attribute_gather_detail_2.Attribute_gather_detail_id INNER JOINSupply_units ON Agreement.Supply_units_id = Supply_units.Supply_units_id INNER JOINEnterprise_name ON Supply_units.Enterprise_name_id = Enterprise_name.Enterprise_name_id INNER JOINEemployee ON Agreement.Purchasing_agent_id = Eemployee.Employee_id INNER JOINEemployee AS Eemployee_3 ON Repertory_enter.Registrant_id = Eemployee_3.Employee_idwhere  Repertory_enter.Record_number like '%'+RTRIM(@strBlur)+'%'and Repertory_enter.Review_deny='true' and YouXiaoFou ='true'
end
if(@NB='MoHiuYiShenHeJinCangDan')
begin
SELECT     Repertory_enter.Repertory_enter_id,Goods_indent.Indent_number,Repertory_enter.Indent_id, Goods_indent.Department_id, Department.Department_name,Enterprise_name.Chinese,Repertory_enter.Repertory_place_id,Repertory_place.Repertory_place_name, Agreement.Agreement_code,attribute_gather_detail.Attribute_gather_detail_name AS Indent_type,attribute_gather_detail_1.Attribute_gather_detail_name AS Settle_accounts_way,Eemployee.Employee_name AS Buyer,attribute_gather_detail.Attribute_code, Repertory_enter.Record_number,Department.Department_code,Repertory_place.Repertory_place_identifier,Repertory_enter.Affix_count,Repertory_enter.Original_number,Eemployee_1.Employee_number,Eemployee_1.Employee_name AS Receiver, Repertory_enter.Receiver_id,Repertory_enter.Registrant_id,Repertory_enter.Register_time,Repertory_enter.Review_deny
FROM         Repertory_enter INNER JOINGoods_indent ON Repertory_enter.Indent_id  = Goods_indent.Indent_id  INNER JOINDepartment  ON Goods_indent.Department_id = Department .Department_id INNER JOINAgreement  ON Goods_indent.Agreement_id = Agreement .Agreement_id INNER JOINSupply_units ON Agreement .Supply_units_id = Supply_units.Supply_units_id INNER JOINEnterprise_name ON Supply_units.Enterprise_name_id = Enterprise_name.Enterprise_name_id INNER JOINRepertory_place ON Repertory_enter.Repertory_place_id = Repertory_place.Repertory_place_id INNER JOINattribute_gather_detail ON Goods_indent.Indent_type_pubid = attribute_gather_detail.Attribute_gather_detail_id INNER JOINattribute_gather_detail AS attribute_gather_detail_1 ON Goods_indent.Settle_accounts_way_pubid = attribute_gather_detail_1.Attribute_gather_detail_id INNER JOINEemployee ON Agreement.Purchasing_agent_id = Eemployee.Employee_id INNER JOINEemployee AS Eemployee_1 ON Repertory_enter.Receiver_id = Eemployee_1.Employee_id    
where Repertory_enter.Record_number like '%'+RTRIM(@strBlur)+'%' and Repertory_enter.Review_deny='True'end--查询入库数量
if(@NB='CheckRepertory_enter_packages1')
begin
SELECT    sum( Repertory_enter_quantity + Repertory_enter_quantity)as zongRuKuShu,Repertory_enter_detail_id
FROM         Repertory_enter_detail
where Repertory_enter_detail_id=@Repertory_enter_detail_id
group by Repertory_enter_detail_id
end
--查询入库数量
if(@NB='CheckRepertory_enter_packages2')
begin
SELECT    sum( Repertory_enter_quantity + Repertory_enter_quantity)as zongRuKuShu
FROM         Repertory_enter_detail
where Repertory_enter_detail_Farid=@Repertory_enter_detail_id
end
--查询库存数
if(@NB='SelectStock')
begin
SELECT     Stock_quantity, Stock_toplimit
FROM         Stock
where Repertory_place_id=@Repertory_place_id and Goods_id=@Goods_id
end
--审核查询库存
if(@NB='ShenheSelectStock')
begin
SELECT     Stock.Stock_quantity, Stock.Repertory_enter_detail_id, Stock.Stock_toplimit, Stock.Goods_id, Goods.Goods_name, Repertory_enter.Record_number
FROM         Stock INNER JOINGoods ON Stock.Goods_id = Goods.Goods_id INNER JOINRepertory_enter_detail ON Stock.Repertory_enter_detail_id = Repertory_enter_detail.Repertory_enter_detail_id INNER JOINRepertory_enter ON Repertory_enter_detail.Repertory_enter_id = Repertory_enter.Repertory_enter_id
where Stock.Repertory_enter_detail_id=@Repertory_enter_detail_id
end
--审核新增库存if(@NB='ShenheInsertStock')beginINSERT INTO Stock(Repertory_place_id, Goods_id, Stock_quantity, Stock_toplimit, Stock_floor, Repertory_enter_detail_id)
VALUES     ((SELECT     Repertory_enter.Repertory_place_id
FROM         Repertory_enter_detail INNER JOINRepertory_enter ON Repertory_enter_detail.Repertory_enter_id = Repertory_enter.Repertory_enter_idwhere Repertory_enter_detail_id=@Repertory_enter_detail_id),(SELECT     Goods_id
FROM         Repertory_enter_detail where Repertory_enter_detail_id=@Repertory_enter_detail_id ),@Stock_quantity,100000,100,@Repertory_enter_detail_id)end--审核修改入库数if(@NB='ShenHeUpdataStockShu')begin
UPDATE    Stock
SET        Stock_quantity=Stock_quantity+@yaorukushu
where Repertory_enter_detail_id=@Repertory_enter_detail_idend--审核修改审核人和审核时间if(@NB='ShenHeInsertAuditorAndReviewTime')beginbegin tran
UPDATE    Repertory_enter
SET              Auditor_id =@Auditor_id, Review_time =@Review_time, Review_deny ='true'
where Repertory_enter_id=@Repertory_enter_id
UPDATE    Goods_indent
SET              Indent_status_pubid =110
where  Indent_id=(SELECT Indent_id FROM Repertory_enter where Repertory_enter_id=@Repertory_enter_id)commit tranend--审核查询子进仓明细if(@NB='ShenHeSelectChildJinCangMingXi')beginSELECT case when sum(Repertory_enter_quantity+Giveaway_quantity)IS null then 0else sum(Repertory_enter_quantity+Giveaway_quantity)end
FROM         Repertory_enter_detail
where Repertory_enter_detail_Farid=@Repertory_enter_detail_Faridend--查询未审核进仓所有明细
if(@NB='NoShenHeJinCangMingXi')
begin
SELECT      Repertory_enter_detail_id
FROM         Repertory_enter_detail
where Repertory_enter_id=@Repertory_enter_id and Review_deny='false'
end
--审核修改商品订单状态为“已进货”
end

   仅供初学者使用,禁止商业用途。

人生是个圆,有的人走了一辈子也没有走出命运画出的圆圈,其实,圆上的每一个点都有一条腾飞的切线。

不要拿小人的错误来惩罚自己,不要在这些微不足道的事情上折磨浪费自己的宝贵时间。

学得到东西的事情是锻炼,学不到的是磨练。