|
|
@@ -4,7 +4,7 @@
|
|
|
*/
|
|
|
define(['app/app'], function (app) {
|
|
|
'use strict';
|
|
|
- app.register.controller('vendor_standardPutOnCtrl', ['$scope', '$rootScope', 'StandardPutOnAdminService', 'ngTableParams', 'BaseService', 'toaster', 'Enterprise', '$q', 'Loading', '$modal', function ($scope, $rootScope, StandardPutOnAdminService, ngTableParams, BaseService, toaster, Enterprise, $q, Loading, $modal) {
|
|
|
+ app.register.controller('vendor_standardPutOnCtrl', ['$scope', '$rootScope', 'StandardPutOnAdminService', 'ngTableParams', 'BaseService', 'toaster', 'Enterprise', '$q', 'Loading', '$modal', 'ConsignmentAgreementRecord', function ($scope, $rootScope, StandardPutOnAdminService, ngTableParams, BaseService, toaster, Enterprise, $q, Loading, $modal, ConsignmentAgreementRecord) {
|
|
|
$rootScope.active = 'vendor_goods';
|
|
|
$scope.keyword = '';
|
|
|
$scope.tab = 'vendor_standardPutOn';
|
|
|
@@ -350,6 +350,25 @@ define(['app/app'], function (app) {
|
|
|
*/
|
|
|
$scope.changeSale = function (standard) {
|
|
|
standard.editIsSelfSale = standard.editSelfSaleNum == 1;
|
|
|
+
|
|
|
+ if (!standard.editIsSelfSale) {
|
|
|
+ ConsignmentAgreementRecord.findRecordOfUser({}, {}, function (record) {
|
|
|
+ if (!record.id) {
|
|
|
+ // 弹出寄售协议弹窗
|
|
|
+ $modal.open({
|
|
|
+ templateUrl : 'static/view/vendor/modal/confirm_consignment_agreement.html',
|
|
|
+ controller : 'ConfirmConsignmentAgreement',
|
|
|
+ size: 'lg'
|
|
|
+ }).result.then(function(){
|
|
|
+ toaster.pop('success', '操作成功');
|
|
|
+ }, function(){
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, function (error) {
|
|
|
+ console.log(error);
|
|
|
+ toaster.pop('error', '系统异常,请联系管理员寻求帮助');
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
@@ -713,4 +732,46 @@ define(['app/app'], function (app) {
|
|
|
$modalInstance.close();
|
|
|
}
|
|
|
}]);
|
|
|
-});
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 店铺寄售协议确认弹框
|
|
|
+ */
|
|
|
+ app.register.controller('ConfirmConsignmentAgreement', ['$scope', '$modalInstance', 'ConsignmentAgreementRecord', 'toaster', function ($scope, $modalInstance, ConsignmentAgreementRecord, toaster) {
|
|
|
+
|
|
|
+ $scope.agreement = false;
|
|
|
+ $scope.article = '';
|
|
|
+
|
|
|
+ ConsignmentAgreementRecord.obtainAConsignmentAgreement({}, {}, function (data) {
|
|
|
+ if (data && data.article) {
|
|
|
+ $scope.article = data.article;
|
|
|
+ }
|
|
|
+ console.log(data);
|
|
|
+ }, function (error) {
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 确认操作
|
|
|
+ */
|
|
|
+ $scope.confirm = function () {
|
|
|
+ ConsignmentAgreementRecord.saveRecordWhenUserAgree({}, {agreement: $scope.agreement}, function (result) {
|
|
|
+ if (result.success) {
|
|
|
+ $modalInstance.close();
|
|
|
+ } else {
|
|
|
+ console.log(result.message);
|
|
|
+ toaster.pop('error', '用户信息异常,请联系管理员寻求帮助');
|
|
|
+ }
|
|
|
+ }, function (error) {
|
|
|
+ console.log(error);
|
|
|
+ toaster.pop('error', '系统异常,请联系管理员寻求帮助');
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 取消操作
|
|
|
+ */
|
|
|
+ $scope.cancel = function () {
|
|
|
+ $modalInstance.dismiss();
|
|
|
+ };
|
|
|
+ }]);
|
|
|
+});
|