mirror of
https://gitee.com/ShopeX/OMS
synced 2026-04-05 06:45:32 +08:00
79 lines
2.4 KiB
HTML
79 lines
2.4 KiB
HTML
<!--
|
|
Copyright 2012-2026 ShopeX (https://www.shopex.cn)
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
-->
|
|
|
|
<{capture name="header"}>
|
|
<link href="../apps/ome/statics/ome.css" rel="stylesheet" type="text/css">
|
|
<{/capture}>
|
|
<input type='hidden' id='sequence'/>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="0" width="50%">
|
|
<{foreach from=$product item=product}>
|
|
|
|
<tr>
|
|
<td><input type="checkbox" class="product_id" id="product_id[]" name="product_id[]" value="<{$product.id}>"><{$product.id}></td>
|
|
<td > </td>
|
|
<td >:</td>
|
|
<td> </td>
|
|
<td > </td>
|
|
</tr>
|
|
<{/foreach}>
|
|
|
|
|
|
</table>
|
|
|
|
<div class="table-action">
|
|
<{button label="确定" id="dlg_ok" onclick="addproduct();"}>
|
|
<{button label="取消" id="dlg_cancel" isclosedialogbtn="true"}>
|
|
</div>
|
|
|
|
<script>
|
|
function addproduct(){
|
|
var checkNum = 0;
|
|
var product_id='';
|
|
$ES('.product_id').each(function(item, index,itobj){
|
|
if(item.checked == true){
|
|
checkNum++;
|
|
product_id=item.value;
|
|
}
|
|
});
|
|
if(checkNum>1){
|
|
alert('对不起一次只可以选择一件商品!');
|
|
return false;
|
|
}else{
|
|
|
|
new Request.JSON({url:'index.php?app=purchase&ctl=admin_stock&act=get_proinfo&product_id='+product_id,
|
|
method:'post',
|
|
onSuccess:function(data){
|
|
var sequence=$('sequence')
|
|
var sequence_dialog=$('sequence').getParent('.dialog');
|
|
var _inputText=sequence_dialog.retrieve('iptText');
|
|
var _inputHidden=sequence_dialog.retrieve('iptHidden');
|
|
var _inputbn=sequence_dialog.retrieve('iptbn');
|
|
var _inputunit=sequence_dialog.retrieve('iptunit');//iptspec
|
|
var _inputspec=sequence_dialog.retrieve('iptspec');
|
|
|
|
_inputText.set('value',data.name);
|
|
_inputHidden.set('value',data.product_id);
|
|
_inputbn.set('value',data.bn);
|
|
_inputunit.set('value',data.unit);
|
|
_inputspec.set('value',data.spec_value);
|
|
//$$('.dialog').getLast().retrieve('instance').close();
|
|
}
|
|
}).send();
|
|
|
|
}
|
|
}
|
|
</script> |