|
@@ -0,0 +1,368 @@
|
|
|
|
+(function ($app) {
|
|
|
|
+ $app.module('gtPartyApp').controller('reportDataScoreCtrl', function ($scope, $http, $modal, $ocLazyLoad, $timeout,$alert, $loading, $state, AuthUser, $partySelect,$stateParams,$bsRouterState) {
|
|
|
|
+ $state.params = $bsRouterState.$params($scope);
|
|
|
|
+ $scope.isShow = false;
|
|
|
|
+ $scope.moreTxt = "更多";
|
|
|
|
+ $scope.pageId = "checkNameList";
|
|
|
|
+
|
|
|
|
+ //定义数据集合
|
|
|
|
+ $scope.dataList = []; //列表数据
|
|
|
|
+ $scope.yearList = [];
|
|
|
|
+ $scope.quarterList = [];
|
|
|
|
+
|
|
|
|
+ //初始化查询参数
|
|
|
|
+ $scope.selectparams = {
|
|
|
|
+ isunfold: false,//组织结构树展开收缩
|
|
|
|
+ 'pageindex': 1,
|
|
|
|
+ 'pagesize': 10,
|
|
|
|
+ 'selectdzzdm': '',
|
|
|
|
+ selectdzzmc: '',
|
|
|
|
+ defaultselected: $state.params.dzzdm,
|
|
|
|
+ parentcode: AuthUser.getUser().ParentDpCode,
|
|
|
|
+ parentname: AuthUser.getUser().ParentDpName,
|
|
|
|
+ szdzzdm: AuthUser.getUser().DPCode,
|
|
|
|
+ szdzzmc: AuthUser.getUser().DPName,
|
|
|
|
+ dzzdm: '',
|
|
|
|
+ dzzmc: '',
|
|
|
|
+ recordStatus: null,
|
|
|
|
+ year: null,
|
|
|
|
+ quarter: null,
|
|
|
|
+ userid: AuthUser.getUser().Id,
|
|
|
|
+ onlyshow_dw: $stateParams.type == 1 ? 1 : 0,
|
|
|
|
+ checkUserName: '',
|
|
|
|
+ partyCode: '',
|
|
|
|
+ partyName: ''
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ $scope.pageInfo = {ptotal: 0};
|
|
|
|
+ //监视页数变化
|
|
|
|
+ $scope.$watch("selectparams.pageindex", function (newVal, oldVal) {
|
|
|
|
+ if ($scope.pageInfo.ptotal > 0) {
|
|
|
|
+ $scope.loadData();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ //监视党组织选中变化
|
|
|
|
+ $scope.$watch("selectparams.selectdzzdm", function (newVal, oldVal) {
|
|
|
|
+ if (newVal != '' && newVal != null) {
|
|
|
|
+
|
|
|
|
+ if ($scope.selectparams.defaultselected != "" && $scope.selectparams.defaultselected != null &&
|
|
|
|
+ $scope.selectparams.defaultselected != $scope.selectparams.selectdzzdm)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ $scope.selectparams.defaultselected = "";
|
|
|
|
+
|
|
|
|
+ $scope.selectparams.dzzdm = $scope.selectparams.selectdzzdm;
|
|
|
|
+ $scope.loadData();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ //选择党支部begin
|
|
|
|
+ $scope.partyTreeConfig = {
|
|
|
|
+ scope: $scope,
|
|
|
|
+ selectedKey: '',
|
|
|
|
+ selectedText: '',
|
|
|
|
+ selectedData: [],
|
|
|
|
+ isMulti: false,
|
|
|
|
+ isshowxz: 0
|
|
|
|
+ };
|
|
|
|
+ $partySelect.initServer($scope.partyTreeConfig);
|
|
|
|
+ $scope.selectParty = function () {
|
|
|
|
+ $partySelect.showModal();
|
|
|
|
+ };
|
|
|
|
+ $scope.$watch("partyTreeConfig.selectedKey", function (newVal, oldVal) {
|
|
|
|
+ if (newVal) {
|
|
|
|
+ $scope.selectparams.partyCode = $scope.partyTreeConfig.selectedKey;
|
|
|
|
+ $scope.selectparams.partyName = $scope.partyTreeConfig.selectedText;
|
|
|
|
+ $scope.search();
|
|
|
|
+ }
|
|
|
|
+ }, true);
|
|
|
|
+
|
|
|
|
+ //查询
|
|
|
|
+ $scope.search = function () {
|
|
|
|
+ $scope.loadData();
|
|
|
|
+ };
|
|
|
|
+ $scope.getYearsList = function () {
|
|
|
|
+ $http({
|
|
|
|
+ method: 'get',
|
|
|
|
+ url: '../../api/dictionary/getDictionaryListByDicTypeKey',
|
|
|
|
+ params: {dicTypeKey: 'years'}
|
|
|
|
+ }).then(function (result) {
|
|
|
|
+ $scope.yearList = result.data;
|
|
|
|
+ }, function (resp) {
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ $scope.getYearsList();
|
|
|
|
+
|
|
|
|
+ $scope.getQuartersList = function () {
|
|
|
|
+ $http({
|
|
|
|
+ method: 'get',
|
|
|
|
+ url: '../../api/dictionary/getQuartersList',
|
|
|
|
+ params: {}
|
|
|
|
+ }).then(function (result) {
|
|
|
|
+ $scope.quarterList = result.data;
|
|
|
|
+ }, function (resp) {
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ $scope.getQuartersList();
|
|
|
|
+
|
|
|
|
+ $scope.enableStatusList=[];
|
|
|
|
+ $scope.getEnableStatusList = function () {
|
|
|
|
+ $http({
|
|
|
|
+ method: 'get',
|
|
|
|
+ url: '../../api/dictionary/getDictionaryListByDicTypeKey',
|
|
|
|
+ params: {dicTypeKey: 'EnableStatus'}
|
|
|
|
+ }).then(function (result) {
|
|
|
|
+ $scope.enableStatusList = result.data;
|
|
|
|
+ }, function (resp) {
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ $scope.getEnableStatusList();
|
|
|
|
+
|
|
|
|
+ //加载列表数据
|
|
|
|
+ $scope.loadData = function () {
|
|
|
|
+ $http
|
|
|
|
+ ({
|
|
|
|
+ method: 'get', url: '../../api/checkdata/getCheckNameList', params: $scope.selectparams
|
|
|
|
+ }).then(function (result) {
|
|
|
|
+ $scope.dataList = result.data.item.list;
|
|
|
|
+ $scope.pageInfo.ptotal = result.data.item.total;
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ var editCtrl = function ($scope, $http,$partySelect) {
|
|
|
|
+ $scope.params = editModal.params;
|
|
|
|
+ $scope.dataModel = editModal.data;
|
|
|
|
+
|
|
|
|
+ $scope.selectUserlist = {
|
|
|
|
+ url: '../../api/partyUser/getPartyUserList',
|
|
|
|
+ title: '人员选择',
|
|
|
|
+ isMulti: false,
|
|
|
|
+ selectData: {xm: '姓名', szdzb: '所在组织架构'},
|
|
|
|
+ columns: {XM: '姓名', XBMC: '性别', JG: '籍贯', DZZMC: '所在组织架构'},
|
|
|
|
+ selectLabelKey: 'XM',
|
|
|
|
+ selectValuekey: 'RYJBXXBS',
|
|
|
|
+ selectedValueData: '',
|
|
|
|
+ selectedLabeData: '',
|
|
|
|
+ selectedJData: [],
|
|
|
|
+ selectParams: {
|
|
|
|
+ ryzt: '2,3',
|
|
|
|
+ dzzdm: AuthUser.getUser().DataDzzdm
|
|
|
|
+ },
|
|
|
|
+ onSelect: function (value, item) {
|
|
|
|
+ if (item) {
|
|
|
|
+ $scope.dataModel.checkusername = item.XM;
|
|
|
|
+ $scope.dataModel.checkuserid = item.RYBM;
|
|
|
|
+ $scope.dataModel.dzzmc = item.DZZMC;
|
|
|
|
+ $scope.dataModel.dzzdm = item.SZDZBDM;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ $scope.checkPartyList=[];
|
|
|
|
+ //选择人员
|
|
|
|
+ $scope.selectPartyOption = {
|
|
|
|
+ url: '../../api/party/getPartyList',
|
|
|
|
+ title: '选择支部',
|
|
|
|
+ isMulti: true,
|
|
|
|
+ selectData: {dzzmc: '党组织名称', dzzdm: '党组织编码'},
|
|
|
|
+ columns: {DZZMC: '党组织名称', DZZDM: '党组织编码', ZZLBMC: '组织类别'},
|
|
|
|
+ selectLabelKey: 'DZZMC',
|
|
|
|
+ selectValuekey: 'DZZDM',
|
|
|
|
+ selectedValueData: $scope.dataModel.partcodes,
|
|
|
|
+ selectedLabeData: $scope.dataModel.partynames,
|
|
|
|
+ selectedJData: [],
|
|
|
|
+ selectParams: {
|
|
|
|
+ zzlbList:'400',
|
|
|
|
+ dzzdm: $scope.dataModel.takecarepartycode || AuthUser.getUser().DataDzzdm
|
|
|
|
+ },
|
|
|
|
+ onSelect: function (value) {
|
|
|
|
+ /*$scope.checkPartyList=[];
|
|
|
|
+ if (selecteds && selecteds.length > 0) {
|
|
|
|
+ selecteds.forEach(val => {
|
|
|
|
+ if ($scope.checkPartyList.filter(it => it.partycode == val.DZZDM).length == 0) {
|
|
|
|
+ $scope.checkPartyList.push({
|
|
|
|
+ partycode: val.DZZDM,
|
|
|
|
+ partyname: val.DZZMC,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }*/
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ $scope.getCheckPartyList=()=>{
|
|
|
|
+ $scope.checkPartyList=[];
|
|
|
|
+ var partcodes =$scope.selectPartyOption.selectedValueData.split(",");
|
|
|
|
+ var partynames =$scope.selectPartyOption.selectedLabeData.split(",");
|
|
|
|
+ for (var i=0;i<partcodes.length;i++){
|
|
|
|
+ $scope.checkPartyList.push({
|
|
|
|
+ partycode: partcodes[i],
|
|
|
|
+ partyname:partynames[i],
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ //保存
|
|
|
|
+ $scope.save = function (isflag) {
|
|
|
|
+ if (isflag) {
|
|
|
|
+ $loading.show();
|
|
|
|
+ $scope.getCheckPartyList();
|
|
|
|
+ $http({
|
|
|
|
+ method: "post",
|
|
|
|
+ url: "../../api/checkdata/saveCheckNameList",
|
|
|
|
+ data: {
|
|
|
|
+ dataModel:$scope.dataModel,
|
|
|
|
+ checkPartyList:$scope.checkPartyList
|
|
|
|
+ }
|
|
|
|
+ }).then(function (result) {
|
|
|
|
+ $loading.hide();
|
|
|
|
+ if (result.data.success) {
|
|
|
|
+ $scope.showMsg('成功', result.data.msg);
|
|
|
|
+ //重新刷新列表
|
|
|
|
+ $scope.loadData();
|
|
|
|
+ $scope.$hide();
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ $scope.showMsg('失败', result.data.msg);
|
|
|
|
+ }
|
|
|
|
+ }, function (resp) {
|
|
|
|
+ $loading.hide();
|
|
|
|
+ $scope.showMsg('错误', '服务器错误');
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ };
|
|
|
|
+ editCtrl.$inject = ['$scope', '$http','$partySelect'];
|
|
|
|
+ //定义模态框
|
|
|
|
+ var editModal = $modal({
|
|
|
|
+ resolve: {
|
|
|
|
+ load: ['$ocLazyLoad', function ($ocLazyLoad) {
|
|
|
|
+ }]
|
|
|
|
+ },
|
|
|
|
+ scope: $scope,
|
|
|
|
+ controller: editCtrl,
|
|
|
|
+ templateUrl: '../main/party/checkNameList/edit.html',
|
|
|
|
+ show: false,
|
|
|
|
+ animation: 'am-fade-and-slide-top'
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ //新增编辑
|
|
|
|
+ $scope.add = function () {
|
|
|
|
+ editModal.params = {
|
|
|
|
+ title: '新增名单'
|
|
|
|
+ };
|
|
|
|
+ editModal.data = {};
|
|
|
|
+ editModal.$promise.then(editModal.show);
|
|
|
|
+ };
|
|
|
|
+ $scope.edit = function (id) {
|
|
|
|
+ $http.get("../../api/checkdata/getCheckName", {
|
|
|
|
+ params: {
|
|
|
|
+ 'id': id
|
|
|
|
+ }
|
|
|
|
+ }).then(function (result) {
|
|
|
|
+ if (result.data.item) {
|
|
|
|
+ editModal.data = result.data.item;
|
|
|
|
+ editModal.params = {
|
|
|
|
+ title: '修改名单'
|
|
|
|
+ };
|
|
|
|
+ editModal.$promise.then(editModal.show);
|
|
|
|
+ } else {
|
|
|
|
+ $scope.showMsg('错误', result.data.msg);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ $scope.delete = function (id) {
|
|
|
|
+ if (confirm("是否确定删除?")) {
|
|
|
|
+ $http({
|
|
|
|
+ url: "../../api/checkdata/deleteCheckNameList",
|
|
|
|
+ method: 'post',
|
|
|
|
+ data: {nameIdList: [id]}
|
|
|
|
+ }).then(function (result) {
|
|
|
|
+ $scope.showMsg("消息", result.data.msg);
|
|
|
|
+ if (result.data.success) {
|
|
|
|
+ $scope.loadData();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ $scope.changeStatus = function (id,status) {
|
|
|
|
+
|
|
|
|
+ $http({
|
|
|
|
+ url: "../../api/checkdata/changeCheckNameListStatus",
|
|
|
|
+ method: 'post',
|
|
|
|
+ data: {nameIdList: id,recordStatus:status}
|
|
|
|
+ }).then(function (result) {
|
|
|
|
+ $scope.showMsg("消息", result.data.msg);
|
|
|
|
+ if (result.data.success) {
|
|
|
|
+ $scope.loadData();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ $scope.disable=()=>{
|
|
|
|
+ var nameidList = $scope.dataList.filter(it => it.rowChecked == true).map(it => it.nameid);
|
|
|
|
+
|
|
|
|
+ if (nameidList.length == 0) {
|
|
|
|
+ $scope.showMsg('消息', "请选择需要禁用的数据");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ $scope.changeStatus(nameidList,0);
|
|
|
|
+ }
|
|
|
|
+ $scope.enable=()=>{
|
|
|
|
+ var nameidList = $scope.dataList.filter(it => it.rowChecked == true).map(it => it.nameid);
|
|
|
|
+
|
|
|
|
+ if (nameidList.length == 0) {
|
|
|
|
+ $scope.showMsg('消息', "请选择需要启用的数据");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ $scope.changeStatus(nameidList,1);
|
|
|
|
+ }
|
|
|
|
+ $scope.export = function () {
|
|
|
|
+ if ($scope.selectparams.dzzdm != "") {
|
|
|
|
+ var params = "?1=1";
|
|
|
|
+ for (var p in $scope.selectparams) {
|
|
|
|
+ if ($scope.selectparams[p] !== '' && $scope.selectparams[p] !== null)
|
|
|
|
+ params += ("&" + p + "=" + encodeURI($scope.selectparams[p]));
|
|
|
|
+ }
|
|
|
|
+ window.open('../../api/partyTowExt/exportZtdrxx' + params);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ $scope.showMsg = function (title, content) {
|
|
|
|
+ $alert({
|
|
|
|
+ title: title + ':',
|
|
|
|
+ content: content,
|
|
|
|
+ placement: 'top',
|
|
|
|
+ type: 'info',
|
|
|
|
+ show: true,
|
|
|
|
+ duration: 3
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ };
|
|
|
|
+ $scope.isShowClick = function(){
|
|
|
|
+ $scope.isShow=!$scope.isShow;
|
|
|
|
+ if($scope.moreTxt == "更多")
|
|
|
|
+ {
|
|
|
|
+ $scope.moreTxt = "收起";
|
|
|
|
+ }
|
|
|
|
+ else if($scope.moreTxt == "收起")
|
|
|
|
+ {
|
|
|
|
+ $scope.moreTxt = "更多";
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ $scope.setisunfold = function () {
|
|
|
|
+ $scope.selectparams.isunfold = !$scope.selectparams.isunfold;
|
|
|
|
+ $scope.$emit('menudatas.toggle', !$scope.selectparams.isunfold);
|
|
|
|
+ };
|
|
|
|
+ $scope.reset = function () {
|
|
|
|
+
|
|
|
|
+ $scope.selectparams.year = null;
|
|
|
|
+ $scope.selectparams.quarter = null;
|
|
|
|
+ $scope.selectparams.selectdzzmc = '';
|
|
|
|
+ $scope.selectparams.checkUserName ='';
|
|
|
|
+ $scope.selectparams.partyName = '';
|
|
|
|
+ $scope.selectparams.partyCode = '';
|
|
|
|
+ $scope.selectparams.recordStatus = null;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+})(angular);
|