Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function () {
- appModule.controller('common.views.stockIn.createOrEditModal', [
- '$scope', '$uibModalInstance', 'abp.services.app.deliveryOrder', 'abp.services.app.legalEntity', 'abp.services.app.branch', 'abp.services.app.inventory', 'stockInId',
- function ($scope, $uibModalInstance, deliveryOrderService, legalEntityService, branchService, inventoryService, stockInId) {
- var vm = this;
- vm.saving = false;
- vm.stockIn = null;
- vm.legalEntity = [];
- vm.branch = [];
- vm.inventory = [];
- vm.save = function () {
- vm.saving = true;
- deliveryOrderService.createOrUpdateDeliveryOrder({
- stockIn: vm.stockIn
- }).then(function () {
- abp.notify.info(app.localize('SavedSuccessfully'));
- $uibModalInstance.close();
- }).finally(function () {
- vm.saving = false;
- });
- };
- vm.cancel = function () {
- $uibModalInstance.dismiss();
- };
- function init() {
- deliveryOrderService.getDeliveryOrderForEdit({
- id: stockInId
- }).then(function (result) {
- vm.stockIn = result.data.stockIn;
- });
- legalEntityService.getLegalEntities().then(function (result) {
- vm.legalEntity = result.data.items;
- });
- branchService.getBranches().then(function (result) {
- vm.branch = result.data.items;
- });
- inventoryService.getInventories().then(function (result) {
- vm.inventory = result.data.items;
- });
- }
- init();
- }
- ]);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement