123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="renderer" content="webkit|ie-comp|ie-stand">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport"
- content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
- <meta http-equiv="Cache-Control" content="no-siteapp"/>
- <link rel="Bookmark" href="/favicon.ico">
- <link rel="Shortcut Icon" href="/favicon.ico"/>
- <link rel="stylesheet" href="css/ui/common.css">
- <!--<link rel="stylesheet" href="css/ui/style.css">-->
- <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css"/>
- <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css"/>
- <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css"/>
- <link rel="stylesheet" href="css/product-add.css">
- <script src="../js/jquery-2.2.3.min.js"></script>
- <!-- <script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
- <script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
- <script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script>
- <script src="js/product-add.js"></script>
- <script src="js/ui/plupload.full.min.js"></script>
- <script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.config.js"></script>
- <script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.all.min.js"></script>
- <script type="text/javascript" src="lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
- <script src="js/ui/laydate.js"></script> -->
- </head>
- <body>
- <div class="page-container">
- <form class="form form-horizontal" style="position: static;">
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">售价:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input type="text" class="input-text" value="" placeholder="请输入产品售价" id="ProductPrice" onkeyup="check(this)" >
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">拿货成本:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input type="text" class="input-text" value="" placeholder="请输入产品拿货成本:" id="ProductPickingCost" onkeyup="check(this)">
- </div>
- </div>
-
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">快递成本:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input type="text" class="input-text" value="" placeholder="请输入产品快递成本:" id="ProductExpressCost" onkeyup="check(this)">
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">广告成本:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input type="text" id="ProductAdvertisementCost" placeholder="请输入产品广告成本" class="input-text" onkeyup="check(this)">
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">预估签收率 :</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input type="text" id="PredictedYield" placeholder="请输入产品预估签收率" class="input-text">
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">利润率 :</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input type="text" id="ProfitMargin" disabled="disabled" placeholder="产品利润率" class="input-text">
- </div>
- </div>
- <div class="Submission" onclick="Profitestimation()">
- 利润率估算
- </div>
- <textarea name="editorValue" id="ueditor_textarea_editorValue" style="display: none;"></textarea></form>
- </div>
- </body>
- </html>
- <script type="text/javascript">
- Profitestimation = function(){
- var ProductPrice = $("#ProductPrice")[0].value;
- var ProductPickingCost = $("#ProductPickingCost")[0].value;
- var ProductExpressCost = $("#ProductExpressCost")[0].value;
- var ProductAdvertisementCost = $("#ProductAdvertisementCost")[0].value;
- var PredictedYield = $("#PredictedYield")[0].value;
- var regbfb = /^\d+%$/;
- if(ProductPrice == "" ){
- alert("请输入正确的产品售价!");
- }else if(ProductPickingCost == "" ){
- alert("请输入正确的产品拿货成本!");
- }else if(ProductExpressCost == ""){
- alert("请输入正确的产品快递成本!");
- }else if(ProductAdvertisementCost == ""){
- alert("请输入正确的产品广告成本!");
- }else if(PredictedYield == "" || !regbfb.test(PredictedYield)){
- alert("请输入正确的产品预估签收率!");
- }else{
- var Predictedvalue = PredictedYield.replace("%","")/100;
- $("#ProfitMargin")[0].value = Math.floor((Predictedvalue*ProductPrice)-ProductPickingCost-ProductExpressCost-ProductAdvertisementCost)
- }
- }
- function check(e) {
- var re = /[^0-9\.]/g;
- if(re.test(e.value)){
- e.value = "";
- }
- }
- </script>
|