Просмотр исходного кода

1、修改当前企业未开店或者寄售不允许选择自营

shenjj 7 лет назад
Родитель
Сommit
69f65a2473

+ 12 - 4
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js

@@ -3768,7 +3768,7 @@ define(['app/app', 'jquery-uploadify'], function(app) {
     }
     $scope.productUpOff = {}
     // 编辑上下架
-    $scope.dateArea = 'formMe';
+    // $scope.dateArea = 'formMe';
     var _item = null
     $scope.editProductUpOff = function(commodity, index) {
       if (commodity.erpReserve === '' ||  commodity.erpReserve === 0 || !commodity.erpReserve) {
@@ -3810,6 +3810,9 @@ define(['app/app', 'jquery-uploadify'], function(app) {
       // $scope.productUpOff.dateArea = $scope.productUpOff.goods.selfSale === 1 ? 'formMe' : 'autoMonth' // 自营还是销售
       commodity.dateArea = $scope.productUpOff.goods.selfSale === 1 ? 'formMe' : 'autoMonth' // 自营还是销售
       if (!$scope.productUpOff.goods.storeid) {
+        $scope.productUpOff.goods.selfSale = 0
+        commodity.dateArea = 'autoMonth'
+      } else {
         $scope.productUpOff.goods.selfSale = 1
         commodity.dateArea = 'formMe'
       }
@@ -3855,13 +3858,18 @@ define(['app/app', 'jquery-uploadify'], function(app) {
       }
     }
     // 选择寄售还是自营
-    $scope.productChangeSelfType = function(num, _type) {
+    $scope.productChangeSelfType = function(num, _type, obj) {
+      if ((!$scope.storeInfo.uuid || $scope.storeInfo.uuid === '33069557578d44e69bd91ad12d28a8d4') && _type === 'formMe'){
+        toaster.pop('warning','提示','您还未开店铺,不能选择自营')
+        obj.dateArea = 'autoMonth'
+        return
+      }
       // $scope.productUpOff.goods.selfSale = num
       // $scope.productUpOff.goods.selfSale = num
       $scope.productUpOff.goods.dateArea = _type
-      // $scope.material.dateArea = _type
+
     }
-    // 上下架保存按钮
+    // 编辑上下架保存按钮
     $scope.productSave = function() {
       $scope.productUpOff.EditMinBuyQty = false
       if (!$scope.productUpOff.goods.minBuyQty || $scope.productUpOff.goods.minBuyQty === 0) {

+ 2 - 2
src/main/webapp/resources/view/vendor/forstore/vendor_material.html

@@ -1432,12 +1432,12 @@
 														<div class="name pull-left">销售方式:</div>
 														<div class="pull-left">
 															<label class="com-check-radio">
-																<input type="radio" id="{{'autoMonth' + $index}}" ng-click="productChangeSelfType(1, 'formMe')" name="date" ng-checked="material.dateArea === 'formMe'">
+																<input type="radio" id="{{'autoMonth' + $index}}" ng-click="productChangeSelfType(1, 'formMe', material)" name="date" ng-model="material.dateArea" value="formMe">
 																<label style="vertical-align: top" for="{{'autoMonth' + $index}}"></label>
 																自营
 															</label>
 															<label class="com-check-radio">
-																<input type="radio" id="{{'autoMonth_' + $index}}" ng-click="productChangeSelfType(2, 'autoMonth')" name="date" ng-checked="material.dateArea === 'autoMonth'">
+																<input type="radio" id="{{'autoMonth_' + $index}}" ng-click="productChangeSelfType(2, 'autoMonth', material)" name="date"   ng-model="material.dateArea" value="autoMonth">
 																<label style="vertical-align: top" for="{{'autoMonth_' + $index}}"></label>
 																寄售
 															</label>