WebTM/views/ÏúÊÛ¹ÜÀí/ÏúÊÛ¶©µ¥/Add_Edit_Xs_SeOrderBillList.html
@@ -136,6 +136,15 @@
                                                <input class="layui-input" name="HExRate" id="HExRate" autocomplete="off" value="0" style="background-color: #efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">定金比例%</label>
                                            <div class="layui-input-inline">
                                                <select name="HEarnestRate" id="HEarnestRate" lay-filter="HEarnestRate" style="width: 180px; ">
                                                    <option style="color:blue;" selected="selected" value="50">50%</option>
                                                    <option style="color:blue;" value="100">100%</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
@@ -427,10 +436,10 @@
            get_LoginIs();
            //#region ã€åŠ¨æ€èŽ·å–æ¨¡å—åç§°ã€‘
            var HModuleType = "1401";
            //通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
            var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType);
            $("h1").html('<b>' + HPageTitle + '</b>');
            //var HModuleType = "1401";
            ////通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
            //var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType);
            //$("h1").html('<b>' + HPageTitle + '</b>');
            //#endregion
            //#endregion
@@ -543,7 +552,7 @@
            });
            //#endregion
            //#region å®¡æ ¸æŒ‰é’®
            //#region åå®¡æ ¸æŒ‰é’®
            form.on('submit(set_AbandonCheck)', function (data) {
                set_CheckBill(1);
            });
@@ -715,7 +724,7 @@
                        setSelectHisStockGoodsByTableRender();
                        //设置表头所需金额
                        set_HBillMoney();
                        set_HBillMoney($("#HEarnestRate").val()*1);
                        break;
                    case "HPrice":                                                       //单价
                        //数据格式校验
@@ -770,7 +779,7 @@
                        setSelectHisStockGoodsByTableRender();
                        //设置表头所需金额
                        set_HBillMoney();
                        set_HBillMoney($("#HEarnestRate").val() * 1);
                        break;
                    case "HTaxRate":                                                       //数量
                        //数据格式校验
@@ -825,7 +834,7 @@
                        setSelectHisStockGoodsByTableRender();
                        //设置表头所需金额
                        set_HBillMoney();
                        set_HBillMoney($("#HEarnestRate").val() * 1);
                        break;
                    case "HTaxPrice":                                                       //数量
                        //数据格式校验
@@ -880,7 +889,7 @@
                        setSelectHisStockGoodsByTableRender();
                        //设置表头所需金额
                        set_HBillMoney();
                        set_HBillMoney($("#HEarnestRate").val() * 1);
                        break;
                    default:
                }
@@ -899,17 +908,25 @@
                //#region å¯ç”¨ä½™é¢æç¤ºä¿¡æ¯
                $("#tips-HAvailableBalance").on('click', function (data) {
                    var tips_Message = "可用额度 = å®¢æˆ·ä½™é¢ + ä¿¡ç”¨é¢åº¦ - ï¼ˆæœ¬æœŸé”€å”®è®¢å•总金额 * 0.5)";
                    var tips_Message = "可用额度 = å®¢æˆ·ä½™é¢ + ä¿¡ç”¨é¢åº¦ - ï¼ˆæœ¬æœŸé”€å”®è®¢å•总金额 * å®šé‡‘比例%)";
                    layer.alert(tips_Message, { icon: 0, btn: ['退出'], time: 100000, offset: 't' });
                });
                //#endregion
                //#region éœ€æ±‚金额
                $("#tips-HBillMoney").on('click', function (data) {
                    var tips_Message = "需求金额 = ä»·ç¨Žåˆè®¡ * 0.5";
                    var tips_Message = "需求金额 = ä»·ç¨Žåˆè®¡ * å®šé‡‘比例%";
                    layer.alert(tips_Message, { icon: 0, btn: ['退出'], time: 100000, offset: 't' });
                });
                //#endregion
            });
            //#endregion
            //#region èµ é€æ¯”例下拉列表监听
            form.on('select(HEarnestRate)', function (data) {
                //输入的金额合法,重算折扣后金额
                var HEarnestRate = $("#HEarnestRate").val() * 1;    //定金比例%
                set_HBillMoney(HEarnestRate);
            });
            //#endregion
            //#endregion
@@ -1036,6 +1053,7 @@
                        , { field: '规格型号', title: '规格型号', width: 100, style: 'background-color:#efefef4d;' }
                        , { field: 'HUnitID', title: 'HUnitID', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: '计量单位', title: '计量单位', width: 100, style: 'background-color:#efefef4d;' }//f7
                        , { field: 'HisStockGoods', title: '是否取库存', width: 120, templet: '#HisStockGoods' }
                        , { field: 'HQty', title: '数量', width: 100, totalRow: true, edit: 'text' }
                        , { field: 'HPrice', title: '单价', width: 100, edit: 'text' }
                        , { field: 'HTaxRate', title: '税率', width: 100, edit: 'text' }
@@ -1046,7 +1064,6 @@
                        , { field: 'HCusModel', title: '客户规格型号', width: 100, edit: 'text' }
                        , { field: 'HCusMaterName', title: '客户物料名称', width: 100, edit: 'text' }
                        , { field: 'HDate', title: '交货日期', event: "HDate", width: 120 }
                        , { field: 'HisStockGoods', title: '是否取库存', width: 120, templet: '#HisStockGoods' }
                        , { field: 'HRemark', title: '备注', width: 100, edit: 'text' }
                        , { field: 'HDiscountRate', title: '折扣率', width: 100, edit: 'text', hide: true }
                        , { field: 'HRelTaxPrice', title: '实际含税单价', width: 110, hide: true }
@@ -1110,7 +1127,7 @@
                setSelectHisStockGoodsByTableRender();
                //设置表头所需金额
                set_HBillMoney();
                set_HBillMoney($("#HEarnestRate").val() * 1);
            }
            //#endregion
@@ -1166,6 +1183,7 @@
                                , "HCurID": data.HCurID
                                , "HCurName": data.币别
                                , "HExRate": data.汇率
                                , "HEarnestRate": data.定金比例
                                , "HManagerID": data.HManagerID
                                , "HManagerName": data.主管
                                , "HSellSID": data.HSellSID
@@ -1223,7 +1241,7 @@
                                        "HTaxMoney": result.data[i]["税额"],
                                        "HlineTotal": dealDoubleToFixed(result.data[i]["价税合计"], 2),
                                        "HlineTotalBB": result.data[i]["本位币价税合计"],
                                        "HisStockGoods": result.data[i]["是否取库存"]=="Y"?true:false,
                                        "HisStockGoods": result.data[i]["是否取库存"]=="Y"?"true":"false",
                                        "HDate": formatDate(result.data[i]["交货日期"]),
                                        "HOutStockQty": result.data[i]["出库数量"],
                                        "HInvoiceQty": result.data[i]["开票数量"],
@@ -1246,7 +1264,7 @@
                            setSelectHisStockGoodsByTableRender();
                            //设置表头所需金额
                            set_HBillMoney();
                            set_HBillMoney($("#HEarnestRate").val() * 1);
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
@@ -1760,7 +1778,7 @@
                setSelectHisStockGoodsByTableRender();
                //设置表头所需金额
                set_HBillMoney();
                set_HBillMoney($("#HEarnestRate").val() * 1);
                //rows++;
                layer.msg('增加一行按钮!')
            }
@@ -1787,7 +1805,7 @@
                    setSelectHisStockGoodsByTableRender();
                    //设置表头所需金额
                    set_HBillMoney();
                    set_HBillMoney($("#HEarnestRate").val() * 1);
                } else {
                    layer.msg('请选择一行数据编辑!');
                }
@@ -1817,7 +1835,7 @@
                    setSelectHisStockGoodsByTableRender();
                    //设置表头所需金额
                    set_HBillMoney();
                    set_HBillMoney($("#HEarnestRate").val() * 1);
                }
            }
            //#endregion
@@ -1847,7 +1865,7 @@
                            setSelectHisStockGoodsByTableRender();
                            //设置表头所需金额
                            set_HBillMoney();
                            set_HBillMoney($("#HEarnestRate").val() * 1);
                            break;
                        }
                    }
@@ -1884,7 +1902,7 @@
                            setSelectHisStockGoodsByTableRender();
                            //设置表头所需金额
                            set_HBillMoney();
                            set_HBillMoney($("#HEarnestRate").val() * 1);
                            break;
                        }
                    }
@@ -1915,7 +1933,7 @@
                            setSelectHisStockGoodsByTableRender();
                            //设置表头所需金额
                            set_HBillMoney();
                            set_HBillMoney($("#HEarnestRate").val() * 1);
                            layer.close(index);
                        }
                    });
@@ -1931,6 +1949,8 @@
                $.each(option.data, function (index, value) {
                    if (value.LAY_TABLE_INDEX == dataindex) {
                        value.HisStockGoods = data.value;//把选中下拉框id值赋值给表格缓存
                        //设置表头所需金额
                        set_HBillMoney($("#HEarnestRate").val() * 1);
                    }
                });
            });
@@ -2027,7 +2047,7 @@
                                    setSelectHisStockGoodsByTableRender();
                                    //设置表头所需金额
                                    set_HBillMoney();
                                    set_HBillMoney($("#HEarnestRate").val() * 1);
                                    layer.close(index);//关闭弹窗
                                }
@@ -2310,12 +2330,17 @@
            //#endregion
            //#region è®¾ç½®è¡¨å¤´æ‰€éœ€é‡‘额
            function set_HBillMoney() {
            function set_HBillMoney(HEarnestRate) {
                var HBillMoney = 0;
                for (var i = 0; i < option.data.length; i++) {
                    HBillMoney += option.data[i]["HlineTotal"] * 1;
                    if (option.data[i]["HisStockGoods"] == "false") {
                        HBillMoney += option.data[i]["HlineTotal"] * 1;
                    }
                }
                $("#HBillMoney").val(dealDoubleToFixed(HBillMoney * 0.5, 2));
                HEarnestRate = HEarnestRate * 0.01;
                $("#HBillMoney").val(dealDoubleToFixed(HBillMoney * HEarnestRate, 2));
            }
            //#endregion