Selaa lähdekoodia

修改规格书编辑

shenjj 7 vuotta sitten
vanhempi
commit
51dd8d3b6a

+ 16 - 15
src/main/webapp/resources/js/admin/controllers/AuditRegulpicListCtrl.js

@@ -2,7 +2,8 @@ define([ 'app/app' ], function(app) {
   //品牌审批
   app.register.controller('AuditRegulpicListCtrl', ['$scope', '$modal', 'BaseService', 'toaster', 'ngTableParams', 'StoreAdminListInformation',
     function ($scope, $modal, BaseService, toaster, ngTableParams, StoreAdminListInformation) {
-    $scope.storeStatus = 'all'
+    $scope.storeStatus = 'all';
+    $scope.keyword = ''
     $scope.storeTableParams = new ngTableParams({
       page : 1,
       count : 10
@@ -94,12 +95,18 @@ define([ 'app/app' ], function(app) {
      * 审核通过 回调
      */
     function passAudit(data, item) {
+      console.log(data)
       // 是否需要打开规格书选择项
-      if (data.mallAttach !== '') {
-        openRegulChooseModal(data, item).then(function (reason) {
-          // 刷新页面
-          $scope.storeTableParams.page(1);
-          $scope.storeTableParams.reload();
+      if (data.code === 1) {
+        openRegulChooseModal(data, item).then(function (data) {
+          if (data.success) {
+            toaster.pop('success', '操作成功')
+            // 刷新页面
+            $scope.storeTableParams.page(1);
+            $scope.storeTableParams.reload();
+          } else {
+
+          }
         }, function (error) {
           console.log(error);
         });
@@ -307,19 +314,13 @@ define([ 'app/app' ], function(app) {
      * 保存不通过原因
      */
     function saveReason() {
-      // if (!$scope.reason || $scope.reason === '') {
-      //   toaster.pop('error', '请填写审核不通过原因');
-      //   return ;
-      // }
-      // 请求保存规格书接口
-      // alert($scope.checked)
       var chooseAttach = ''
       if ($scope.checked === 'store') {
-        chooseAttach = responseData.mallAttach
+        chooseAttach = responseData.data.mallAttach
       } else {
-        chooseAttach = item.uploadAttach
+        chooseAttach = responseData.data.uploadAttach
       }
-      StoreAdminListInformation.chooseAttach({}, {chooseAttach: chooseAttach, submit: responseData}, function(data) {
+      StoreAdminListInformation.chooseAttach({}, {chooseAttach: chooseAttach, submit: item}, function(data) {
         $modalInstance.close(data);
       })
 

+ 3 - 3
src/main/webapp/resources/js/vendor/app.js

@@ -1141,13 +1141,13 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
   app.controller('editRegulationCtrl', ['$scope', 'Regulpic', '$modalInstance','showAction', 'Search', 'ChooseItem', function ($scope, Regulpic, $modalInstance, showAction, Search, ChooseItem) {
     $scope.iniUrlImg = 'static/img/vendor/images/upload_file_icon.png'
     $scope.Regulpic = Regulpic;
-    $scope.showAction = showAction || false
-	  $scope.IsLookOrUpdate = 'update'// 编辑还是查看
+    $scope.showAction = showAction || false  // 个人产品库和企业产品 还是在售产品
+	  $scope.IsLookOrUpdate = ChooseItem.standard === 1 ? 'look' : 'update' // 编辑还是查看
     $scope.brandcode = ChooseItem.pbranden || ChooseItem.pbrand || ($scope.IsLookOrUpdate === 'update' ? '' : '-') // 品牌
     $scope.BrandList = [] // 品牌数组
 	  $scope.kind = ChooseItem.kind || ChooseItem.kinden || '-' // 类目
     $scope.spec = ChooseItem.spec || '' // 规格
-    $scope.cmpcode = ChooseItem.cmpUuId || ChooseItem.pcmpcode || ($scope.IsLookOrUpdate === 'update' ? '' : '-') // 型号
+    $scope.cmpcode = ChooseItem.pcmpcode || ($scope.IsLookOrUpdate === 'update' ? '' : '-') // 型号
     $scope.CodeList = [] // 型号数组
 	  $scope.RegulChange = true // 规格书是否可以编辑
 	  $scope.RegulpicUrl = ChooseItem.Regulpic

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

@@ -3428,10 +3428,18 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
         }
       });
       modalInstance.result.then(function (item) {
-      	var str = JSON.stringify(item)
-        $http.post('trade/products/update/product?url=' + item.url, str).success(function(response){
-        	console.log(response)
-        })
+      	if (item) {
+          var str = JSON.stringify(item)
+          $http.post('trade/products/update/product?attachUrl=' + item.url,
+              str).success(function (response) {
+            if (response.success) {
+              toaster.pop('success', '提交成功');
+              loadData()
+            } else {
+              toaster.pop('error', response.message);
+            }
+          })
+        }
       }, function() {
 
       });

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

@@ -2855,10 +2855,18 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
         }
       });
       modalInstance.result.then(function (item) {
-        var str = JSON.stringify(item)
-        $http.post('trade/products/update/product?url=' + item.url, str).success(function(response){
-          console.log(response)
-        })
+        if (item) {
+          var str = JSON.stringify(item)
+          $http.post('trade/products/update/product?attachUrl=' + item.url,
+              str).success(function (response) {
+            if (response.success) {
+              toaster.pop('success', '提交成功');
+              loadData()
+            } else {
+              toaster.pop('error', response.message);
+            }
+          })
+        }
       }, function() {
 
       });

+ 2 - 2
src/main/webapp/resources/view/admin/modal/auditRegulpic_choose_modal.html

@@ -43,14 +43,14 @@
           <input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="store" ng-checked="checked === 'store'" ng-click="checked = 'store'">
           商城规格书
         </label>
-        <div style="margin: 10px 0"><a href="{{responseData.mallAttach}}" target="_blank"><img src="static/img/vendor/images/pdf.png" style="width:31px;height:35px;" /></a></div>
+        <div style="margin: 10px 0"><a href="{{responseData.data.mallAttach}}" target="_blank"><img src="static/img/vendor/images/pdf.png" style="width:31px;height:35px;" /></a></div>
       </div>
       <div class="col-sm-6">
         <label class="radio-inline">
           <input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="user"  ng-checked="checked === 'user'" ng-click="checked = 'user'">
           用户上传规格书
         </label>
-        <div style="margin: 10px 0"><a href="{{item.uploadAttach}}" target="_blank"><img src="static/img/vendor/images/pdf.png" style="width:31px;height:35px;" /></a></div>
+        <div style="margin: 10px 0"><a href="{{responseData.data.uploadAttach}}" target="_blank"><img src="static/img/vendor/images/pdf.png" style="width:31px;height:35px;" /></a></div>
       </div>
     </div>
     <div class="form-group">

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

@@ -2102,7 +2102,7 @@
 						</td>
 						<td style="overflow: initial;">
 							<div class="Regulpic">
-								<a href="{{goods.Regulpic}}" target="_blank" ng-if="goods.Regulpic" class="Regulpica">
+								<a href="{{material.productAttachSubmit.uploadAttach}}" target="_blank" ng-if="material.productAttachSubmit" class="Regulpica">
 									<span style="cursor: pointer;">
 										<img style="width:24px;height:26px;border: 0px" src="static/img/vendor/images/pdf.png"/>
 										<div style="position: relative;display: inline-block" class="ToforAdminLook">
@@ -2111,7 +2111,7 @@
 										</div>
 									</span>
 								</a>
-								<div ng-if="!goods.Regulpic">
+								<div ng-if="material.productAttachSubmit && !material.productAttachSubmit.uploadAttach">
 									-
 								</div>
 							</div>
@@ -2126,7 +2126,7 @@
 								<!--<span>查看</span></span>/<span ng-click="setActiveIndex($index,material)"><span>编辑可替代型号</span>-->
 						  </span>
 							<span name="delete-material" ng-show="!isBatch && !material.exPandOper && !material.addGoodsOper" ng-click="deleteMaterial(material)"><span>删除</span></span>
-							<span ng-click="editRegulPicture(goods.Regulpic || 'static/img/vendor/images/upload_file_icon.png', material)">
+							<span ng-click="editRegulPicture(material.productAttachSubmit.uploadAttach || 'static/img/vendor/images/upload_file_icon.png', material)">
 								<span>编辑物料</span>
 							</span>
 							<!---->

+ 3 - 3
src/main/webapp/resources/view/vendor/forstore/vendor_material_person.html

@@ -1917,7 +1917,7 @@
 						<!-- 新增规格书字段 -->
 						<td style="overflow: initial;">
 							<div class="Regulpic">
-								<a href="{{goods.Regulpic}}" target="_blank" ng-if="goods.Regulpic" class="Regulpica">
+								<a href="{{material.productAttachSubmit.uploadAttach}}" target="_blank" ng-if="material.productAttachSubmit" class="Regulpica">
 									<span style="cursor: pointer;">
 										<img style="width:24px;height:26px;border: 0px" src="static/img/vendor/images/pdf.png"/>
 										<div style="position: relative;display: inline-block" class="ToforAdminLook">
@@ -1926,7 +1926,7 @@
 										</div>
 									</span>
 								</a>
-								<div ng-if="!goods.Regulpic">
+								<div ng-if="material.productAttachSubmit && !material.productAttachSubmit.uploadAttach">
 									-
 								</div>
 							</div>
@@ -1939,7 +1939,7 @@
 							<!--收起-->
 							<span ng-show="!isBatch && material.exPandOper" ng-click="disExpandGoods(material)" class="packUp"><span>收起<i class="fa fa-angle-up" style="margin-left:2px;"></i></span></span>
 							<span ng-click="setActiveIndex($index,material)"><span>编辑可替代型号</span></span>
-							<span  ng-click="editRegulPicture(goods.Regulpic || 'static/img/vendor/images/upload_file_icon.png', material)">
+							<span  ng-click="editRegulPicture(material.productAttachSubmit.uploadAttach || 'static/img/vendor/images/upload_file_icon.png', material)">
 								<span>编辑物料</span>
 							</span>
 							<!--<a ng-show="!isBatch" ng-click="showShelfArea(material)"><span ng-if="!isBatch">编辑</span></a>-->

+ 3 - 3
src/main/webapp/resources/view/vendor/modal/edit_regul_modal.html

@@ -251,7 +251,7 @@
               </ul>
             </div>
             <div ng-show="IsLookOrUpdate === 'look'" style="width: 180px;height: 28px">
-              物料品牌
+              {{brandcode}}
             </div>
           </div>
           </div>
@@ -267,7 +267,7 @@
                        class="form-control" maxlength="20"/>
               </div>
               <div ng-show="IsLookOrUpdate === 'look'" style="width: 180px;height: 28px">
-                物料名称
+                {{kind}}
               </div>
             </div>
           </div>
@@ -292,7 +292,7 @@
                 </ul>
               </div>
               <div ng-show="IsLookOrUpdate === 'look'" style="width: 180px;height: 28px">
-                物料型号
+                {{cmpcode}}
               </div>
             </div>
           </div>