starter.factory('Audit', function ($resource, $q, $filter, cfg, formatFilter) { var audit = {}; audit.body = {}; audit.bodyitem = []; audit.chkdd_tv_arr = ['不限制', '当日', '本周', '上周', '本月', '上月', '本季', '上季', '本年', '去年']; audit.Audit = function (type) { return $resource(formatFilter('{0}ext_erp/Audit/{1}/', cfg.api, type)) } audit.Bills = function (type) { return $resource(formatFilter('{0}ext_erp/Bills/{1}/', cfg.api, type)) } audit.getFilter = function () { var filter = window.localStorage.getItem('auditFilter'); if (filter) { filter = JSON.parse(filter); } else { filter = { chkdd_tv:0, bil_id_tv:null, b_no_tv:null, e_no_tv:null, b_cus_tv:null, e_cus_tv:null, substitutechk:true }; window.localStorage['auditFilter'] = JSON.stringify(filter); } return filter; } audit.setFilter = function (filter) { window.localStorage['auditFilter'] = JSON.stringify(filter); } return audit; })