3d58fed1589c0a79dfc466c67ec53d33436f552b.svn-base 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. $(function () {
  2. "use strict";
  3. BemsWebApplication.Factory.CheckGroup = {
  4. getDataSourceWithRelation: function(store, options) {
  5. return BWA.Factory.getBaseDataSourceWithRelation(
  6. store,
  7. options,
  8. this.getDataSourceOptions(),
  9. 'FmsFacilityScheduleCheckGroup');
  10. },
  11. getDataSourceOptions: function() {
  12. var select = [ 'SiteId', 'CheckGroupId', 'Name', 'IsUse', 'CmBusinessField/Name' ]
  13. var alterNames = this.getAlterNames(select, {
  14. 'CmBusinessField/Name': 'BusinessFieldName'
  15. });
  16. return {
  17. select: select,
  18. expand: ['CmBusinessField'],
  19. filter: [
  20. ['SiteId', '=', BWA.UserInfo.SiteId()],
  21. 'and',
  22. ['WorkTypeId', '=', $Code.WorkType.REGULAR_CHECK]
  23. ],
  24. extendOptions: {
  25. alterNames: alterNames
  26. }
  27. }
  28. },
  29. defaultColumns: [
  30. { dataField: 'Number', caption: $G( 'number' ), width: '15%', alignment: 'center', allowFiltering: false },
  31. { dataField: 'BusinessFieldName', caption: $G( 'businessFieldName' ), width: '25%', alignment: 'center' },
  32. { dataField: 'Name', caption: $G( 'facilityCheckScheduleName' ), width: '45%', alignment: 'center', allowFiltering: false },
  33. utils.datagrid.columnIsUse( '15%' )
  34. ]
  35. }
  36. $.extend(BWA.Factory.CheckGroup, BWA.DataUtil.pickFunctions(BWA.Factory));
  37. })