first commit
Цей коміт міститься в:
@@ -0,0 +1,146 @@
|
||||
<#def designatedPath="/orderConvertList.htm"/>
|
||||
${request.getValidateScript()}
|
||||
${zhiqim_manager_history("orderConvertList.htm")}
|
||||
|
||||
${zhiqim_manager_breadcrumb_parent("orderConvertList.htm", "订单折算参数", "修改订单折算参数")}
|
||||
${zhiqim_manager_content()}
|
||||
<form name="theForm" action="orderConvertUpdate.htm" method="post" onSubmit="return validateForm(this);" data-role="z-call-frame">
|
||||
<table class="z-table z-bordered z-h50-tr z-pd10 z-bg-white">
|
||||
<tr class="zi-h40 z-bg-gray z-bold">
|
||||
<td colspan="2">修改订单折算参数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="40%">产品类型:</td>
|
||||
<td width="*">
|
||||
${orderConvert.getPrdTypeName()}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>折算类型:<span class="z-color-999">(请选择)</span></td>
|
||||
<td>
|
||||
<select name="convertType" class="z-float-left z-select z-w120" data-role="z-select-search" data-class="${zmr_color_class}">
|
||||
<option value="0" <#if 0 == orderConvert.getConvertType()>selected</#if> onclick="controlConvertModulusBox('0');">不启用</option>
|
||||
<option value="1" <#if 1 == orderConvert.getConvertType()>selected</#if> onclick="controlConvertModulusBox('1');">金额</option>
|
||||
<option value="2" <#if 2 == orderConvert.getConvertType()>selected</#if> onclick="controlConvertModulusBox('2');">系数</option>
|
||||
</select>
|
||||
<span class="z-color-red"> *</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>折算系数:<span class="z-color-999">(请填写)</span></td>
|
||||
<td>
|
||||
<input value="${orderConvert.getConvertNum()}" class="z-input z-w400 ${zmr_color_class}" name="convertNum" placeholder="请输入数字" onkeyup="this.value=this.value.toString().match(/^\d+(?:\.\d{0,2})?/)">
|
||||
<input name="prdTypeId" value="${orderConvert.getPrdTypeId()}" type="hidden" >
|
||||
<input name="convertId" value="${orderConvert.getConvertId()}" type="hidden" >
|
||||
<span class="z-color-red"> *</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="convertModulusBox">
|
||||
<td>折算参数:</td>
|
||||
<td>
|
||||
<table id="size_table" class="z-table z-bordered-line zi-bd-t-none zi-bd-b-none z-h50-tr z-pd10 z-bg-white">
|
||||
<#for modulu : convertModulus>
|
||||
<#var index=modulu_index/>
|
||||
<tr class="zi-bd-b-none" id="modulus${modulu}">
|
||||
<td>
|
||||
折算模数:<input readonly="readonly" name="modulus" value="${modulu}" class="z-input z-w90" maxlength="8" data-options="type:Amount2R; paste:true;" placeholder="模数">
|
||||
|
||||
|
||||
折算系数:<input value="${convertModulusNum.get(index)}" name="modulusConvertNum" value="" class="z-input z-w90" maxlength="8" data-options="type:Amount2R; paste:true;" placeholder="系数" onkeyup="convertNumDefine(this);">
|
||||
<span class="z-color-red"> *</span>
|
||||
<#if index != 0>
|
||||
<button type="button" class="z-button z-red z-float-right" onclick="doDeleteModulus(this);"><i class="z-font z-delete"></i>删除</button>
|
||||
</#if>
|
||||
</td>
|
||||
</tr>
|
||||
</#for>
|
||||
</table>
|
||||
<div class="z-pd10">
|
||||
<button type="button" class="z-button z-blue z-float-right" onclick="doAddModulus()"><i class="z-font z-add"></i>添加</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
${zhiqim_manager_submit()}
|
||||
</form>
|
||||
${zhiqim_manager_content_end()}
|
||||
<script>
|
||||
Z.onload(function(){
|
||||
// 默认隐藏折算参数区域
|
||||
Z("#convertModulusBox").hide();
|
||||
|
||||
var convertType = eval(${orderConvert.getConvertType()});
|
||||
if (Z.V.isNotEmpty(convertType))
|
||||
{
|
||||
if (2 == parseInt(convertType))
|
||||
{
|
||||
// 如果折算类型为系数则显示折算参数区域
|
||||
Z("#convertModulusBox").show();
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
// 控制折算参数区域的显示和隐藏
|
||||
function controlConvertModulusBox(convertType)
|
||||
{
|
||||
if (Z.V.isEmpty(convertType))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (2 == parseInt(convertType))
|
||||
{
|
||||
Z("#convertModulusBox").show();
|
||||
}
|
||||
else
|
||||
{
|
||||
Z("#convertModulusBox").hide();
|
||||
}
|
||||
}
|
||||
|
||||
function doAddModulus()
|
||||
{
|
||||
var modulus = document.getElementsByName("modulus");
|
||||
var maxValue=1;
|
||||
for(var i = 0;i < modulus.length;i++){
|
||||
if(!modulus[i+1] || modulus[i].value != (modulus[i+1].value-1)){
|
||||
maxValue = i+3;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
var tableHtml="";
|
||||
|
||||
//添加行
|
||||
tableHtml += '<tr class="zi-bd-b-none" id="modulus'+maxValue+'">';
|
||||
tableHtml += ' <td>';
|
||||
tableHtml += ' 折算模数:<input readonly="readonly" name="modulus" value="'+maxValue+'" class="z-input z-w90" maxlength="8" data-options="type:Amount2R; paste:true;" placeholder="模数">';
|
||||
tableHtml += '  ';
|
||||
tableHtml += '  ';
|
||||
tableHtml += ' 折算系数:<input name="modulusConvertNum" value="" class="z-input z-w90" maxlength="8" data-options="type:Amount2R; paste:true;" placeholder="系数" onkeyup="convertNumDefine(this);">';
|
||||
tableHtml += ' <span class="z-color-red"> *</span>';
|
||||
tableHtml += ' <button type="button" class="z-button z-red z-float-right" onclick="doDeleteModulus(this);"><i class="z-font z-delete"></i>删除</button>';
|
||||
tableHtml += ' </td>';
|
||||
tableHtml += '</tr>';
|
||||
|
||||
Z("#modulus"+(maxValue-1)).after(tableHtml);
|
||||
flushModulus();
|
||||
}
|
||||
|
||||
function convertNumDefine(obj){
|
||||
obj.value=obj.value.toString().match(/^\d+(?:\.\d{0,2})?/);
|
||||
}
|
||||
|
||||
function flushModulus(){
|
||||
/*var modulus = document.getElementsByName("modulus");
|
||||
for(var i = 0;i < modulus.length;i++){
|
||||
modulus[i].value=i+2;
|
||||
}*/
|
||||
}
|
||||
|
||||
function doDeleteModulus(obj){
|
||||
Z(obj).parent().parent().remove();
|
||||
flushModulus();
|
||||
}
|
||||
</script>
|
||||
Посилання в новій задачі
Заблокувати користувача