1. 程式人生 > >CRM如何在新增模塊中增加產品明細並從其他模塊中取數

CRM如何在新增模塊中增加產品明細並從其他模塊中取數

配置說明 tail edi == img chang lis htm 分享

一、如何在新增模塊中增加產品明細模塊並從其他模塊中取數

1、新增一個功能模塊如:CRM_MODULE_1

2、打開X:\MYOA\webroot\general\crm\apps\crm\modules\CRM_MODULE_1\EditView\ EditView.php,移至最下方,把以下代碼粘貼到前</form>,即可!

技術分享

<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">

CRM如何在新增模塊中增加產品明細並從其他模塊中取數