StaffList.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /**
  2. * 教职工信息
  3. */
  4. Ext.define('school.view.basic.staff.StaffList', {
  5. extend: 'school.view.core.base.BasePanel',
  6. xtype: 'basic-staff-stafflist',
  7. // dataUrl: '/api/sale/saledown/list',
  8. initComponent: function() {
  9. var me = this;
  10. Ext.apply(this, {
  11. searchField: [{
  12. xtype: 'textfield',
  13. name: 'code',
  14. fieldLabel:'教职工号'
  15. }, {
  16. xtype: 'textfield',
  17. name: 'name',
  18. fieldLabel: '姓名'
  19. }, {
  20. xtype: 'textfield',
  21. name: 'job',
  22. fieldLabel: '职位'
  23. }],
  24. caller: null,
  25. _formXtype: null,
  26. _title: null,
  27. _deleteUrl: null,
  28. _batchOpenUrl: null,
  29. _batchCloseUrl: null,
  30. _batchDeleteUrl: null,
  31. gridConfig: {
  32. idField: null,
  33. codeField: null,
  34. statusCodeField: null,
  35. dataUrl: me.dataUrl,
  36. caller: null,
  37. rootProperty: 'data.list',
  38. totalProperty: 'data.total',
  39. actionColumn: [],
  40. selModel: {
  41. type: 'cellmodel'
  42. },
  43. data: [{
  44. }],
  45. columns : [{
  46. text: '工号',
  47. dataIndex: 'code',
  48. width: 150
  49. }, {
  50. text: '绑定手机号',
  51. dataIndex: 'phone',
  52. width: 120
  53. }, {
  54. text: '姓名',
  55. dataIndex: 'name',
  56. width: 120
  57. }, {
  58. text: '职位',
  59. dataIndex: 'job',
  60. width: 120
  61. }, {
  62. text: '是否开通',
  63. dataIndex: 'open'
  64. }, {
  65. text: '状态',
  66. dataIndex: 'status'
  67. }],
  68. listeners: {
  69. itemclick: function(view, record, item, index, e, eOpts) {
  70. // saas.util.BaseUtil.openTab('sale-b2b-purchasedetail', '客户采购单', 'sale-b2b-purchasedetail'+record.id, {
  71. // initId: record.get('id')
  72. // });
  73. }
  74. }
  75. },
  76. });
  77. this.callParent(arguments);
  78. },
  79. /**
  80. * 处理部分字段值
  81. */
  82. getConditionValue: function (field, value) {
  83. var me = this,
  84. xtypes = field.getXTypes().split('/'),
  85. conditionValue;
  86. if (me.isContainsAny(xtypes, ['datefield'])) {
  87. conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
  88. } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
  89. var from = value.from,
  90. to = value.to;
  91. conditionValue = from + ',' + to;
  92. } else if (me.isContainsAny(xtypes, ['condatefield'])) {
  93. var from = value.from,
  94. to = value.to;
  95. conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
  96. } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
  97. conditionValue = value;
  98. } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
  99. conditionValue = value;
  100. } else if (me.isContainsAny(xtypes, ['multicombo'])) {
  101. conditionValue = value.map ? value.map(function (v) {
  102. return v.value;
  103. }).join(',') : '';
  104. } else {
  105. conditionValue = value;
  106. }
  107. return conditionValue;
  108. },
  109. getExtraParams: function(store, op, condition) {
  110. var temp = {};
  111. for(let x = 0; x < condition.length; x++) {
  112. let c = condition[x];
  113. if(c.field == 'keyword') {
  114. temp.keyword = c.value;
  115. }else if(c.field == 'date') {
  116. temp.fromDate = new Date(c.value.split(',')[0]).getTime();
  117. temp.endDate = new Date(c.value.split(',')[1]).getTime();
  118. }else if(c.field == 'quoted') {
  119. temp.quoted = c.value == 'all' ? null : c.value;
  120. }else if(c.field == 'closed') {
  121. // temp.endDate = c.value == 'all' ? null : (
  122. // c.value == '0' ?
  123. // );
  124. }
  125. }
  126. let obj = {
  127. pageNumber: store.exportNumber?store.exportNumber:op._page,
  128. pageSize: store.exportPageSize?store.exportPageSize:store.pageSize
  129. };
  130. for(let k in temp) {
  131. if(!!temp[k]) {
  132. obj[k] = temp[k];
  133. }
  134. }
  135. return obj;
  136. },
  137. });