134 lines
5.4 KiB
Plaintext
134 lines
5.4 KiB
Plaintext
<#def designatedPath="/orderConvertList.htm"/>
|
|
${request.getValidateScript()}
|
|
${zhiqim_manager_history("orderConvertList.htm")}
|
|
|
|
${zhiqim_manager_breadcrumb_parent("orderConvertList.htm", "订单折算参数", "增加订单折算参数")}
|
|
${zhiqim_manager_content()}
|
|
<form name="theForm" action="orderConvertInsert.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%">产品类型:<span class="z-color-999">(请选择)</span></td>
|
|
<td width="*">
|
|
<input type="hidden" name="prdTypeName" id="prdTypeName" value="${DesignTypeDao.list().get(0).getTypeName()}">
|
|
<select name="prdTypeId" class="z-float-left z-select z-w120" data-role="z-select-search" data-class="${zmr_color_class}" onchange="document.getElementById('prdTypeName').value=document.getElementsByName('prdTypeId')[0].options[document.getElementsByName('prdTypeId')[0].selectedIndex].innerHTML;">
|
|
<#for item : DesignTypeDao.list()>
|
|
<option value="${item.getTypeId()}" <#if typeId == item.getTypeId()>selected</#if>>${item.getTypeName()}</option>
|
|
</#for>
|
|
</select>
|
|
<span class="z-color-red"> *</span>
|
|
</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" onclick="controlConvertModulusBox('0');">不启用</option>
|
|
<option value="1" onclick="controlConvertModulusBox('1');">金额</option>
|
|
<option value="2" onclick="controlConvertModulusBox('2');">系数</option>
|
|
</select>
|
|
<span class="z-color-red"> *</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>折算系数:<span class="z-color-999">(请填写)</span></td>
|
|
<td>
|
|
<input class="z-input z-w400 ${zmr_color_class}" name="convertNum" placeholder="请输入数字" onkeyup="this.value=this.value.toString().match(/^\d+(?:\.\d{0,2})?/)">
|
|
<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">
|
|
<tr class="zi-bd-b-none" id="modulus2">
|
|
<td>
|
|
折算模数:<input readonly="readonly" name="modulus" value="2" class="z-input z-w90" maxlength="8" data-options="type:Amount2R; paste:true;" placeholder="模数">
|
|
|
|
|
|
折算系数:<input 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>
|
|
</td>
|
|
</tr>
|
|
</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();
|
|
})
|
|
|
|
// 控制折算参数区域的显示和隐藏
|
|
function controlConvertModulusBox(convertType)
|
|
{
|
|
if (Z.V.isEmpty(convertType))
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (2 == parseInt(convertType))
|
|
{
|
|
Z("#convertModulusBox").show();
|
|
}
|
|
else
|
|
{
|
|
Z("#convertModulusBox").hide();
|
|
// modulusConvertNum
|
|
}
|
|
}
|
|
|
|
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> |