|
@@ -5,7 +5,8 @@
|
|
|
|
|
|
|
|
|
$scope.loginUserId = AuthUser.getUser().Id;
|
|
|
- $scope.dataList = [];
|
|
|
+ $scope.partyList = [];
|
|
|
+ $scope.meetingTargetList = [];
|
|
|
$scope.yearList = [];
|
|
|
$scope.quarterList = [];
|
|
|
$scope.selectparams = {
|
|
@@ -13,12 +14,12 @@
|
|
|
selectdzzmc: '',
|
|
|
defaultselected: $state.params.dzzdm,
|
|
|
pageindex: 1,
|
|
|
- pagesize: 10,
|
|
|
+ pagesize: 1000,
|
|
|
dzzdm: '',
|
|
|
- zzfbType: null,
|
|
|
- isunfold:false,
|
|
|
+ isunfold: false
|
|
|
};
|
|
|
$scope.pageInfo = {ptotal: 0, mergetotal: 0};
|
|
|
+ $scope.shyklxList = [];
|
|
|
|
|
|
|
|
|
$scope.$watch("selectparams.pageindex", function (newVal, oldVal) {
|
|
@@ -30,34 +31,46 @@
|
|
|
$scope.$watch("selectparams.selectdzzdm", function (newVal, oldVal) {
|
|
|
if (newVal != "") {
|
|
|
$scope.selectparams.dzzdm = $scope.selectparams.selectdzzdm;
|
|
|
- $scope.loadData();
|
|
|
- }
|
|
|
- });
|
|
|
- $scope.$watch("selectparams.zzfbType", function (newVal, oldVal) {
|
|
|
- if (newVal != oldVal) {
|
|
|
- $scope.loadData();
|
|
|
+ $scope.getPartyList();
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
|
|
|
$scope.search = function () {
|
|
|
- $scope.loadData();
|
|
|
+ $scope.getPartyList();
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.getPartyList = function () {
|
|
|
+ $http
|
|
|
+ ({
|
|
|
+ method: 'get', url: '../../api/party/getPartyList', params: $scope.selectparams
|
|
|
+ }).then(function (result) {
|
|
|
+ $scope.partyList = result.data.item.list;
|
|
|
+ $scope.getTargetList();
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
|
|
|
- $scope.loadData = function () {
|
|
|
+ $scope.getTargetList = function () {
|
|
|
$http
|
|
|
({
|
|
|
- method: 'get', url: '../../api/shyk/getPartyPlanList', params: $scope.selectparams
|
|
|
+ method: 'get', url: '../../api/shyk/getMeetingTargetList', params: $scope.selectparams
|
|
|
}).then(function (result) {
|
|
|
- $loading.hide();
|
|
|
- $scope.dataList = result.data.item.list;
|
|
|
- $scope.pageInfo.ptotal = result.data.item.total;
|
|
|
+ $scope.meetingTargetList = result.data.item;
|
|
|
}, function (resp) {
|
|
|
- $loading.hide();
|
|
|
$scope.showMsg('错误', '服务器错误');
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ $scope.getSettingTitle = function (partyCode, type) {
|
|
|
+ const settingVo = $scope.meetingTargetList.filter(e => e.shyktype === type && e.partycode === partyCode);
|
|
|
+ return settingVo.length > 0 ? settingVo[0].targetName : '/';
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.isSetting = function (partyCode) {
|
|
|
+ return $scope.meetingTargetList.filter(e => e.partycode === partyCode).length > 0;
|
|
|
+ };
|
|
|
+
|
|
|
$scope.exportData = function () {
|
|
|
if ($scope.selectparams.dzzdm != "" && $scope.selectparams.dzzdm != AuthUser.getUser().gddwdm) {
|
|
|
var params = "?1=1";
|
|
@@ -70,47 +83,43 @@
|
|
|
};
|
|
|
|
|
|
var editCtrl = function ($scope, $http, AuthUser) {
|
|
|
- $scope.modalData = $scope.$parent.$parent.modalData;
|
|
|
- $scope.modalData.partycode = $scope.modalData.PARTYCODE;
|
|
|
- $scope.modalData.partyname = $scope.modalData.PARTYNAME;
|
|
|
- $scope.modalData.createuserid = AuthUser.getUser().Id;
|
|
|
- $scope.modalData.updateuserid = AuthUser.getUser().Id;
|
|
|
- $scope.modalData.createusername = AuthUser.getUser().Name;
|
|
|
- $scope.modalData.updateusername = AuthUser.getUser().Name;
|
|
|
- $scope.modalData.plantypeUser = $scope.modalData.PLANTYPEUSER == undefined ? "" : $scope.modalData.PLANTYPEUSER.toString();
|
|
|
- $scope.modalData.plantypeBranch = $scope.modalData.PLANTYPEBRANCH == undefined ? "" : $scope.modalData.PLANTYPEBRANCH.toString();
|
|
|
- $scope.modalData.plantypeGroup = $scope.modalData.PLANTYPEGROUP == undefined ? "" : $scope.modalData.PLANTYPEGROUP.toString();
|
|
|
- $scope.modalData.plantypeClass = $scope.modalData.PLANTYPECLASS == undefined ? "" : $scope.modalData.PLANTYPECLASS.toString();
|
|
|
+ $scope.partyCode = cdModal.params.partyCode;
|
|
|
+ $scope.partyName = cdModal.params.partyName;
|
|
|
+ $scope.settingList = cdModal.params.settingList;
|
|
|
$scope.numList = [];
|
|
|
|
|
|
$scope.getNumList = function () {
|
|
|
$http({
|
|
|
method: 'get',
|
|
|
- url: '../../api/dictionary/GetDictionaryList',
|
|
|
+ url: '../../api/dictionary/getDictionaryListByDicTypeKey',
|
|
|
params: {dicTypeKey: 'SHYK_PartyPlan'}
|
|
|
}).then(function (result) {
|
|
|
- $scope.numList = result.data.item.list;
|
|
|
+ $scope.numList = result.data;
|
|
|
}, function (resp) {
|
|
|
});
|
|
|
};
|
|
|
- $scope.submitForm = function (isflag) {
|
|
|
+ $scope.saveTarget = function (isflag) {
|
|
|
if (isflag) {
|
|
|
+ $loading.show();
|
|
|
$http({
|
|
|
method: "post",
|
|
|
url: "../../api/shyk/savePartyPlan",
|
|
|
- data: $scope.modalData
|
|
|
+ data: {
|
|
|
+ partyCode: $scope.partyCode,
|
|
|
+ settingList: JSON.stringify($scope.settingList)
|
|
|
+ }
|
|
|
}).then(function (result) {
|
|
|
$loading.hide();
|
|
|
- $scope.showMsg('成功', result.data.msg);
|
|
|
if (result.data.success) {
|
|
|
+ $scope.showMsg('成功', '提交成功');
|
|
|
|
|
|
- $scope.loadData();
|
|
|
+ $scope.getTargetList();
|
|
|
$scope.$hide();
|
|
|
}
|
|
|
|
|
|
- }), function (resp) {
|
|
|
+ }, function (resp) {
|
|
|
$scope.showMsg('错误', '服务器错误');
|
|
|
- }
|
|
|
+ })
|
|
|
}
|
|
|
};
|
|
|
$scope.getNumList();
|
|
@@ -124,44 +133,71 @@
|
|
|
show: false,
|
|
|
animation: 'am-fade-and-slide-top'
|
|
|
});
|
|
|
- $scope.modalData = {};
|
|
|
- $scope.edit = function (it) {
|
|
|
- $scope.modalData = it;
|
|
|
+
|
|
|
+ $scope.edit = function (partyCode, partyName) {
|
|
|
+ const settingList = [];
|
|
|
+ $scope.shyklxList.forEach(type => {
|
|
|
+ const settingVo = {
|
|
|
+ shyktype: type.dickey,
|
|
|
+ shykTypeName: type.dicvalue,
|
|
|
+ targettype: null
|
|
|
+ }
|
|
|
+
|
|
|
+ const settingData = $scope.meetingTargetList.filter(e => e.partycode === partyCode && e.shyktype === type.dickey);
|
|
|
+ if (settingData.length > 0) {
|
|
|
+ settingVo.targettype = settingData[0].targettype;
|
|
|
+ }
|
|
|
+
|
|
|
+ settingList.push(settingVo);
|
|
|
+ });
|
|
|
+
|
|
|
+ cdModal.params = {
|
|
|
+ partyCode: partyCode,
|
|
|
+ partyName: partyName,
|
|
|
+ settingList: settingList
|
|
|
+ };
|
|
|
cdModal.$promise.then(cdModal.show);
|
|
|
};
|
|
|
|
|
|
var multiCtrl = function ($scope, $http, AuthUser) {
|
|
|
- $scope.dataModel={};
|
|
|
$scope.numList = [];
|
|
|
+ $scope.settingList = multiModal.params.settingList;
|
|
|
+
|
|
|
$scope.getNumList = function () {
|
|
|
$http({
|
|
|
method: 'get',
|
|
|
- url: '../../api/dictionary/GetDictionaryList',
|
|
|
+ url: '../../api/dictionary/getDictionaryListByDicTypeKey',
|
|
|
params: {dicTypeKey: 'SHYK_PartyPlan'}
|
|
|
}).then(function (result) {
|
|
|
- $scope.numList = result.data.item.list;
|
|
|
+ $scope.numList = result.data;
|
|
|
}, function (resp) {
|
|
|
});
|
|
|
};
|
|
|
- $scope.save = function (isflag) {
|
|
|
+ $scope.saveTargetMulti = function (isflag) {
|
|
|
if (isflag) {
|
|
|
+ $loading.show();
|
|
|
$http({
|
|
|
method: "post",
|
|
|
url: "../../api/shyk/savePartyPlanMulti",
|
|
|
data: {
|
|
|
- dataModel:$scope.dataModel,
|
|
|
- dataDzzdm:AuthUser.getUser().DataDzzdm
|
|
|
+ dataModel: $scope.dataModel,
|
|
|
+ dataDzzdm: AuthUser.getUser().DataDzzdm,
|
|
|
+ settingList: JSON.stringify($scope.settingList)
|
|
|
}
|
|
|
}).then(function (result) {
|
|
|
$loading.hide();
|
|
|
- $scope.showMsg('成功', result.data.msg);
|
|
|
if (result.data.success) {
|
|
|
+ $scope.showMsg('成功', '提交成功');
|
|
|
|
|
|
- $scope.loadData();
|
|
|
+ $scope.getTargetList();
|
|
|
$scope.$hide();
|
|
|
}
|
|
|
+ else{
|
|
|
+ $scope.showMsg('失败', result.data.msg);
|
|
|
+ }
|
|
|
|
|
|
}, function (resp) {
|
|
|
+ $loading.hide();
|
|
|
$scope.showMsg('错误', '服务器错误');
|
|
|
})
|
|
|
}
|
|
@@ -178,24 +214,40 @@
|
|
|
animation: 'am-fade-and-slide-top'
|
|
|
});
|
|
|
$scope.editMulti = function (it) {
|
|
|
+ const settingList = $scope.shyklxList.map(e => {
|
|
|
+ return {
|
|
|
+ shyktype: e.dickey,
|
|
|
+ shykTypeName: e.dicvalue,
|
|
|
+ targettype: null
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ multiModal.params = {
|
|
|
+ settingList: settingList
|
|
|
+ };
|
|
|
multiModal.$promise.then(multiModal.show);
|
|
|
};
|
|
|
|
|
|
-
|
|
|
$scope.setisunfold = function () {
|
|
|
$scope.selectparams.isunfold = !$scope.selectparams.isunfold;
|
|
|
$scope.$emit('menudatas.toggle', !$scope.selectparams.isunfold);
|
|
|
};
|
|
|
- $scope.showMsg = function (title, content) {
|
|
|
- $alert({
|
|
|
- title: title + ':',
|
|
|
- content: content,
|
|
|
- placement: 'top',
|
|
|
- type: 'info',
|
|
|
- show: true,
|
|
|
- duration: 3
|
|
|
- });
|
|
|
|
|
|
+ $scope.getShyklxList = function () {
|
|
|
+ $http({
|
|
|
+ method: 'get',
|
|
|
+ url: '../../api/dictionary/getDictionaryListByDicTypeKey',
|
|
|
+ params: {
|
|
|
+ dicTypeKey: 'shykType'
|
|
|
+ }
|
|
|
+ }).then(function (result) {
|
|
|
+ $scope.shyklxList = result.data;
|
|
|
+ }, function (resp) {
|
|
|
+
|
|
|
+ });
|
|
|
};
|
|
|
+
|
|
|
+ $scope.getShyklxList();
|
|
|
+
|
|
|
});
|
|
|
})(angular);
|