• CRM如何在新增模块中增加产品明细并从其他模块中取数


    一、如何在新增模块中增加产品明细模块并从其他模块中取数

     

    1、新增一个功能模块如:CRM_MODULE_1

    2、打开X:MYOAwebrootgeneralcrmappscrmmodulesCRM_MODULE_1EditView EditView.php,移至最下方,把以下代码粘贴到前</form>,即可!

     CRM如何在新增模块中增加产品明细并从其他模块中取数 - 通达OA二次开发 - 通达OA二次开发

       

    <script src="/static/js/crm/productlist/productlist.js"></script>

    <script src="/static/js/crm/productlist/productrow.js"></script>

    <script src="/static/js/crm/productlist/productcheck.js"></script>

    <script src="/static/js/crm/productlist/handle.js"></script>

     

     

    <script>

    jQuery("<br/><div id='productContainer'></div>").insertAfter(jQuery("#page1_block1"));

    var detailFieldName     = new Array('product_id', 'quantity','price','total');

    var detailFieldLabel    = new Array('产品编码', '数量', '单价','合计');

    var detailFieldWidth    = new Array('15%','10%','10%','10%');

    var detailFieldType     = new Array('PT~M','AMT~M','PC~M','TL~O');

    var detailProdReltFlds  = new Array('product_code:产品编码:15%','product_name:产品名称:15%','product_specification:规格型号:15%','product_measure:计量单位:8%');

     

    var prodRtFld        = "product_id";

    var prodRtFldLabel       = "product_code";

    var prodRtFlds              = "product_code,product_name,product_specification,product_measure,price";

     

    var pList = new productList("prod", true, detailFieldName, detailFieldLabel,

                                                            detailFieldWidth, detailFieldType, detailProdReltFlds);

    document.all("productContainer").innerHTML = pList;

     

          

     

          

           $('#field2').change(function(){//配置说明:field2是字段名称,即哪个文本框内容变化后填充表格

     

            

                         $.ajax({

                                url: "/general/ci/index.php/crm?id="+$(this).val(),//这个是获取数据的后台文件

                                dataType: "JSON",

                                cache: false,

                                success: function(json){

                               

                                 for(var i=0; i<json.length; i++)

                                  {

                                 

                                                    pList.addRow();

     

                                        $("#product_id"+(i+1)).val(json[i].product_id);

                                        $("#product_name"+(i+1)).val(json[i].product_name);

                                        $("#product_code"+(i+1)).val(json[i].product_code);

                                        $("#product_specification"+(i+1)).val(json[i].product_specification);

                                        $("#product_measure"+(i+1)).val(json[i].measure_id);

                                        $("#qty"+(i+1)).val(json[i].qty);

                                        $("#price"+(i+1)).val(json[i].price);

                                  }

     

                                  }

                          });

     

                  });

                 

                         calcTotal();

     

                 

                 

    </script>

     

     

    <input type="hidden" id="selectedRow" name="selectedRow" value="">

    <input type="hidden" id="selectedIds" name="selectedIds" value="" />

    <input type="hidden" id="selectedRowIds" name="selectedRowIds" value="">

    <input type="hidden" id="prodList" name="prodList" value="pList">

  • 相关阅读:
    二极管测试
    MOS开关速度
    STM8L PWM输出通道
    STM8Lpwm
    IAR 使用技巧
    java学习第十一天
    java学习第十天
    java学习第九天
    部分总结
    发现一篇好文,说的很详细,先收藏了。
  • 原文地址:https://www.cnblogs.com/tongdaoa/p/6825760.html
Copyright © 2020-2023  润新知