| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- Ext.define('erp.view.oa.persontask.workDaily.Query',{
- extend: 'Ext.Viewport',
- layout: 'anchor',
- hideBorders: true,
- initComponent : function(){
- var me = this;
- Ext.apply(me, {
- items: [{
- xtype: 'erpFormPanel',
- region: 'north',
- anchor: '100% 30%',
- tbar: [{
- name: 'query',
- text: $I18N.common.button.erpQueryButton,
- iconCls: 'x-button-icon-query',
- cls: 'x-btn-gray',
- handler: function(){
- var grid = Ext.getCmp('grid');
- var form = Ext.getCmp('form');
- var condition = '';
- console.log(form);
- Ext.each(form.items.items, function(f){
- if(f.logic != null && f.logic != ''){
- if(f.logic == 'wd_date' && f.value != null && f.value != ''){
- if(condition == ''){
- condition += f.logic + " " + f.value;
- } else {
- condition += ' AND ' + f.logic + " " + f.value;
- }
- } else if(f.logic == 'wd_emp'){
- if(f.value != null && f.value != ''){
- if(condition == ''){
- condition += f.logic + "='" + f.value + "' AND wd_empid=" + Ext.getCmp('wd_empid').value;
- } else {
- condition += ' AND ' + f.logic + "='" + f.value + "' AND wd_empid=" + Ext.getCmp('wd_empid').value;
- }
- } else {
- if(condition == ''){
- condition += f.logic + "='" + em_name + "' AND wd_empid=" + em_uu;
- } else {
- condition += ' AND ' + f.logic + "='" + em_name + "' AND wd_empid=" + em_uu;
- }
- }
- }
- // if(contains(f.value, 'BETWEEN', true) && contains(f.value, 'AND', true)){
- // if(condition == ''){
- // condition += f.logic + " " + f.value;
- // } else {
- // condition += ' AND ' + f.logic + " " + f.value;
- // }
- // } else {
- // if(condition == ''){
- // condition += f.logic + "='" + f.value + "'";
- // } else {
- // condition += ' AND ' + f.logic + "='" + f.value + "'";
- // }
- // }
- }
- });
- if(condition != ''){
- grid.getCount('WorkDaily!Query', condition);
- } else {
- showError('请填写筛选条件');return;
- }
- }
- }, '-', {
- text: $I18N.common.button.erpCloseButton,
- iconCls: 'x-button-icon-close',
- cls: 'x-btn-gray',
- handler: function(){
- var main = parent.Ext.getCmp("content-panel");
- main.getActiveTab().close();
- }
- }]
- },{
- region: 'south',
- xtype:'erpDatalistGridPanel',
- filterCondition: "wd_emp='" + em_name + "' AND wd_empid=" + em_uu,
- anchor: '100% 70%'
- }]
- });
- me.callParent(arguments);
- }
- });
|