Merge branch 'develop'

master
taylor.dang 6 years ago
commit d11df5467d

@ -5,7 +5,7 @@
<parent>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId>
<version>0.2.0</version>
<version>0.2.0-dev</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -109,21 +109,24 @@ public class PermissionPartnerManagerImpl implements PermissionPartnerManager {
mod.put("funcs", funcList);
modules.add(mod);
}
report.put("modules", modules);
return report;
}
@Override
@Transactional
public void permissionClientModuleSave(int clientId, String clientMoniker) {
permissionClientModulesService.removeByClientMoniker(clientMoniker);
List<JSONObject> moduleId = permissionPartnerModuleMapper.list();
for (JSONObject moduleClientAdd : moduleId) {
moduleClientAdd.put("client_id", clientId);
moduleClientAdd.put("client_moniker", clientMoniker);
moduleClientAdd.put("module_id", moduleClientAdd.getString("id"));
moduleClientAdd.put("is_valid", true);
moduleClientAdd.put("is_valid", moduleClientAdd.getBoolean("initialize"));
permissionClientModulesService.save(moduleClientAdd);
}
systemPackageCacheSupport.clearClientPermission(clientMoniker);
systemPackageCacheSupport.clearClientPermission(clientId);
}
@ -152,13 +155,10 @@ public class PermissionPartnerManagerImpl implements PermissionPartnerManager {
permissionClientModulesService.save(clientMod);
}
}
module.initObject(mod);
permissionPartnerModuleMapper.update(mod);
sysPermissionClientModulesMapper.updateFunctionValid(mod.getString("id"),mod.getBooleanValue("initialize"));
systemPackageCacheSupport.clearClientPermissionAll();
// sysPermissionClientModulesMapper.updateFunctionValid(mod.getString("id"), mod.getBooleanValue("initialize"));
// systemPackageCacheSupport.clearClientPermissionAll();
}
@Override
@ -214,7 +214,6 @@ public class PermissionPartnerManagerImpl implements PermissionPartnerManager {
@Transactional
@CacheEvict(value = ":login:partners:", allEntries = true)
public void authorizeRole(PartnerRole role, List<String> functions) {
permissionPartnerFunctionMapper.clearRolePermission(role.getCode());
permissionPartnerFunctionMapper.authorizeRole(role.getCode(), functions);
}

@ -1,6 +1,8 @@
package au.com.royalpay.payment.manage.management.sysconfig.web;
import au.com.royalpay.payment.manage.management.sysconfig.beans.PermissionClientVO;
import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionPartnerManager;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.system.core.PermissionClientModulesService;
import au.com.royalpay.payment.tools.CommonConsts;
@ -26,6 +28,10 @@ import javax.annotation.Resource;
public class SysPermissionClientController {
@Resource
private PermissionClientModulesService permissionClientModulesService;
@Resource
private PermissionPartnerManager permissionPartnerManager;
@Resource
private ClientManager clientManager;
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ -38,4 +44,11 @@ public class SysPermissionClientController {
permissionClientModulesService.switchValid(id,permissionClientVO.getIsValid(),loginManager);
}
@RequestMapping(value = "/init", method = RequestMethod.POST)
public void init(@RequestBody JSONObject param) {
JSONObject client = clientManager.getClientInfoByMoniker(param.getString("client_moniker"));
permissionPartnerManager.permissionClientModuleSave(client.getIntValue("client_id"),client.getString("client_moniker"));
}
}

@ -24,6 +24,8 @@ public interface SysPermissionClientModulesMapper {
void delete(@Param("module_name") String moduleName);
void deleteByClientMoniker(@Param("client_moniker") String client_moniker);
@AutoSql(type = SqlType.SELECT)
List<JSONObject> listByClientId(@Param("client_id") int client_id);

@ -111,6 +111,8 @@ public class ManagerUserInterceptor extends HandlerInterceptorAdapter implements
if(func!=null && StringUtils.isNotEmpty(func.getString("module_id"))){
JSONArray arr = loginUser.getJSONArray("available_module_ids");
if (arr == null || !arr.contains(func.getString("module_id"))) {
logger.info(partner.toString());
logger.info(partnerStatusKey);
logger.info(funcId);
throw new ForbiddenException("error.permission.nopermission");
}

@ -19,4 +19,5 @@ public interface PermissionClientModulesService {
void switchValid(Long id,boolean isValid,JSONObject account);
void removeByClientMoniker(String clientMoniker);
}

@ -72,6 +72,11 @@ public class PermissionClientModulesServiceImpl implements PermissionClientModul
}
@Override
public void removeByClientMoniker(String clientMoniker) {
permissionClientModulesMapper.deleteByClientMoniker(clientMoniker);
}
private void saveMongoLog(JSONObject account, JSONObject oldRecord, JSONObject modifyData, String business) {
try {
modifyData.remove("id");

@ -28,4 +28,9 @@
delete from sys_permission_partner_modules_clients
where module_id = (SELECT id from sys_permission_partner_modules where module_name=#{module_name})
</delete>
<delete id="deleteByClientMoniker">
delete from sys_permission_partner_modules_clients
where client_moniker= #{client_moniker}
</delete>
</mapper>

@ -90,38 +90,46 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.uploadLogo = function (file) {
if (file != null) {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'});
} else {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadShopPhoto = function (file) {
if (file != null) {
$scope.photoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.photoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.photoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.photoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'});
} else {
$scope.photoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.photoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.photoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.photoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};

@ -90,38 +90,46 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
};
$scope.uploadLogo = function (file) {
if (file != null) {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'});
} else {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadShopPhoto = function (file) {
if (file != null) {
$scope.photoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.photoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.photoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.photoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'});
} else {
$scope.photoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.photoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.photoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.photoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
@ -176,37 +184,45 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
//audit files
$scope.uploadBankFile = function (file) {
if (file != null) {
$scope.bankFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.bankFileProgress;
$scope.partner.file.file_bank_info = resp.data.url;
}, function (resp) {
delete $scope.bankFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.bankFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'});
} else {
$scope.bankFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.bankFileProgress;
$scope.partner.file.file_bank_info = resp.data.url;
}, function (resp) {
delete $scope.bankFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.bankFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadCompanyFile = function (file) {
if (file != null) {
$scope.companyFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.companyFileProgress;
$scope.partner.file.file_company_info = resp.data.url;
}, function (resp) {
delete $scope.companyFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.companyFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'});
} else {
$scope.companyFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.companyFileProgress;
$scope.partner.file.file_company_info = resp.data.url;
}, function (resp) {
delete $scope.companyFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.companyFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};

@ -63,7 +63,7 @@
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-success" type="button" ngf-select="uploadLogo($file)"
accept="image/*" ngf-max-size="1MB">
accept="image/*">
<i class="fa fa-upload"></i> Upload Logo
</button>
</div>
@ -110,7 +110,7 @@
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadShopPhoto($file)" accept="image/*" ngf-max-size="2MB">
ngf-select="uploadShopPhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Shop Photo
</button>
</div>

@ -84,7 +84,7 @@
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-success" type="button" ngf-select="uploadLogo($file)"
accept="image/*" ngf-max-size="1MB">
accept="image/*">
<i class="fa fa-upload"></i> Upload Logo
</button>
</div>
@ -186,7 +186,7 @@
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadShopPhoto($file)" accept="image/*" ngf-max-size="2MB">
ngf-select="uploadShopPhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Shop Photo
</button>
</div>
@ -492,7 +492,7 @@
<div class="col-sm-4">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadBankFile($file)" accept="image/*" ngf-max-size="2MB">
ngf-select="uploadBankFile($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload
</button>
</div>
@ -512,7 +512,7 @@
<div class="col-sm-4">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadCompanyFile($file)" accept="image/*" ngf-max-size="2MB">
ngf-select="uploadCompanyFile($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload
</button>
</div>

@ -200,7 +200,7 @@ define(['angular'], function (angular) {
};
}]);
app.controller('merchantConfigDialogCtrl', ['$scope', '$http', 'Upload', 'merchant', function ($scope, $http, Upload, merchant) {
app.controller('merchantConfigDialogCtrl', ['$scope', '$http', 'Upload', 'merchant', 'commonDialog', function ($scope, $http, Upload, merchant, commonDialog) {
$scope.merchant = angular.copy(merchant);
$scope.save = function () {
$scope.errmsg = null;
@ -219,6 +219,10 @@ define(['angular'], function (angular) {
if(!file){
return;
}
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'});
return;
}
$scope.photoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',

@ -10,7 +10,7 @@
<div class="form-group col-xs-12">
<button class="btn btn-success" type="button" ngf-select="uploadShopImg($file)"
accept="image/*" ngf-max-size="1MB">
accept="image/*">
<i class="fa fa-upload"></i> Upload Shop Img
</button>
<uib-progressbar value="photoProgress.value" ng-if="photoProgress"></uib-progressbar>

@ -108,6 +108,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
if (file == null) {
return;
}
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'});
return;
}
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
@ -215,6 +219,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
if (file == null) {
return;
}
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'});
return;
}
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
@ -321,6 +329,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
if (file == null) {
return;
}
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'});
return;
}
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',

@ -24,7 +24,7 @@
<div class="col-sm-8">
<p class="form-control-static">
<button class="btn btn-primary" type="button" ngf-select="uploadLogo($file)"
accept="image/*" ngf-max-size="1MB">
accept="image/*">
<i class="fa fa-upload"></i> Upload
</button>
<uib-progressbar value="logoProgress.value" ng-if="logoProgress"></uib-progressbar>

@ -36,7 +36,7 @@
<div class="col-sm-8">
<p class="form-control-static">
<button class="btn btn-primary" type="button" ngf-select="uploadLogo($file)"
accept="image/*" ngf-max-size="1MB">
accept="image/*">
<i class="fa fa-upload"></i> Upload
</button>
<uib-progressbar value="logoProgress.value" ng-if="logoProgress"></uib-progressbar>

@ -173,7 +173,7 @@
<div class="col-sm-8">
<p class="form-control-static">
<button class="btn btn-primary" type="button" ngf-select="uploadLogo($file)"
accept="image/*" ngf-max-size="1MB">
accept="image/*">
<i class="fa fa-upload"></i> Upload
</button>
<uib-progressbar value="logoProgress.value" ng-if="logoProgress"></uib-progressbar>

@ -51,19 +51,23 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.cashier = {};
$scope.uploadPhoto = function (file) {
if (file != null) {
$scope.photoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.photoProgress;
$scope.cashier.photo = resp.data.url;
}, function (resp) {
delete $scope.photoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.photoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.photoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.photoProgress;
$scope.cashier.photo = resp.data.url;
}, function (resp) {
delete $scope.photoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.photoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.save = function (form) {
@ -178,19 +182,23 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.cashier = angular.copy(cashier.data);
$scope.uploadPhoto = function (file) {
if (file != null) {
$scope.photoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.photoProgress;
$scope.cashier.photo = resp.data.url;
}, function (resp) {
delete $scope.photoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.photoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.photoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.photoProgress;
$scope.cashier.photo = resp.data.url;
}, function (resp) {
delete $scope.photoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.photoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.updateCashier = function (form) {

@ -71,7 +71,7 @@
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadPhoto($file)" accept="image/*" ngf-max-size="2MB">
ngf-select="uploadPhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Courier Photo
</button>
</div>

@ -59,7 +59,7 @@
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadPhoto($file)" accept="image/*" ngf-max-size="2MB">
ngf-select="uploadPhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Cashier Photo
</button>
</div>

@ -93,22 +93,26 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.good.images = [];
$scope.uploadImage = function (file) {
if (file != null) {
$scope.imageProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.imageProgress;
var image = {};
image.fileId = resp.data.fileid;
image.url = resp.data.url;
$scope.good.images.push(image);
}, function (resp) {
delete $scope.imageProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.imageProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'})
} else {
$scope.imageProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.imageProgress;
var image = {};
image.fileId = resp.data.fileid;
image.url = resp.data.url;
$scope.good.images.push(image);
}, function (resp) {
delete $scope.imageProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.imageProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
}]);
@ -172,22 +176,26 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
};
$scope.uploadImage = function (file) {
if (file != null) {
$scope.imageProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.imageProgress;
var image = {};
image.fileId = resp.data.fileid;
image.url = resp.data.url;
$scope.good.images.push(image);
}, function (resp) {
delete $scope.imageProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.imageProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'})
} else {
$scope.imageProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.imageProgress;
var image = {};
image.fileId = resp.data.fileid;
image.url = resp.data.url;
$scope.good.images.push(image);
}, function (resp) {
delete $scope.imageProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.imageProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
}]);

@ -136,7 +136,7 @@
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-success" type="button" ngf-select="uploadImage($file)"
accept="image/*" ngf-max-size="1MB">
accept="image/*">
<i class="fa fa-upload"></i> Upload Image
</button>
</div>

@ -147,7 +147,7 @@
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-success" type="button" ngf-select="uploadImage($file)"
accept="image/*" ngf-max-size="1MB">
accept="image/*">
<i class="fa fa-upload"></i> Upload Image
</button>
</div>

@ -439,56 +439,68 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
};
$scope.uploadLogo = function (file) {
if (file != null) {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'})
} else {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadShopPhoto = function (file) {
if (file != null) {
$scope.shopPhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.shopPhotoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.shopPhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.shopPhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.shopPhotoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.shopPhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadStorePhoto = function (file) {
if (file != null) {
$scope.storePhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.storePhotoProgress;
$scope.partner.store_photo = resp.data.url;
}, function (resp) {
delete $scope.storePhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.storePhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.storePhotoProgress;
$scope.partner.store_photo = resp.data.url;
}, function (resp) {
delete $scope.storePhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
@ -677,24 +689,28 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
};
$scope.uploadAgreeFile = function (file) {
if (file != null) {
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
$scope.agree_file_import = resp.data.url;
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/import/agreepdf', {source_agree_file: $scope.agree_file_import}).then(function () {
commonDialog.alert({
title: 'Success',
content: 'Succeed Imported! Please notify BD',
type: 'success'
});
$state.reload();
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
$scope.agree_file_import = resp.data.url;
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/import/agreepdf', {source_agree_file: $scope.agree_file_import}).then(function () {
commonDialog.alert({
title: 'Success',
content: 'Succeed Imported! Please notify BD',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
})
}, function (resp) {
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
})
}
}
};
$scope.notifyBD = function () {
@ -1093,56 +1109,68 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
};
$scope.uploadLogo = function (file) {
if (file != null) {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'})
} else {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadShopPhoto = function (file) {
if (file != null) {
$scope.shopPhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.shopPhotoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.shopPhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.shopPhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.shopPhotoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.shopPhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadStorePhoto = function (file) {
if (file != null) {
$scope.storePhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.storePhotoProgress;
$scope.partner.store_photo = resp.data.url;
}, function (resp) {
delete $scope.storePhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.storePhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.storePhotoProgress;
$scope.partner.store_photo = resp.data.url;
}, function (resp) {
delete $scope.storePhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
@ -2108,56 +2136,68 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
$scope.uploadLogo = function (file) {
if (file != null) {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'})
} else {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadShopPhoto = function (file) {
if (file != null) {
$scope.shopPhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.shopPhotoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.shopPhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.shopPhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.shopPhotoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.shopPhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadStorePhoto = function (file) {
if (file != null) {
$scope.storePhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.storePhotoProgress;
$scope.partner.store_photo = resp.data.url;
}, function (resp) {
delete $scope.storePhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.storePhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.storePhotoProgress;
$scope.partner.store_photo = resp.data.url;
}, function (resp) {
delete $scope.storePhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.updateMerchantLocation = function () {
@ -3107,6 +3147,14 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
};
$scope.init = function () {
var params = {client_moniker:$scope.partner.client_moniker};
$http.post('/sys/permission/init',params).then(function (resp) {
},function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
})
};
}]);

@ -72,56 +72,68 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
$scope.uploadLogo = function (file) {
if (file != null) {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'})
} else {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadShopPhoto = function (file) {
if (file != null) {
$scope.shopPhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.shopPhotoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.shopPhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.shopPhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.shopPhotoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.shopPhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadStorePhoto = function (file) {
if (file != null) {
$scope.storePhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.storePhotoProgress;
$scope.partner.store_photo = resp.data.url;
}, function (resp) {
delete $scope.storePhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.storePhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.storePhotoProgress;
$scope.partner.store_photo = resp.data.url;
}, function (resp) {
delete $scope.storePhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
@ -223,56 +235,68 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
$scope.uploadLogo = function (file) {
if (file != null) {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'})
} else {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadShopPhoto = function (file) {
if (file != null) {
$scope.shopPhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.shopPhotoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.shopPhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.shopPhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.shopPhotoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.shopPhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadStorePhoto = function (file) {
if (file != null) {
$scope.storePhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.storePhotoProgress;
$scope.partner.store_photo = resp.data.url;
}, function (resp) {
delete $scope.storePhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.storePhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.storePhotoProgress;
$scope.partner.store_photo = resp.data.url;
}, function (resp) {
delete $scope.storePhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};

@ -127,7 +127,7 @@
<div class="form-control-static">
<button class="btn btn-success" type="button"
ngf-select="uploadLogo($file)"
accept="image/*" ngf-max-size="1MB">
accept="image/*">
<i class="fa fa-upload"></i> Upload Logo
</button>
</div>
@ -230,8 +230,7 @@
<div class="col-sm-4">
<div class="form-control-static"><em>1:</em>&nbsp;
<button class="btn btn-primary" type="button"
ngf-select="uploadShopPhoto($file)" accept="image/*"
ngf-max-size="2MB">
ngf-select="uploadShopPhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Shop Photo1
</button>
</div>
@ -242,8 +241,7 @@
<div class="col-sm-4">
<div class="form-control-static"><em>2:</em>&nbsp;
<button class="btn btn-primary" type="button"
ngf-select="uploadStorePhoto($file)" accept="image/*"
ngf-max-size="2MB">
ngf-select="uploadStorePhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Shop Photo2
</button>
</div>

@ -98,7 +98,7 @@
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-success" type="button" ngf-select="uploadLogo($file)"
accept="image/*" ngf-max-size="1MB">
accept="image/*">
<i class="fa fa-upload"></i> Upload Logo
</button>
</div>
@ -188,8 +188,7 @@
<div class="col-sm-4">
<div class="form-control-static"><em>1:</em>&nbsp;
<button class="btn btn-primary" type="button"
ngf-select="uploadShopPhoto($file)" accept="image/*"
ngf-max-size="2MB">
ngf-select="uploadShopPhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Shop Photo1
</button>
</div>
@ -200,8 +199,7 @@
<div class="col-sm-4">
<div class="form-control-static"><em>2:</em>&nbsp;
<button class="btn btn-primary" type="button"
ngf-select="uploadStorePhoto($file)" accept="image/*"
ngf-max-size="2MB">
ngf-select="uploadStorePhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Shop Photo2
</button>
</div>

@ -363,7 +363,7 @@
<div class="form-control-static">
<button class="btn btn-success" type="button"
ngf-select="uploadLogo($file)"
accept="image/*" ngf-max-size="1MB">
accept="image/*">
<i class="fa fa-upload"></i> Upload Logo
</button>
</div>
@ -430,8 +430,7 @@
<div class="col-sm-5">
<div class="form-control-static"><em>1:</em>&nbsp;
<button class="btn btn-primary" type="button"
ngf-select="uploadShopPhoto($file)" accept="image/*"
ngf-max-size="2MB">
ngf-select="uploadShopPhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Shop Photo1
</button>
</div>
@ -443,8 +442,7 @@
<div class="col-sm-5">
<div class="form-control-static"><em>2:</em>&nbsp;
<button class="btn btn-primary" type="button"
ngf-select="uploadStorePhoto($file)" accept="image/*"
ngf-max-size="2MB">
ngf-select="uploadStorePhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Shop Photo2
</button>
</div>

@ -58,7 +58,7 @@
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-success" type="button" ngf-select="uploadLogo($file)"
accept="image/*" ngf-max-size="1MB">
accept="image/*">
<i class="fa fa-upload"></i> Upload Logo
</button>
</div>
@ -105,7 +105,7 @@
<div class="col-sm-5">
<div class="form-control-static"><em>1:</em>&nbsp;
<button class="btn btn-primary" type="button"
ngf-select="uploadShopPhoto($file)" accept="image/*" ngf-max-size="2MB">
ngf-select="uploadShopPhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Shop Photo1
</button>
</div>
@ -116,8 +116,7 @@
<div class="col-sm-5">
<div class="form-control-static"><em>2:</em>&nbsp;
<button class="btn btn-primary" type="button"
ngf-select="uploadStorePhoto($file)" accept="image/*"
ngf-max-size="2MB">
ngf-select="uploadStorePhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Shop Photo2
</button>
</div>

@ -85,7 +85,7 @@
<a role="button" type="button" class="btn btn-success" ng-click="exportAgreegatePDF()">
制作全支付合同</a>
<a role="button" type="button" class="btn btn-warning" ngf-select="uploadAgreeFile($file)"
accept="pdf/*" ngf-max-size="2MB">
accept="pdf/*">
上传合同</a> (通用合同请选择制作合同,非通用合同模板请人工制作合同后上传)
</div>
<div class="btn-group pull-right" role="group" aria-label="...">

@ -166,7 +166,7 @@
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-success" type="button" ngf-select="uploadLogo($file)"
accept="image/*" ngf-max-size="1MB">
accept="image/*">
<i class="fa fa-upload"></i> Upload Logo
</button>
</div>
@ -255,7 +255,7 @@
<div class="col-sm-5">
<div class="form-control-static"><em>1:</em>&nbsp;
<button class="btn btn-primary" type="button"
ngf-select="uploadShopPhoto($file)" accept="image/*" ngf-max-size="2MB">
ngf-select="uploadShopPhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Shop Photo1
</button>
</div>
@ -266,8 +266,7 @@
<div class="col-sm-5">
<div class="form-control-static"><em>2:</em>&nbsp;
<button class="btn btn-primary" type="button"
ngf-select="uploadStorePhoto($file)" accept="image/*"
ngf-max-size="2MB">
ngf-select="uploadStorePhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Shop Photo2
</button>
</div>

@ -1,6 +1,8 @@
<div class="row">
<div class="col-sm-12">
<h3 class="box-title" style="display: inherit">Permissions</h3>
<a role="button" type="button" class="btn btn-success" ng-click="init()">
初始化权限</a>
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-hover table-striped">
<thead>

@ -30,26 +30,30 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
};
$scope.importExcel = function (file) {
if (file != null) {
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
$scope.agree_file_import = resp.data.url;
$http.put('/sys/product/importExcel', {source_agree_file: $scope.agree_file_import}).then(function () {
commonDialog.alert({
title: 'Success',
content: 'Succeed Imported',
type: 'success'
});
$state.reload();
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
$scope.agree_file_import = resp.data.url;
$http.put('/sys/product/importExcel', {source_agree_file: $scope.agree_file_import}).then(function () {
commonDialog.alert({
title: 'Success',
content: 'Succeed Imported',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
})
}, function (resp) {
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
})
}
}
}
};
$scope.deleteProduct = function (product) {
commonDialog.confirm({
title: 'Confirm',

@ -31,7 +31,7 @@
<div class="form-group col-sm-5">
<div class="pull-right">
<button class="btn btn-success" type="button" ngf-select="importExcel($file)"
ngf-max-size="2MB" ng-if="importShow==1">
ng-if="importShow==1">
<i class="fa fa-upload"></i> 导入Excel
</button>
<button role="button" class="btn btn-info" title="Add Product"

Loading…
Cancel
Save