MVC大型商贸系统(库存管理)技术解释(五) 销售部门调整

来源:互联网 发布:自然灾害数据查询 编辑:程序博客网 时间:2024/05/21 14:42

MVC大型商贸系统(库存管理)技术解释(五) 销售部门调整

1、  界面效果:




2、  代码:

2.1 销售部门调整处理:HTML代码:

<!DOCTYPE html><html><head>    <meta content="text/javascript;charset=utf-8" />    <title>XiaoShouBuMenTiaoZheng</title>    <link href="../../Content/yxsss/js_css/yu.css" rel="stylesheet" />    <script src="../../Content/yxsss/js_css/yu.js"></script>    <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/jquery-easyui-1.3.3/themes/default/easyui.css" rel="stylesheet" />    <link href="../../Content/MyCSS/DealWithSalesDepartmentAdjust.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="../../Scripts/MyScript/DealWithSalesDepartmentAdjust.js"></script></head><body onload="AddRunningDiv();" style="text-align: center">    <div style="display: none">        <div class="easyui-window" id="wRecord_number" title="销售部门记录编号" style="width: 434px; height: 246px; top: 75px; left: 90px; overflow: hidden" data-options="closed:true,maximizable:false,minimizable:false,modal:true">            <table style="width: 420px; border: none; padding: 0; border-spacing: 0;">                <tr>                    <td style="vertical-align: middle">按编号查询:                        <input type="text" id="txtRecord_number" style="width: 100px;" /></td>                    <td style="vertical-align: middle">                        <button onclick="selectAllotByBlur();">                            模糊查询</button></td>                    <td>审核<input id="check1" name="name" value="1" type="checkbox" />启动<input id="check2" name="name" value="2" type="checkbox" /></td>                </tr>            </table>            <div class="easyui-panel" style="width: 420px; height: 182px; border: none;">                <table class="easyui-datagrid" id="tbJiLuBianHao" style="width: 370px; border: none; border-spacing: 0;" data-options="fit:true,idField:'Sales_department_adjustment_id',             singleSelect:true,rownumbers:true,striped:true,onDblClickRow:onTbJiLuBianHaoDblClick">                    <thead>                        <tr>                            <th data-options="field:'Record_number',width:120,align:'center'">记录编号</th>                            <th data-options="field:'New_department',width:90,align:'center'">新部门</th>                            <th data-options="field:'Reinstated_department',width:90,align:'center'">原部门</th>                            <th data-options="field:'Plan_start_time',width:110,align:'center'">计划启动时间</th>                            <th data-options="field:'Reinstated_department_id',hidden:true"></th>                            <th data-options="field:'New_department_id',hidden:true"></th>                            <th data-options="field:'Register_time',hidden:true"></th>                            <th data-options="field:'Registrant_id',hidden:true"></th>                            <th data-options="field:'Auditor_id',hidden:true"></th>                        </tr>                    </thead>                </table>            </div>        </div>        <div class="easyui-window" id="wBuMenTiaoZheng" title="" style="display: none; text-align: center; border-spacing: 0; padding: 0; border: 0 solid white; overflow: hidden;"            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: 0; background: #e0ffff; color: #4169e1; font-size: 19px; text-align: center; margin: 0 0 auto;">                <span style="float: right">                    <img onclick="parent.allot();" id="dimg" src="../../Content/image/delete.png" /></span>销售部门调整处理            </div>            <div class="qq" style="margin: 0 1px 0 1px; height: 130px; text-align: left; padding: 10px;">                <button id="btnJiLuBianHao" onclick="openjiLuBianHao(1);" style="background-color: #e0ffff; height: 20px; font-size: 10px;">记录编号:</button>                <input type="text" id="Record_number" style="border-color: #ccc; color: red; width: 120px; text-align: center" readonly="readonly" />                                                                                                  计划启动时间:<input id="dtmStartoverTime" class="easyui-datetimebox" data-options="formatter:myformatter,required:true,missingMessage:'请选择计划启动时间!'" />                <br />                 新 部 门:  <input class="easyui-combotree" id="cboNewDepartMent" data-options="required:true,missingMessage:'请选择新部门!',onChange:onChangeNewDepartment" style="width: 150px;" />                <input id="txtNewDepartment" style="border-style: none none solid none; border-color: #ccc; width: 550px; font-size: 15px; color: #0000ff" /><br />                <div style="padding: 1px;"></div>                 原 部 门:  <input class="easyui-combotree" id="cboReinstatedDepartMent" data-options="required:true,missingMessage:'请选择原部门!',onChange:onChangeReinstateDeppartment" style="width: 150px;" />                <input id="txtReinstatedDepartment" style="border-style: none none solid none; border-color: #ccc; width: 550px; font-size: 15px; color: #4169e1" /><br />                <div style="padding: 1px;"></div>                 商品分类:<input class="easyui-combobox" id="cboGoodsClassify" style="width: 150px;" />                <input id="txtGoodsClassify" style="border-style: none none solid none; border-color: #ccc; width: 550px; font-size: 15px; color: #4169e1" /><br />                <div style="padding: 1px;"></div>                 往来单位:<input id="cboSupplyUnits" class="easyui-combobox" />                  商品代码:<input id="txtGoodsCode" type="text" />                    <button onclick="selectGoodsOfReinstatedDepartMentByVariedTerm();" style="height: 20px; font-size: 10px;">                    查  询</button>                 <button onclick="clearSelectItem();" style="height: 20px; font-size: 10px;">                    清空查询条件                </button>                <br />                <div style="padding: 1px;"></div>                   商    标:  <input id="cboGoodsRadeMark" class="easyui-combobox" />                  商品名称:<input id="txtGoodsName" type="text" />                    <button onclick="checkAll();" style="height: 20px; font-size: 10px;">全  选</button>                 <button onclick="uncheckAll();" style="height: 20px; font-size: 10px;">全 不 选</button>            </div>            <div class="easyui-panel" style="width: 854px; height: 310px; border: 1px solid #cccccc; margin-top: 5px;">                <table id="tbGoods" class="easyui-datagrid" style="width: 3415px; border: 1px solid #cccccc" data-options="rownumbers:true,idField:'Goods_id',                fit:true,frozenColumns:[[                     ]],striped:true,fitColumns:true,sortable:true,selectOnCheck:true,checkOnSelect:true">                    <thead>                        <tr>                            <th data-options="field:'check',checkbox:true"></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:'Goods_abbreviation',width:80,align:'center'">商品简称</th>                            <th data-options="field:'Art_No',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:'Stock_quantity',width:80,align:'center'">库存数</th>                        </tr>                    </thead>                </table>            </div>            <table style="text-align: center; width: 800px; height: 60px; border: 0 solid white">                <tr>                    <td style="width: 155px; text-align: right;" id="txtMake_bills">制单人:                    </td>                    <td style="width: 125px; text-align: left;">                        <div class="qq" style="border-bottom: #f5f5f5 1px solid; width: 150px;">                            <input id="cboMakeBills" class="easyui-combobox" data-options="required:true,missingMessage:'请选择制单人!',panelHeight:120,onChange:zhidan" style="width: 150px; border: 3px;" />                        </div>                    </td>                    <td style="width: 90px; text-align: right" id="">审核人:                    </td>                    <td style="width: 165px; text-align: left;">                        <div class="qq1" style="border-bottom: #f5f5f5 1px solid; width: 150px;">                            <input id="cboAuditor" class="easyui-combobox" style="width: 150px;" data-options="panelHeight:120,onChange:shenhe" />                        </div>                    </td>                    <td style="width: 90px; text-align: right" id="">启动人:                    </td>                    <td style="width: 165px; text-align: left;">                        <div class="qq2" style="border-bottom: #f5f5f5 1px solid; width: 150px;">                            <input id="cboStartover" class="easyui-combobox input2" style="width: 150px;" data-options="panelHeight:120,onChange:qidong" />                        </div>                    </td>                </tr>                <tr>                    <td style="width: 155px; text-align: right;" id="txtMake_bills_time">制单时间:                    </td>                    <td>                        <div class="qq" style="border-bottom: #f5f5f5 1px solid; width: 150px;">                            <input class="easyui-datetimebox" id="dtmMakeBills" data-options="formatter:myformatter,required:true,missingMessage:'请选择制单时间!'" style="width: 150px; height: 20px; border: none; color: #0000FF" />                        </div>                    </td>                    <td style="text-align: right;" id="">审核时间:                    </td>                    <td>                        <div class="qq1" style="border-bottom: #f5f5f5 1px solid; width: 150px;">                            <input class="easyui-datetimebox" id="dtmAuditorTime" data-options="formatter:myformatter" style="width: 150px; height: 20px; border: none; color: #0000FF" />                        </div>                    </td>                    <td style="text-align: right;" id="">启动时间:                    </td>                    <td>                        <div class="qq2" style="border-bottom: #f5f5f5 1px solid; width: 150px;">                            <input class="easyui-datetimebox" id="dtmStartoverTime1" data-options="formatter:myformatter" style="width: 150px; height: 20px; border: none; color: #0000FF" />                        </div>                    </td>                </tr>            </table>            <table style="width: 850px;">                <tr>                    <td>                        <div style="width: 85px; height: 25px; text-align: center; vertical-align: middle">                            <button id="TianJia" onclick="addSalesDepartment(); ">                                <img src="../../Content/image/Add-New.png" />                                新增</button>                        </div>                    </td>                    <td>                        <div style="width: 85px; height: 25px; text-align: center; vertical-align: middle">                            <button id="XiuGai" onclick="revise();">                                <img src="../../Content/image/Note-Memo.png" />                                修改</button>                        </div>                    </td>                    <td>                        <div style="width: 85px; height: 25px; text-align: center; vertical-align: middle">                            <button id="ShanChu" onclick="DeleteSalesDepartmentAdjust();">                                <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" onclick="InsertSalesDepartmentAdjustment();">                                <img src="../../Content/image/Save.png" />                                保存                            </button>                        </div>                    </td>                    <td>                        <div style="width: 85px; height: 25px; text-align: center; vertical-align: middle">                            <button id="FanQi" onclick="fangQi();">                                <img src="../../Content/image/Command-Refresh.png" />                                放弃</button>                        </div>                    </td>                    <td>                        <div style="width: 85px; height: 25px; text-align: center; vertical-align: middle">                            <button id="ShenHe" onclick="auditing()">                                <img src="../../Content/image/Principal-02.png" />                                审核</button>                        </div>                    </td>                    <td>                        <div style="width: 85px; height: 25px; text-align: center; vertical-align: middle">                            <button id="QiDong" onclick="startover();">                                <img src="../../Content/image/Thumbs-Up.png" />启动</button>                        </div>                    </td>                    <td>                        <div style="width: 85px; height: 25px; text-align: center; vertical-align: middle">                            <button id="TuiChu" onclick="parent.allot();">                                <img src="../../Content/image/Out.png" />                                退出</button>                        </div>                    </td>                </tr>            </table>        </div>    </div></body></html>

2.2 销售部门调整处理:JavaScript代码:

var editIndex = undefined;$(document).ready(function () {    $("#wBuMenTiaoZheng").show(500);//显示部门调整窗体    bingDingDepartment();    $("#cboGoodsClassify").combobox({        onSelect: function (data) {            $.getJSON("/Allot/GetGoodsClassifyByAttributeGatherDetailId?intAttributeGatherDetailId=" + data.id, function (data3) {//根据商品id查询商品详细                var str2 = [];                getGoodsClassify(data3[0].farid, data3[0].name, data3[0].code, str2);//farId:商品父id,name:商品名称,code:商品代码,str2:空字符串            });        }    });    $.getJSON("/Allot/NewSalesDepartmentRecordNumber", function (value) {        $("#Record_number").val(value.trim());    });});//原部门下拉树的值改变时触发function onChangeReinstateDeppartment(value) {    $.getJSON("/Allot/DepartmentNameSelect?intDeparId=" + value, function (data1) {//根据部门id查询部门所有上级部门拼接部门名称        $('#txtReinstatedDepartment').val(data1);//显示部门名称    });    $.getJSON("/Allot/GetGoodsClassifyOfReinstatedDepartMent?intReinstatedDepartMentId=" + value, function (data2) {        $("#cboGoodsClassify").combobox({ data: data2, valueField: 'id', textField: 'text' });    });//查找该部门下的商品的分类    $.getJSON("/Allot/GetSupplyUnitsOfReinstatedDepartMentGoods?intReinstatedDepartMentId=" + value, function (data3) {        $('#cboSupplyUnits').combobox({ data: data3, valueField: 'id', textField: 'name' });    });//查找该部门下的往来单位    $.getJSON("/Allot/GetGoodsRademarkByReinstatedDepartMentGoods?intReinstatedDepartMentId=" + value, function (data4) {        $('#cboGoodsRadeMark').combobox({ data: data4, valueField: 'id', textField: 'name' });    });//查找该部门下的商品商标    $.getJSON("/allot/DepartmentStaffSelectbyDepartmentId?intDepartmentFarId=" + value, function (data5) {        try {            $("#cboMakeBills").combobox({ data: data5, valueField: 'Employee_id', textField: 'Employee_name' });//绑定制单人下拉框            $("#cboAuditor").combobox({ data: data5, valueField: 'Employee_id', textField: 'Employee_name' });//绑定审核人下拉框            $("#cboStartover").combobox({ data: data5, valueField: 'Employee_id', textField: 'Employee_name' });//绑定启动人下拉框        } catch (e) {        }        if (Registrant_id > 0) {            $("#cboMakeBills").combobox("setValue", Registrant_id);        }        if (AuditorId > 0) {            $("#cboAuditor").combobox("setValue", AuditorId);        }    });    selectGoodsOfReinstatedDepartMentByVariedTerm();//调用方法绑定属于该部门的商品}//新部门下拉树的值改变时触发function onChangeNewDepartment(value) {    $.getJSON("/Allot/DepartmentNameSelect?intDeparId=" + value, function (data) { //根据获取的Id查询部门数据(id,farId,名称)        $('#txtNewDepartment').val(data);    });}//帮定部门function bingDingDepartment() {    $.getJSON("/Allot/GetConsignmentDepartmentAll", function (data) {        $('#cboNewDepartMent').combotree('loadData', data);//绑定新部门下拉树        $('#cboReinstatedDepartMent').combotree('loadData', data);//绑定原部门下拉树    });}//进度款的加载function AddRunningDiv() {    $("<div class=\"datagrid-mask\"></div>").css({ display: "block", width: "100%", height: $(document).height() }).appendTo("body");    $("<div class=\"datagrid-mask-msg\"></div>").html("正在加载,请稍候...").appendTo("body").css({ display: "block", left: ($(document.body).outerWidth(true) - 190) / 2, top: ($(document).height() - 45) / 2 });}//启动function startover() {    n = 1;    c = 1;    var intSalesDepartment = SalesDepartmentAdjustmentId;    if (intSalesDepartment > 0) {        if ($('#cboStartover').combobox('getValue') == '' || $('#dtmStartoverTime1').datetimebox('getValue') == '') {            $("#cboStartover").combobox({ required: true, missingMessage: '请选择启动人!' });//如果启动人还没选择,则设置下拉框的必选属性            $("#dtmStartoverTime1").datetimebox({ required: true, missingMessage: '请选择启动时间!' });//如果启动时间还没选择,则设置下拉框的必选属性            $(".qq2 input").mouseover();//设置鼠标经过时事件,以触发combobox检测是否已选择        } else {            $.getJSON("/Allot/StartoverSalesDepartment?intSalesDepartment=" + intSalesDepartment +               "&intStartover=" + $("#cboStartover").combobox('getValue') +               "&dtmStartoverTime=" + $("#dtmStartoverTime1").datetimebox('getValue'), function (data) {                   if (data > 0) {                       ui.success("启动成功!", 1000, false);                       refreshAfterDelete();//启动后清空所有控件                   }               });        }    } else {        $("#check2").prop('checked', true);//如果销售部门还没选中        openjiLuBianHao(2);//调用方法查询已审核部分的部门销售调整单,并打开部门调整单选择窗体        parent.document.getElementById("labTips").innerHTML = "<ol type='1'><li style='font-size:15px;margin-left:1px;'> 请选择要启动的调整单!</li></ol>";    }}//审核function auditing() {    n = 1;    var intSalesDepartment = SalesDepartmentAdjustmentId;    if (intSalesDepartment > 0) {        if ($('#cboAuditor').combobox('getValue') == '' || $('#dtmAuditorTime').datetimebox('getValue') == '') {            $("#cboAuditor").combobox({ required: true, missingMessage: '请选择审核人!' });//如果审核人还没选择,则设置下拉框的必选属性            $("#dtmAuditorTime").datetimebox({ required: true, missingMessage: '请选择审核时间!' });//如果审核时间还没选择,则设置下拉框的必选属性            $(".qq1 input").mouseover();//设置鼠标经过时事件,以触发combobox检测是否已选择        } else {            $.getJSON("/Allot/AuditingSalesDepartment?intSalesDepartment=" + intSalesDepartment +                "&intAuditor=" + $("#cboAuditor").combobox('getValue') +                "&dtmAuditorTime=" + $("#dtmAuditorTime").datetimebox('getValue'), function (data) {                    if (data == "false") {                        ui.alert("此调整单已审核,不能重复审核", 1000, false);                    } else if (data > 0) {                        ui.success("审核成功!", 1000, false);                        refreshAfterDelete();//调用方法清空数据                        $.getJSON("/Allot/NewSalesDepartmentRecordNumber", function (value) {                            $("#Record_number").val(value.trim());                        });                    }                });        }    } else {        openjiLuBianHao(1);        $("#check1").attr('checked', true);//设置checkbox选中        $("#check2").prop('checked', false);//设置checkbox不选中        parent.document.getElementById("labTips").innerHTML = "<ol type='1'><li style='font-size:15px;margin-left:1px;'>请选择要审核的调整单!</li></ol>";    }}//审核修改后的刷新function refreshAfterXiuGai(salesDepartmentId) {    $("#tbGoods").datagrid('loadData', { total: 0, rows: [] });//清空datagrid    $.getJSON("/Allot/GetSalesDepartmentAdjustment?intSalesDepartmentAdjustmentId=" + salesDepartmentId, function (data) {//绑定销售部门调整        $("#Record_number").val(data[0].Record_number.trim());        $("#dtmStartoverTime").datetimebox("setValue", data[0].Plan_start_time);        $("#cboNewDepartMent").combotree("setValue", data[0].New_department_id);        $("#cboReinstatedDepartMent").combotree("setValue", data[0].Reinstated_department_id);        $("#cboMakeBills").combobox("setValue", data[0].Registrant_id);        $("#cboReinstatedDepartMent").datetimebox("setValue", data[0].Register_time);    });    selectGoodsOfReinstatedDepartMentByVariedTerm();//调用方法绑定调整明细}//点击修改function revise() {    n = 1;    if ($("#cboNewDepartMent").combotree('getValue') > 0) {//判断新部门是否已选择        ui.confirm("确定要放弃当前编辑?", function (k) {            if (k) {                openjiLuBianHao(1);            }        });    } else {        openjiLuBianHao(1);    }}//清空查询条件function clearSelectItem() {    $("#cboGoodsClassify").combobox("clear");    $("#cboSupplyUnits").combobox("clear");    $("#cboGoodsRadeMark").combobox("clear");    $("#txtGoodsCode").val("");    $("#txtGoodsName").val("");    $("#txtGoodsClassify").val("");}//清空所有控件的数据function refreshAfterDelete() {    $("#Record_number").val("");    $("#dtmStartoverTime").datetimebox("clear");    $("#cboNewDepartMent").combotree("clear");    $("#cboReinstatedDepartMent").combotree("clear");    $("#cboGoodsClassify").combobox("clear");    $("#cboSupplyUnits").combobox("clear");    $("#txtGoodsCode").val("");    $("#cboGoodsRadeMark").combobox("clear");    $("#txtGoodsName").val("");    $("#txtGoodsCode").val("");    $("#txtNewDepartment").val("");    $("#txtReinstatedDepartment").val("");    $("#cboMakeBills").combobox("clear");    $("#dtmMakeBills").datetimebox("clear");    $("#tbGoods").datagrid('loadData', { total: 0, rows: [] });    Reinstated_department_id = 0;    Registrant_id = 0;    SalesDepartmentAdjustmentId = 0;    $("#cboAuditor").combobox({ required: false });    $("#dtmAuditorTime").datetimebox({ required: false });    $("#cboStartover").combobox({ required: false });    $("#dtmStartoverTime1").datetimebox({ required: false });}        //删除后的刷新//删除销售部门function DeleteSalesDepartmentAdjust() {    var salesDepartmentAdjustid = SalesDepartmentAdjustmentId;    if (salesDepartmentAdjustid > 0) {        ui.confirm('确定删除?', function (r) {            if (r) {                $.getJSON("/Allot/DeleteSalesDepartmentAdjustDetail?intSalesDepartmentAdjustmentId=" + salesDepartmentAdjustid, function (data) {                    if (data > 0) {                        ui.success('删除成功!', 1000, false);                        refreshAfterDelete();                    } else {                        ui.error('删除失败!', 1000, false);                    }                });            }        });    } else {        ui.error("未选择部门调整单!", 1000, false);    }}//双击记录编号窗体var Registrant_id = 0;var SalesDepartmentAdjustmentId = 0;var Reinstated_department_id = 0;var AuditorId = 0;function onTbJiLuBianHaoDblClick(rowIndex, rowData) {    n = 1;    AuditorId = rowData.Auditor_id;    Registrant_id = rowData.Registrant_id;    SalesDepartmentAdjustmentId = rowData.Sales_department_adjustment_id;    Reinstated_department_id = rowData.Reinstated_department_id;    $("#Record_number").val(rowData.Record_number.trim());    $("#cboNewDepartMent").combotree("setValue", rowData.New_department_id);    $("#cboReinstatedDepartMent").combotree("setValue", rowData.Reinstated_department_id);    $("#dtmStartoverTime").datetimebox("setValue", rowData.Plan_start_time);    $("#dtmMakeBills").datetimebox("setValue", rowData.Register_time);    $("#dtmAuditorTime").datetimebox("setValue", rowData.Review_time);    $("#wRecord_number").window("close");    $("#tbGoods").datagrid('uncheckAll');//将datagrid全部设置为未选中}// 绑定销售部门调整明细function bindingSalesDepartmentAdjustDetail(salesDepartmentAdjustmentId) {    $.getJSON("/Allot/BindingSalesDepartmentAdjustDetail?intSalesDepartmentAdjustmentId=" + salesDepartmentAdjustmentId, function (data) {        if (data != "") {            var rows = $("#tbGoods").datagrid('getRows');//获取datagrid中的商品            for (var i = 0; i < rows.length; i++) {//遍历获取到的商品                for (var j = 0; j < data.length; j++) {//遍历查询出来的已添加销售部门调整明细的商品                    if (rows[i].Goods_id == data[j].Goods_id) {//如果是销售部门调整明细中的明细的值                        $("#tbGoods").datagrid('checkRow', i);//选择该行                    }                }            }        } else {            $("#tbGoods").datagrid('uncheckAll');//如果返回没有数据就全部不选中        }    });}//打开记录编号查询,并根据k的值的不同而执行不同的方法,分别查询“未审核未启动”,“已审核未启动”,“既审核又启动”的方法function openjiLuBianHao(k) {    $("#tbJiLuBianHao").datagrid({ url: "/Allot/GetAllSalesDepartment?type=" + k });    $("#wRecord_number").window("open");}//验漏function checkLost() {    parent.document.getElementById("labTips").innerHTML = "";    if ($('#Record_number').val() == '' || $('#cboNewDepartMent').combotree('getValue') == '' ||        $('#cboReinstatedDepartMent').combotree('getValue') == '' || $('#dtmStartoverTime').datetimebox('getValue') == '' ||        $('#cboMakeBills').combobox('getValue') == '' || $('#dtmMakeBills').datetimebox('getValue') == '') {//检查必选项是否已选择        if ($('#Record_number').val() == '') {            $('#Record_number').css('border-color', 'red');        } else {            $('#Record_number').css('border-color', '#ccc');        }        if ($('#cboNewDepartMent').combobox('getValue') == '' || $('#cboReinstatedDepartMent').combotree('getValue') == ''            || $('#cboMakeBills').combobox('getValue') == '' || $('#dtmMakeBills').datetimebox('getValue') == ''            || $('#dtmStartoverTime').datetimebox('getValue') == '') {            $(".qq input").mouseover();//如果是下拉框或者日期框未选中,通过设置鼠标经过事件触发提示        }        return false;    } else if ($('#tbGoods').datagrid('getChecked').length > 0) {        $('#Record_number').css('border-color', '#ccc');        return true;    } else {        parent.document.getElementById("labTips").innerHTML = "";        parent.document.getElementById("labTips").innerHTML = "<ol type='1'><li style='font-size:15px;margin-left:1px;'> 未选择要调整的商品!</li></ol>";        return false;    }}//保存修改/新增function InsertSalesDepartmentAdjustment() {    var departmentId = SalesDepartmentAdjustmentId;    if (checkLost()) {//检漏通过才执行        if ($("#cboNewDepartMent").combotree("getValue") != $("#cboReinstatedDepartMent").combotree("getValue")) {            if (departmentId) {                ui.confirm('确定修改?', function (r) {                    if (r) {                        UpdateSalesDepartmentAdjustment(departmentId);                    }                });            } else {                ui.confirm('确定新增?', function (r) {                    if (r) {                        InsertSalesDepartmentAdjustment1();                    }                });            }        } else {            ui.alert("同一部门间不能进行商品销售权转移!");        }    }}//修改销售部门调整function UpdateSalesDepartmentAdjustment(departmentId) {    $("#tbGoods").datagrid('loadData', { total: 0, rows: [] });    var recordNumber = $("#Record_number").val();    var cboNewDepartMent = $("#cboNewDepartMent").combotree('getValue');    var cboReinstatedDepartment = $("#cboReinstatedDepartMent").combotree('getValue');    var dtmStartoverTime = $("#dtmStartoverTime").datetimebox('getValue');    var cboMakeBills = $("#cboMakeBills").combobox('getValue');    var dtmMakeBills = $("#dtmMakeBills").datetimebox('getValue');    var count = 0;    $.getJSON("/Allot/UpdateSalesDepartmentAdjustment?" +        "strRecordNumber=" + recordNumber +        "&intNewDepartMent=" + cboNewDepartMent +        "&intReinstatedDepartment=" + cboReinstatedDepartment +        "&dtmStartoverTime=" + dtmStartoverTime +        "&intMakeBills=" + cboMakeBills +        "&dtmMakeBills=" + dtmMakeBills +        "&inttSalesDepartmentAdjustmentId=" + departmentId, function (data) {            if (data == "false") {                ui.alert("已审核,不能修改!");                refreshAfterXiuGai(SalesDepartmentAdjustmentId);            } else {                var intSalesDepartmentAdjustmentid = SalesDepartmentAdjustmentId;                var rows = $("#tbGoods").datagrid('getChecked');                for (var i = 0; i < rows.length; i++) {                    $.getJSON("/Allot/InsertSalesDepartmentAdjustDetail?" +                        "intSalesDepartmentAdjustmentid=" + intSalesDepartmentAdjustmentid +                        "&intGoodsId=" + rows[i].Goods_id +                        "&decStockQuantity=" + rows[i].Stock_quantity);                    count++;                }                if (data > 0 && count == rows.length) {                    var myDate = new Date();                    parent.document.getElementById("labTips").innerHTML = "<ol type='1'><li style='font-size:15px;margin-left:1px;'> 修改成功!\r" + myDate + "</li></ol>";                    refreshAfterXiuGai(intSalesDepartmentAdjustmentid);                } else {                    ui.success("修改成功!", 1000, false);                    refreshAfterXiuGai(intSalesDepartmentAdjustmentid);                }            }        });}//新增销售部门调整function InsertSalesDepartmentAdjustment1() {    var recordNumber = $("#Record_number").val();    var cboNewDepartMent = $("#cboNewDepartMent").combotree('getValue');    var cboReinstatedDepartment = $("#cboReinstatedDepartMent").combotree('getValue');    var dtmStartoverTime = $("#dtmStartoverTime").datetimebox('getValue');    var cboMakeBills = $("#cboMakeBills").combobox('getValue');    var dtmMakeBills = $("#dtmMakeBills").datetimebox('getValue');    $.getJSON("/Allot/InsertSalesDepartmentAdjustment?" +        "strRecordNumber=" + recordNumber +        "&intNewDepartMent=" + cboNewDepartMent +        "&intReinstatedDepartment=" + cboReinstatedDepartment +        "&dtmStartoverTime=" + dtmStartoverTime +        "&intMakeBills=" + cboMakeBills +        "&dtmMakeBills=" + dtmMakeBills, function (data) {            var intSalesDepartmentAdjustmentid = data;            var rows = $("#tbGoods").datagrid('getChecked');            for (var j = 0; j < rows.length; j++) {                $.getJSON("/Allot/InsertSalesDepartmentAdjustDetail?" +                    "intSalesDepartmentAdjustmentid=" + intSalesDepartmentAdjustmentid +                    "&intGoodsId=" + rows[j].Goods_id +                    "&decStockQuantity=" + rows[j].Stock_quantity);            }            if (data > 0) {                ui.success("新增成功!", 1000, false);                refreshAfterDelete();                setTimeout("addSalesDepartment();", 100);            } else {                ui.success("新增失败!", 1000, false);            }        });}//全选function checkAll() {    $("#tbGoods").datagrid('checkAll');}//全不选function uncheckAll() {    $("#tbGoods").datagrid('uncheckAll');}//不定条件查询原部门商品function selectGoodsOfReinstatedDepartMentByVariedTerm() {    var id = SalesDepartmentAdjustmentId;    var departmentid2 = Reinstated_department_id;    var cboGoodsClassify = $("#cboGoodsClassify").combobox('getValue');    var cboSupplyUnits = $("#cboSupplyUnits").combobox('getValue');    var cboGoodsRadeMark = $("#cboGoodsRadeMark").combobox('getValue');    var txtGoodsCode = $("#txtGoodsCode").val();    var txtGoodsName = $("#txtGoodsName").val();    var cboReinstatedDepartMent = $("#cboReinstatedDepartMent").combobox('getValue');    $.getJSON("/Allot/SelectGoodsOfReinstatedDepartMentByVariedTerm?" +        "intGoodsClassify=" + cboGoodsClassify +        "&intSupplyUnits=" + cboSupplyUnits +        "&intGoodsRadeMark=" + cboGoodsRadeMark +        "&strGoodsCode=" + txtGoodsCode +        "&strGoodsName=" + txtGoodsName +        "&intReinstatedDepartMentId=" + cboReinstatedDepartMent, function (data) {            $("#tbGoods").datagrid('loadData', data);            if (id > 0 && departmentid2 > 0) {                bindingSalesDepartmentAdjustDetail(id);            } else {                $("#tbGoods").datagrid('uncheckAll');            }        });}function getGoodsClassify(farid, name, code, str) {//farId:商品父id,name:商品名称,code:商品代码,str2:空字符串    if (farid > 0) {//如果        $.getJSON("/Allot/GetGoodsClassifyByAttributeGatherDetailId?intAttributeGatherDetailId=" + farid, function (data) {            str.unshift(data[0].name); //将商品分类名称累加到数组上            if (data[0].farid >= 0) { //当查出来的商品分类还有父id>0的时候,重新调用本方法,直到父id=0;                getGoodsClassify(data[0].farid, name, code, str);            }        });    } else {        var str2 = ""; //声明另一个变量,        for (var i = 0; i < str.length; i++) {            str2 += str[i].trim() + "→"; //for循环获取商品分类名称并拼接一个"→"        }        $('#txtGoodsClassify').val(str2 + name.trim() + "(" + code.trim() + ")");//在最后的一个商品名称后加上商品代码    }} //商品分类//点击新增function addSalesDepartment() {    n = 0;    a = 1;    if ($("#cboNewDepartMent").combotree('getValue') > 0) {        ui.confirm("是否放弃当前单的编辑?", function (k) {            if (k) {                refreshAfterDelete();                $.getJSON("/Allot/NewSalesDepartmentRecordNumber", function (value) {                    $("#wRecord_number").window("close");                    $("#Record_number").val(value.trim());                });            }        });    } else {        refreshAfterDelete();        $.getJSON("/Allot/NewSalesDepartmentRecordNumber", function (value) {            $("#wRecord_number").window("close");            $("#Record_number").val(value.trim());        });    }}//日期格式化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 + "-" + f(m) + "-" + f(d) + " " + f(h) + ":" + f(min) + ":" + f(s);}function f(k) {//如果传入的数小于10则在前面加‘0’    return (k < 10 ? ('0' + k) : k);}//获取系统时间function getDateTime() {    var date = new 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();    var time = y + "-" + f(m) + "-" + f(d) + " " + f(h) + ":" + f(min) + ":" + f(s);    return time;}function f(k) {    return (k < 10 ? ('0' + k) : k);}var n = null;var a = 0;var b = 0;var c = 0;//制单时间function zhidan() {    if (n == 1) {        if (a > 0) {            $("#dtmMakeBills").datetimebox("setValue", getDateTime());        } else {            a++;        }    } else {        $("#dtmMakeBills").datetimebox("setValue", getDateTime());    }}//审核时间function shenhe() {    if (n == 1) {        if (b > 0) {            $("#dtmAuditorTime").datetimebox("setValue", getDateTime());        } else {            b++;        }    } else {        $("#dtmAuditorTime").datetimebox("setValue", getDateTime());    }}//启动时间function qidong() {    if (n == 1) {        if (c > 0) {            $("#dtmStartoverTime1").datetimebox("setValue", getDateTime());        } else {            c++;        }    } else {        $("#dtmStartoverTime1").datetimebox("setValue", getDateTime());    }}//点击放弃function fangQi() {    if (SalesDepartmentAdjustmentId > 0) {        ui.confirm("确定放弃修改?", function (k) {            if (k) {                refreshAfterXiuGai(SalesDepartmentAdjustmentId);            }        });    } else {        ui.confirm("确定放弃新增?", function (k) {            if (k) {                refreshAfterDelete();                $.getJSON("/Allot/NewSalesDepartmentRecordNumber", function (value) {                    $("#wRecord_number").window("close");                    $("#Record_number").val(value.trim());                });            }        });    }}

2.3 销售部门调整查询:HTML代码:

<!DOCTYPE html><html><head>    <meta content="text/javascript;charset=utf-8" />    <title>SelectSalesDepartmentAdjust</title>    <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/jquery-easyui-1.3.3/themes/default/easyui.css" rel="stylesheet" />    <link href="../../Content/MyCSS/SelectSalesDepartmentAdjust.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="../../Scripts/MyScript/SelectSalesDepartmentAdjust.js"></script>    <style type="text/css">        .easyui-datebox, .easyui-combotree, #txtRecordNumber { width: 140px; }        td { text-align: center; }    </style></head><body onload="AddRunningDiv();" style="text-align: center">    <div style="display: none">        <div class="easyui-window" id="wBuMenTiaoZheng" title="" style="display: none; text-align: center; border-spacing: 0; padding: 0; border: 0 solid white; overflow: hidden;"            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: 0; background: #e0ffff; color: #4169e1; font-size: 20px; text-align: center; margin: 0 0 auto;">                <span style="float: right">                    <img onclick="parent.allot();" id="dimg" src="../../Content/image/delete.png" /></span>销售部门调整查询            </div>            <fieldset style="height: 60px; margin: 0 0 0 0; text-align: left; padding-left: 10px; overflow: hidden">                <legend style="text-align: left; color: SlateBlue">不定项查询条件</legend>                <table class="table1" style="border: none; margin: 0 0 0 0; padding: 0; width: 840px;">                    <tr>                        <td style="width: 100px;">记录编号:</td>                        <td style="width: 150px;">                            <input type="text" id="txtRecordNumber" />                        </td>                        <td style="width: 100px;">原 部 门:</td>                        <td style="width: 150px;">                            <input class="easyui-combotree" id="cobReinstated_department" /></td>                        <td>新 部 门:</td>                        <td>                            <input class="easyui-combotree" id="cboNew_department" /></td>                    </tr>                    <tr>                        <td>启动时间(始):</td>                        <td>                            <input class="easyui-datebox" id="dtmStart" />                        </td>                        <td>启动时间(终):</td>                        <td>                            <input class="easyui-datebox" id="dtmEnd" />                        </td>                        <td colspan="2">审核否:<input type="checkbox" id="chbAuditingDeny" checked="checked " />                            启动否<input type="checkbox" id="chbStartoverDeny" />                            <button style="margin: 0" onclick="selectSalseDepartment();">                                查询                            </button>                            <button style="margin: 0" onclick="refurbish();">                                刷新                            </button>                        </td>                    </tr>                </table>            </fieldset>            <div style="width: 350px; height: 222px; float: left">                <table id="tbSalesDepartment" class="easyui-datagrid" title="部门调整单" style="width: 350px; height: 222px; border: none"                    data-options="singleSelect:true,onClickRow:getSalesDepartmentDetails">                    <thead>                        <tr>                            <th data-options="field:'Record_number',width:100,align:'center'">记录编号</th>                            <th data-options="field:'Reinstated_department',width:90,align:'center'">原部门</th>                            <th data-options="field:'New_department',width:90,align:'center'">新部门</th>                            <th data-options="field:'Plan_start_time',width:130,align:'center'">计划启动时间</th>                            <th data-options="field:'Sales_department_adjustment_id',hidden:true"></th>                            <th data-options="field:'Review_deny',hidden:true"></th>                            <th data-options="field:'Rtartover',hidden:true"></th>                        </tr>                    </thead>                </table>            </div>            <div style="margin: auto 0 auto 350px; height: 222px;">                <div class="li2" style="width: 250px; height: 222px; float: right; border: 1px solid white">                    <ul style="text-align: left; border: 1px solid white">                        <li>审 核 人:<input type="text" id="lstAuditor" style="border-style: none none solid none" readonly="readonly" /></li>                        <li>审核时间:<input type="text" id="lstReview_time" style="border-style: none none solid none" readonly="readonly" /></li>                        <li>启 动 人:<input type="text" id="lstStartover_people" style="border-style: none none solid none;" readonly="readonly" /></li>                        <li>启动时间:<input type="text" id="lstStartover_time" style="border-style: none none solid none;" readonly="readonly" /></li>                    </ul>                </div>                <div class="li1" style="width: 250px; height: 222px; border: 1px #ccc dotted">                    <ul style="text-align: left; border: 1px solid white">                        <li>原 部 门:<input type="text" id="lstReinstated_department" style="border-style: none none solid none" readonly="readonly" /></li>                        <li>新 部 门:<input type="text" id="lstNew_department" style="border-style: none none solid none" readonly="readonly" /></li>                        <li>制 单 人:<input type="text" id="lstRegistrant" style="border-style: none none solid none;" readonly="readonly" /></li>                        <li>制单时间:<input type="text" id="lstRegister_time" style="border-style: none none solid none;" readonly="readonly" /></li>                    </ul>                </div>            </div>            <div style="width: 854px; height: 262px;">                <table title="部门调整明细" id="tbSalesDepartmentDetails" class="easyui-datagrid" style="margin: 0 auto 0; height: 285px;" data-options="rownumbers:true,fit:true,singleSelect:true,                idField:'Sales_department_adjust_detail_id',rowNumber:true">                    <thead>                        <tr>                            <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:70,align:'center'">商品名称</th>                            <th data-options="field:'Goods_abbreviation',width:70,align:'center'">商品简称</th>                            <th data-options="field:'Art_No',width:80,align:'center'">货号</th>                            <th data-options="field:'Retail_unit_price',width:70,align:'center'">零售单价</th>                            <th data-options="field:'InputTax',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:'Stock_quantity',width:80,align:'center'">库存数</th>                        </tr>                    </thead>                </table>            </div>        </div>    </div></body></html>

2.4 销售部门调整查询:JavaScript代码:

$(document).ready(    function () {        $("#wBuMenTiaoZheng").hide();        $("#wBuMenTiaoZheng").show(500);        $.getJSON("/Allot/GetConsignmentDepartmentAll", function (data) {            $('#cboNew_department').combotree('loadData', data);//绑定新部门            $('#cobReinstated_department').combotree('loadData', data);//绑定原部门            setTimeout("selectSalseDepartment();", 100);        });    });//进度框function AddRunningDiv() {    $("<div class=\"datagrid-mask\"></div>").css({ display: "block", width: "100%", height: $(document).height() }).appendTo("body");    $("<div class=\"datagrid-mask-msg\"></div>").html("正在加载,请稍候...").appendTo("body").css({ display: "block", left: ($(document.body).outerWidth(true) - 190) / 2, top: ($(document).height() - 45) / 2 });}//获取销售部门调整明细function getSalesDepartmentDetails(rowIndex, rowData) {    var intSalesDepartment = rowData.Sales_department_adjustment_id;    var bolAuditingDeny = rowData.Review_deny;    var bolStartoverDeny = rowData.Rtartover;    $.getJSON("/Allot/GetSalesDepartmentMessager?intSalesDepartment=" + intSalesDepartment        + "&bolAuditingDeny=" + bolAuditingDeny        + "&bolStartoverDeny=" + bolStartoverDeny, function (data) {            $("#lstRegistrant").val(data[0].Registrant);            $("#lstRegister_time").val(data[0].Register_time);            $("#lstAuditor").val(data[0].Auditor);            $("#lstReview_time").val(data[0].Review_time);            $("#lstReinstated_department").val(data[0].Reinstated_department);            $("#lstNew_department").val(data[0].New_department);            $("#lstStartover_people").val(data[0].Startover_people);            $("#lstStartover_time").val(data[0].Startover_time);        });    $.getJSON("/Allot/GetSalesDepartmentDetails?intSalesDepartment=" + rowData.Sales_department_adjustment_id, function (data) {        $("#tbSalesDepartmentDetails").datagrid("loadData", data);    });}//清空控件数据function refurbish() {    $("#txtRecordNumber").val("");    $("#cobReinstated_department").combotree("clear");    $("#cboNew_department").combotree("clear");    $("#dtmStart").datebox("clear");    $("#dtmEnd").datebox("clear");    $("#lstRegistrant").val("");    $("#lstRegister_time").val("");    $("#lstAuditor").val("");    $("#lstReview_time").val("");    $("#lstReinstated_department").val("");    $("#lstNew_department").val("");    $("#lstStartover_people").val("");    $("#lstStartover_time").val("");    $("#tbSalesDepartment").datagrid("loadData", { total: 0, rows: [] });    $("#tbSalesDepartmentDetails").datagrid("loadData", { total: 0, rows: [] });}//不定条件查询销售部门调整单function selectSalseDepartment() {    var strRecordNumber = $("#txtRecordNumber").val();    var intConsignmentDepartment = $("#cobReinstated_department").combobox('getValue');    var intNewDepartment = $("#cboNew_department").combobox('getValue');    var dtmStart = $("#dtmStart").datebox('getValue');    var dtmEnd = $("#dtmEnd").datebox('getValue');    var bolAuditingDeny = document.getElementById("chbAuditingDeny").checked;    var bolStartoverDeny = document.getElementById("chbStartoverDeny").checked;    $.getJSON("/Allot/SelectSalesDepartmetAjustmentWithTrends?" +        "&strRecordNumber=" + strRecordNumber +        "&intConsignmentDepartment=" + intConsignmentDepartment +        "&intNewDepartment=" + intNewDepartment +        "&dtmStart=" + dtmStart +        "&dtmEnd=" + dtmEnd +        "&bolAuditingDeny=" + bolAuditingDeny +        "&bolStartoverDeny=" + bolStartoverDeny, function (data) {            if (data != "") {                $("#tbSalesDepartment").datagrid("loadData", data);            } else {                $("#lstRegistrant").val("");                $("#lstRegister_time").val("");                $("#lstAuditor").val("");                $("#lstReview_time").val("");                $("#lstReinstated_department").val("");                $("#lstNew_department").val("");                $("#lstStartover_people").val("");                $("#lstStartover_time").val("");                $("#tbSalesDepartment").datagrid("loadData", { total: 0, rows: [] });                $("#tbSalesDepartmentDetails").datagrid("loadData", { total: 0, rows: [] });            }        });}

2.5 销售部门数据库设计:

用到的主要的表有:调拨表,调拨明细表,库存地点表,商品表,库存表,部门表,员工表:

表名

说明

类型

表编号

Sales_department_adjustment

销售部门调整表

业务表

 表1

Sales_department_adjust_detail

调拨明细表

业务表

表2

Repertory_place

库存地点表

基础表

表3

Stock

库存表

基础表

表4

Goods

商品表

基础表

表5

Department

部门表

基础表

表6

Eemployee

员工表

基础表

表7


列名

数据类型

主键/外键

说明

Sales_department_adjustment_id

Int

主键

 

Reinstated_department_id

Int

外键

‘部门表’,原部门

Plan_start_time

datetime

外键

计划启动时间

Receipts_status_pubid

Int

外键

‘属性明细表’,单据状态

Registrant_id

Int

外键

‘员工表’,登记人

Register_time

datetime

 

登记时间

Auditor_id

Int

外键

‘员工表’,审核人

Review_time

datetime

 

审核时间

Startover_people_id

Int

外键

‘员工表’,启动人

Startover_time

datetime

 

启动时间

Record_number

Nchar(20)

 

记录编号

Review_deny

Bit

 

审核否

Rtartover

Bit

 

启动否

表1、

列名

数据类型

主键/外键

说明

Sales_department_adjust_detail_id

Int

主键

 

Sales_department_adjust_id

Int

外键

‘销售部门调整’,调整单

Goods_id

Int

外键

‘商品表’,商品

Stock_quantity

Decimal(18,3)

 

库存数量

表2、

列名

数据类型

主键/外键

说明

Repertory_place_id

Int

主键

 

Responsible_person_id

Int

外键

‘员工表’,仓管员

Department_id

Int

外键

‘部门表’,部门id

Repertory_place_name

nchar(10)

 

仓库名称

Contact_way

nchar(10)

 

联系方式

Address

nchar(10)

 

仓库地点

Effective_deny

Bit

 

有效否

Remarks

nchar(10)

 

备注

Repertory_place_identifier

nchar(10)

 

仓库代码

表3、

列名

数据类型

主键/外键

说明

Stock_id

Int

主键

 

Repertory_place_id

Int

外键

‘库存地点表’,库存地点

Goods_id

Int

 

‘商品表’,商品

Stock_quantity

Int

 

库存数量

Stock_toplimit

Int

 

库存上限

Stock_floor

Int

 

库存下限

Repertory_enter_detail_id

Int

外键

‘进仓明细表’,进仓明细

表4、

列名

数据类型

主键/外键

说明

Department_id

Int

主键

 

Department_Farid

Int

外键

‘部门表’,部门id

Department_code

nchar(10)

 

部门代码

Department_name

nchar(10)

 

部门名称

表5、

列名

数据类型

主键/外键

说明

Employee_id

Int

主键

 

Employee_number

nchar(12)

 

员工号

Employee_name

nchar(10)

 

员工姓名

Department_id

int

外键

‘部门表’,部门名称

ID_number

nchar(18)

 

身份证号

Duties_id

int

外键

‘职务表’,职务名称

Sex 

bit

 

性别

表6、

列名

数据类型

主键/外键

说明

Goods_id

Int

主键

 

Goods_code

nchar(10)

 

商品代码

Goods_bar_code

nchar(10)

 

条码

Vender_bar_code_deny

Bit

 

厂家条码否

Goods_name

nchar(10)

 

商品名称

Goods_abbreviation

int

外键

商品简称

Plncode_PLN

nchar(10)

 

PLN 码

Copy_record_deny

Bit

 

复制记录否

Goods_tab_pubid

Int

外键

‘属性明细表’,商品标记

Agreement_id

Int

外键

‘合同表’,合同

Manufacturer_id

Int

外键

‘商品厂家’,生产厂家

Producing_area_id

Int

外键

‘产地表’,产地

Art_No

nchar(10)

 

货号

Format_model

nchar(10)

 

规格型号

Unit_of_measurement_pubid

Int

外键

‘属性明细’,计量单位

Use_target_pubid

Int

外键

‘属性明细’,使用对象

Goods_colours

nchar(10)

 

商品花色

Goods_rademark_id

Int

外键

‘商品商标表’,商品商标

Goods_classify_pubid

Int

外键

‘属性明细’,商品分类

Quality_guarantee_period_pubid

Int

外键

‘属性明细’,保质期

Input_ratio

decimal(18, 0)

 

进项税率

Output_ratio

decimal(18, 0)

 

销项税率

Count_scale

nchar(10)

 

统计比例

Quality_content

Int

 

质地含量

Quality_grade_pubid

Int

外键

质量等级

Manage_season_id

Int

外键

‘经营季节表’,经营季节

Permit_decimal_deny

Bit

 

允许小数否

Product_status_pubid

Int

外键

‘属性明细’,产品状态

Registrant_id

Int

外键

‘员工表’,登记人

Register_time

Datetime

 

登记时间

Auditor_id

Int

外键

‘员工表’,审核人

Review_time

Datetime

 

审核时间

Update_person_id

Int

外键

‘员工表‘,更新人

Update_Time

Datetime

 

更新时间

Retail_unit_price

Nchar(10)

 

零售单价

Purchase_bid

nchar(10)

 

采购进价

Self_fix_goods_deny

bit

 

自订货否

Mini_fix_goods_deny

nchar(10)

 

最小订货否

表7、



(注:销售部门调整与商品调拨共用AllotController控制器,BLL层,存储过程,所有业务公用ConvertHelperController,公共部分,此处不再重复附上。)

本教材仅供学习用,禁止用于商业用途!





0 0
原创粉丝点击