| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%@include file="/context/mytags.jsp"%>
- <!DOCTYPE html>
- <html>
- <head>
- <title>人员物资分配方案</title>
- <style>
- .ui-button {
- display: inline-block;
- padding: 2px 2px;
- margin-bottom: 0;
- font-size: 8px;
- font-weight: normal;
- line-height: 1.42857143;
- text-align: center;
- white-space: nowrap;
- vertical-align: middle;
- -ms-touch-action: manipulation;
- touch-action: manipulation;
- cursor: pointer;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- background-image: none;
- border: 1px solid transparent;
- border-radius: 4px;
- }
- </style>
- <t:base type="jquery,easyui,tools,DatePicker"></t:base>
- <script src="${webBasePath}/webpage/cn/com/lzt/useractiviti/detail_tools.js"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- $('#tt').tabs({
- onSelect:function(title){
- changeTabHeight();
- }
- });
- $(".tabs-wrap").css('width','100%');
- $('input[name$="num"]').live("change",function(){
- changeAmount(this);
- });
- $('input[name$="price"]').live("change",function(){
- changeAmount(this);
- });
- $('input[name$="materialName"]').live("click",function(){
- var tools = new detailTools('budgetCostPostMaterialSchemeDetail_table');
- var row =tools.touchRow(this);
- var type=row.getValue('type');
- if (type=='1'){
- addClothing(row);
- }else if (type=='2') {
- addGoods(row);
- }
- });
- if($.Datatype) {
- $.Datatype.fix2 = function (val, obj, frm) {
- $(obj).val(parseFloat(val).toFixed(2));
- return true;
- }
- }
- });
- function addGoods(row){
- var url="budgetDataController.do?selectReferGoods4Budget" +
- "&classname=cn.com.lzt.goodsinfo.entity.TBGoodsInfoEntity" +
- "&codefield=goodsCode" +
- "&categoryfield=belongCategoryCode" +
- "&categoryNamefield=belongCategoryName" +
- "&namefield=goodsName" +
- "&purchaseUnit=purchaseUnit" +
- "&specification=specification" +
- "&goodsDesc=goodsDesc" +
- "&strEmpty=strEmpty" +
- "&supplierName=defaultProvider&checkbox=false";
- _select(url,'选择货品',function(selected){
- var one =selected[0];
- row.setValue('materialId',one.id);
- row.setValue('materialName',one.goodsName);
- },'800px','600px');
- }
- function addClothing(row){
- var url="budgetDataController.do?selectClothing&checkbox=false";
- _select(url,'选择工作服',function(selected){
- var one = selected[0];
- row.setValue('materialId',one.id);
- row.setValue('materialName',one.name);
- },'800px','600px');
- }
- function changeAmount(obj){
- var tools = new detailTools('budgetCostPostMaterialSchemeDetail_table');
- var row =tools.touchRow(obj);
- var num=row.getValue('num');
- var price =row.getValue('price');
- if(num && price) {
- var amount = parseFloat(num)*parseFloat(price);
- row.setValue('amount',amount.toFixed(2));
- changeTotalAmount();
- }
- }
- function changeTotalAmount(){
- var totalAmount = 0;
- $('input[name$="amount"]').each(function(){
- var amount = $(this).val();
- if(amount) {
- totalAmount += parseFloat(amount);
- }
- });
- totalAmount=totalAmount.toFixed(2);
- $('#totalAmount').val(totalAmount);
- }
- function changeTabHeight(){
- var height =window.top.document.body.offsetHeight;
- height = height -181.3 - 36 - 100 -4;//去掉底部输入框table高度、title高度、弹出框小于后台页面高度、文本格式高度
- $('#tt .panel-body').css('width','auto').css('height',height+'px');
- }
- function _openDialog(url,title,okCallback,width,height){
- if(!width){
- width='500px';
- }
- if(!height){
- height='350px';
- }
- if(width=="100%"){
- width = window.top.document.body.offsetWidth;
- }
- if(height=="100%") {
- height =window.top.document.body.offsetHeight-100;
- }
- var _selectDialog= $.dialog({content:'url:'+url
- , zIndex: getzIndex()
- , title:title , lock: true, width:width, height: height, opacity: 0.4, button: [
- {name: '确定', callback:function () {
- var iframe = _selectDialog.iframe.contentWindow;
- if(okCallback){
- var b = okCallback(iframe);
- return b;
- }
- }
- , focus: true},
- {name: '取消', callback: function (){}}
- ]}).zindex();
- return _selectDialog;
- }
- function _select(url,title,okCallback,width,height){
- var dialog=_openDialog(url,title,function(iframe){
- var selectedRows = iframe.getSelectRows();
- if(selectedRows.length==0){
- iframe.tip('请至少选择一项');
- return false;
- }
- if(okCallback){
- var b = okCallback(selectedRows);
- return b;
- }
- },width,height);
- return dialog;
- }
- </script>
- </head>
- <body style="overflow-x: hidden;">
- <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" tiptype="1" action="budgetCostPostMaterialSchemeController.do?doAdd" tipSweep="true">
- <t:tabs id="tt" iframe="false" tabPosition="top" fit="false">
- <t:tab href="budgetCostPostMaterialSchemeController.do?budgetCostPostMaterialSchemeDetailList&id=${entity.id}" icon="icon-search" title="人员物资配置方案" id="budgetCostPostMaterialSchemeDetail"></t:tab>
- </t:tabs>
- <table cellpadding="0" cellspacing="1" class="formtable">
- <tr>
- <td align="right">
- <label class="Validform_label">名称:</label>
- </td>
- <td class="value">
- <input id="name" name="name" type="text" style="width: 150px" class="inputxt" datatype="*" ignore="checked" value="${entity.name}-副本" />
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">名称</label>
- </td>
- <td align="right">
- <label class="Validform_label">总金额:</label>
- </td>
- <td class="value">
- <input id="totalAmount" name="totalAmount" type="text" style="width: 150px" class="inputxt" readonly="readonly" value="${entity.totalAmount }"/>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">总金额</label>
- </td>
- </tr>
-
- </table>
- </t:formvalid>
- <!-- 添加 附表明细 模版 -->
- <table style="display:none">
- <tbody id="add_budgetCostPostMaterialSchemeDetail_table_template">
- <tr>
- <td align="center">
- <div style="width: 25px;" name="xh"></div>
- <input name="budgetCostPostMaterialSchemeDetailList[#index#].schemeId" type="hidden" />
- </td>
- <td align="center"><input style="width:20px;" type="checkbox" name="ck"/></td>
- <td align="left">
- <input name="budgetCostPostMaterialSchemeDetailList[#index#].type" type="hidden" />
- <input name="budgetCostPostMaterialSchemeDetailList[#index#].materialId" type="hidden" />
- <input name="budgetCostPostMaterialSchemeDetailList[#index#].materialName" maxlength="255" type="text" class="inputxt" style="width:120px;"
- datatype="*" nullmsg="请选择物资" readonly="readonly"/>
- <label class="Validform_label" style="display: none;">物资名称</label>
- </td>
- <td align="left">
- <input name="budgetCostPostMaterialSchemeDetailList[#index#].num" maxlength="32" type="text" class="inputxt" style="width:120px;" datatype="d,fix2"/>
- <label class="Validform_label" style="display: none;">数量</label>
- </td>
- <td align="left">
- <input name="budgetCostPostMaterialSchemeDetailList[#index#].price" maxlength="32" type="text" class="inputxt" style="width:120px;" datatype="d,fix2" />
- <label class="Validform_label" style="display: none;">均价</label>
- </td>
- <td align="left">
- <input name="budgetCostPostMaterialSchemeDetailList[#index#].amount" maxlength="32" type="text" class="inputxt" style="width:120px;" readonly="readonly"/>
- <label class="Validform_label" style="display: none;">金额</label>
- </td>
- </tr>
- </tbody>
- </table>
- </body>
- <script src = "webpage/cn/com/lzt/budget/costpostmaterialscheme/budgetCostPostMaterialScheme.js"></script>
-
|