|
|
@@ -30,7 +30,11 @@
|
|
|
物料编码:
|
|
|
<input class="easyui-textbox" id="materialcode" name="materialcode" data-options="required:false,prompt:'',tipPosition:'top'" style="width: 120px; height: 32px;">
|
|
|
有效标识:
|
|
|
- <input class="easyui-combobox" id="VALUEFLAG" name="VALUEFLAG" data-options="required:false,prompt:'',tipPosition:'top'" style="width: 150px; height: 32px;">
|
|
|
+ <input class="easyui-combobox" id="VALUEFLAG" name="VALUEFLAG" data-options="required:false,prompt:'',tipPosition:'top'" style="width: 150px; height: 32px;">
|
|
|
+ 计划年月:
|
|
|
+ <input class="easyui-datebox" id="ACCOUNTMONTHBEGIN" name="ACCOUNTMONTHBEGIN" data-options="required:false,prompt:'',editable:false ,tipPosition:'top'" style="width: 100px; height: 32px;">
|
|
|
+ 控制范围:
|
|
|
+ <input class="easyui-combobox" id="CONTROLRANGE" name="CONTROLRANGE" data-options="required:false,prompt:'',tipPosition:'top'" style="width: 150px; height: 32px;">
|
|
|
<a href="javascript:void(0)" id="btnSearchSubmit" title="清空" class="easyui-linkbutton" plain="false" onclick="$('#ffMaster').form('clear')">清空</a>
|
|
|
<a href="javascript:void(0)" id="btnSearchSubmit" title="搜索" class="easyui-linkbutton" plain="false" onclick="tbMasterSearchSubmit()">搜索</a>
|
|
|
</div>
|
|
|
@@ -83,13 +87,22 @@
|
|
|
data: val
|
|
|
});
|
|
|
// 初始化后设置默认值
|
|
|
- $('#VALUEFLAG').combobox('setValue', '2'); // 设置zhuangtai为0的项为选中状态
|
|
|
+ $('#VALUEFLAG').combobox('setValue', '2'); // 设置zhuangtai为0的项为选中状态
|
|
|
+ //控制范围
|
|
|
+ var type = [{ leixing: 0, show: '全部' }, { leixing: 1, show: '装配' }, { leixing: 2, show: '包装' } ];
|
|
|
+ $('#CONTROLRANGE').combobox({
|
|
|
+ valueField: 'leixing',
|
|
|
+ textField: 'show',
|
|
|
+ data: type
|
|
|
+ });
|
|
|
+ // 初始化后设置默认值
|
|
|
+ $('#CONTROLRANGE').combobox('setValue', '0');// 设置leixing为0的项为选中状态
|
|
|
//加载表格数据
|
|
|
tbMasterSearchSubmit()
|
|
|
});
|
|
|
//加载完成
|
|
|
$(function () {
|
|
|
-
|
|
|
+ setDateToMonth("ACCOUNTMONTHBEGIN");
|
|
|
});
|
|
|
|
|
|
//添加按钮
|
|
|
@@ -207,6 +220,50 @@
|
|
|
function dgMasterDblclickrow(rowIndex, rowData) {
|
|
|
tbMasterDetail();
|
|
|
}
|
|
|
+ function setDateToMonth(id) {
|
|
|
+
|
|
|
+ $("#" + id).datebox({
|
|
|
+ onShowPanel: function () {//显示日趋选择对象后再触发弹出月份层的事件,初始化时没有生成月份层
|
|
|
+ span.trigger('click'); //触发click事件弹出月份层
|
|
|
+ //fix 1.3.x不选择日期点击其他地方隐藏在弹出日期框显示日期面板
|
|
|
+ if (p.find('div.calendar-menu').is(':hidden')) p.find('div.calendar-menu').show();
|
|
|
+ if (!tds) setTimeout(function () {//延时触发获取月份对象,因为上面的事件触发和对象生成有时间间隔
|
|
|
+ tds = p.find('div.calendar-menu-month-inner td');
|
|
|
+ tds.click(function (e) {
|
|
|
+ e.stopPropagation(); //禁止冒泡执行easyui给月份绑定的事件
|
|
|
+ var year = /\d{4}/.exec(span.html())[0];//得到年份
|
|
|
+ var month = parseInt($(this).attr('abbr'), 10); //月份,这里不需要+1
|
|
|
+ month = month < 10 ? '0' + month : month;
|
|
|
+ $("#" + id).datebox('hidePanel')//隐藏日期对象
|
|
|
+ .datebox('setValue', year + '-' + month); //设置日期的值
|
|
|
+ });
|
|
|
+ }, 0);
|
|
|
+ yearIpt.unbind();//解绑年份输入框中任何事件
|
|
|
+ },
|
|
|
+ parser: function (s) {
|
|
|
+ if (!s) return new Date();
|
|
|
+ var arr = s.split('-');
|
|
|
+ return new Date(parseInt(arr[0], 10), parseInt(arr[1], 10) - 1, 1);
|
|
|
+ },
|
|
|
+ formatter: function (d) {
|
|
|
+ return d.getFullYear() + '-' + (d.getMonth() + 1);/*getMonth返回的是0开始的,忘记了。。已修正*/
|
|
|
+ }
|
|
|
+ });
|
|
|
+ var p = $("#" + id).datebox('panel'), //日期选择对象
|
|
|
+ tds = false, //日期选择对象中月份
|
|
|
+ aToday = p.find('a.datebox-current'),
|
|
|
+ yearIpt = p.find('input.calendar-menu-year'),//年份输入框
|
|
|
+ //显示月份层的触发控件
|
|
|
+ span = aToday.length ? p.find('div.calendar-title span') ://1.3.x版本
|
|
|
+ p.find('span.calendar-text'); //1.4.x版本
|
|
|
+ if (aToday.length) {//1.3.x版本,取消Today按钮的click事件,重新绑定新事件设置日期框为今天,防止弹出日期选择面板
|
|
|
+ aToday.unbind('click').click(function () {
|
|
|
+ var now = new Date();
|
|
|
+ now = now < 10 ? '0' + now : now;
|
|
|
+ $("#" + id).datebox('hidePanel').datebox('setValue', now.getFullYear() + '-' + (now.toString() + 1));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
|
|
|
function formatterTrueFalse(value, row, index) { return value == 'True' ? '是' : '否'; }
|
|
|
function stylerTrueFalse(value, row, index) { return value == 'True' ? 'color:black' : 'color:red'; }
|