Browse Source

修改规格书编辑

shenjj 7 years ago
parent
commit
7ba87fd657

BIN
src/main/webapp/resources/img/vendor/images/upload_file_no_pass.png


+ 9 - 4
src/main/webapp/resources/js/common/directives.js

@@ -779,7 +779,7 @@ define(['angular', 'showdown', 'angular-toaster'], function(angular) {
 			if (!config.file || (typeof config.file != 'object')) return;
 			if (config.success && (typeof config.success != 'function')) return;
 			if (config.error && (typeof config.error != 'function')) return;
-
+			if (!config.maxSize) config.maxSize = 3145728
 			console.log('upload-file', config.file);
 
 			// 检测上传文件的类型
@@ -789,8 +789,12 @@ define(['angular', 'showdown', 'angular-toaster'], function(angular) {
 			}
 
 			// 限制文件的大小
-			if (config.file.size > 3145728) {
-				alert('上传图片的大小不能超过3M');
+			if (config.file.size > Number(config.maxSize)) {
+				if (config.maxSize === 3145728) {
+          alert('上传图片的大小不能超过3M')
+        } else {
+          alert('上传pdf的大小不能超过20M')
+				}
 				//toaster.pop('error', '上传图片的大小不能超过3M');
 				return;
 			}
@@ -908,7 +912,8 @@ define(['angular', 'showdown', 'angular-toaster'], function(angular) {
 							error : function (message) {
 								alert(message);
 								//toaster.pop('error', message);
-							}
+							},
+							maxSize: maxSize
 						});
 					} else {
 						// TODO huxz 兼容IE

+ 2 - 0
src/main/webapp/resources/js/vendor/app.js

@@ -1152,6 +1152,8 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
     $scope.CodeList = [] // 型号数组
 	  $scope.RegulChange = (ChooseItem.standard === 1 && $scope.Ischange) ? false : true // 规格书是否可以编辑
 	  // $scope.RegulpicUrl = ChooseItem.Regulpic
+	  $scope.ChooseItem = ChooseItem
+	  // console.log(ChooseItem.productAttachSubmit.uploadAttach)
     $scope.cancel = function () {
       $modalInstance.close();
     };

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

@@ -1194,7 +1194,10 @@
                                 <!--<span ng-if="!commodity.Regulpic">-</span>-->
                                 <div ng-if="commodity.attach || commodity.productAttachSubmit" style="position: relative;display: inline-block;width: auto;margin-top: 0px" class="ToforAdminLook">
                                     <a style="text-decoration: none;margin: 0px;border-bottom:0px" target="_blank" href="{{commodity.attach || commodity.productAttachSubmit.uploadAttach}}" class="Regulpica">
-                                        <img style="width:24px;height:26px" src="static/img/vendor/images/pdf.png"/>
+                                        <div style="width:24px;height:26px;position: relative">
+                                            <img style="width:24px;height:26px" src="static/img/vendor/images/pdf.png"/>
+                                            <div class="zhezhaodang" ng-if="commodity.productAttachSubmit.uploadAttach"></div>
+                                        </div>
                                     </a>
                                     <img ng-if="commodity.productAttachSubmit.uploadAttach" src="static/img/vendor/images/fireinfo_icon.png" width="18" height="18" style="width:18px;height:18px;border: 0px;margin-left:5px;" class="nopass"/>
                                     <div class="forAdminLook">待审核</div>
@@ -1351,8 +1354,11 @@
                                             <a style="text-decoration: none;margin: 0px;border-bottom:0px" target="_blank" href="{{commodity.attach}}" class="Regulpica" ng-if="commodity.attach">
                                                 <img style="width:24px;height:26px" src="static/img/vendor/images/pdf.png"/>
                                             </a>
-                                            <a class="Regulpica" ng-click="editRegulPicture(commodity.productAttachSubmit.uploadAttach || 'static/img/vendor/images/upload_file_icon.png', commodity)" ng-if="!commodity.attach">
-                                                <img style="width:24px;height:26px" src="static/img/vendor/images/pdf.png"/>
+                                            <a class="Regulpica" ng-click="editRegulPicture(commodity.productAttachSubmit.uploadAttach || 'static/img/vendor/images/upload_file_icon.png', commodity)" ng-if="!commodity.attach" style="margin: 0px">
+                                                <div style="width:24px;height:26px;position: relative">
+                                                    <img style="width:24px;height:26px" src="static/img/vendor/images/pdf.png"/>
+                                                    <div class="zhezhaodang" ng-if="commodity.productAttachSubmit.uploadAttach"></div>
+                                                </div>
                                             </a>
                                             <img ng-if="commodity.productAttachSubmit.uploadAttach" src="static/img/vendor/images/fireinfo_icon.png" width="18" height="18" style="width:18px;height:18px;border: 0px;margin-left:5px;" class="nopass"/>
                                             <div class="forAdminLook">待审核</div>
@@ -1687,6 +1693,16 @@
     .device .wanted_list01 a.Regulpica:hover{
         border-bottom: 0 !important;
     }
+    .zhezhaodang {
+        position: absolute;
+        left: 0;
+        top: 0;
+        width: 24px !important;
+        height: 26px !important;
+        background: url('static/img/vendor/images/upload_file_no_pass.png') no-repeat 0px 0px;
+        background-size: 100% 100%;
+        margin-top: 0px !important;;
+    }
 </style>
 <script>
     $(function(){

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

@@ -35,11 +35,12 @@
     margin-left: 3px;
   }
   .update-img .update-file-btn p{
+    border-top: 1px solid #e4e5e6;
     line-height: 30px;
     position: relative;
     text-align: center;
     margin-top: 8px;
-    height: 30px;
+    padding-top: 10px;
   }
   .update-img .update-file-btn p input{
     width: 80px;
@@ -118,7 +119,7 @@
   .file-text h3{
     line-height: 26px;
     background: #e3e3e6;
-    font-size: 12px;
+    font-size: 14px;
     text-align: center;
     font-weight: bold;
   }
@@ -186,10 +187,11 @@
   .wuliao_list {
     line-height: 28px;
     margin-bottom: 10px;
+    font-size: 14px;
   }
   .wuliao_list .name {
     margin-right: 5px;
-    width: 100px;
+    width: 115px;
     text-align: right;
   }
   .listUl {
@@ -222,12 +224,42 @@
     height: 30px;
     cursor: pointer;
   }
+  .titleP{
+    position: relative;
+    height: 44px;
+    background: #5078cb;
+    line-height: 44px;
+    color: #fff;
+    border-top-right-radius: 5px;
+    border-top-left-radius: 5px;
+    text-indent: 14px;
+  }
+  div.forAdminLook {
+    margin: 0 auto;
+    width: 70px;
+    height: 25px;
+    color: #333;
+    font-size: 14px;
+    border: 1px solid #5078cb;
+    border-radius: 3px;
+    text-align: center;
+    line-height: 25px;
+    margin-top: 4px;
+    position: absolute;
+    background: #fff;
+    display: none;
+    z-index:9999999;
+  }
+  .ToforAdminLook:hover .forAdminLook {
+    display: block;
+  }
 </style>
 <div class="modal-head"></div>
-<div class="modal-body">
+<div class="modal-body" style="padding: 0px">
   <div class="view-box">
-    <div class="update-img">
-      <p style="">{{showAction ? '编辑物料信息': '规格书上传'}}</p>
+    <p style="font-size: 14px;" class="titleP">{{showAction ? '编辑物料信息': '规格书上传'}}</p>
+    <div class="update-img" style="padding: 10px; width: 560px;">
+
       <a ng-click="cancel()" class="close">&times;</a>
       <!--企业产品库 / 个人产品库 --- 这里加上品牌类目型号规格编辑 -->
       <ul style="margin-top:12px;" ng-show="showAction" >
@@ -240,7 +272,7 @@
               <input type="text"
                      ng-change="onBrandChange(brandcode)"
                      placeholder="请输入品牌名字"
-                     style="width: 180px;height: 28px"
+                     style="width: 165px;height: 28px"
                      ng-blur="onBrandBlur(brandcode)"
                      ng-model="brandcode"
                      class="form-control" maxlength="25"/>
@@ -250,7 +282,7 @@
                 </li>
               </ul>
             </div>
-            <div ng-show="IsLookOrUpdate === 'look'" style="width: 180px;height: 28px">
+            <div ng-show="IsLookOrUpdate === 'look'" style="width: 165px;height: 28px">
               {{brandcode}}
             </div>
           </div>
@@ -262,11 +294,11 @@
                 <!-- 可编辑状态 -->
                 <input type="text"
                        placeholder="请输入物料名称(类目)"
-                       style="width: 180px;height: 28px"
+                       style="width: 165px;height: 28px"
                        ng-model="kind"
                        class="form-control" maxlength="20"/>
               </div>
-              <div ng-show="IsLookOrUpdate === 'look'" style="width: 180px;height: 28px">
+              <div ng-show="IsLookOrUpdate === 'look'" style="width: 165px;height: 28px">
                 {{kind}}
               </div>
             </div>
@@ -281,7 +313,7 @@
                 <input type="text"
                        ng-change="onCodeChange(cmpcode)"
                        placeholder="请输入型号"
-                       style="width: 180px;height: 28px"
+                       style="width: 165px;height: 28px"
                        ng-blur="onCodeBlur(cmpcode)"
                        ng-model="cmpcode"
                        class="form-control" maxlength="100"/>
@@ -291,7 +323,7 @@
                   </li>
                 </ul>
               </div>
-              <div ng-show="IsLookOrUpdate === 'look'" style="width: 180px;height: 28px">
+              <div ng-show="IsLookOrUpdate === 'look'" style="width: 165px;height: 28px">
                 {{cmpcode}}
               </div>
             </div>
@@ -302,7 +334,7 @@
                 <!-- 可编辑状态 -->
                 <input type="text"
                        placeholder="请输入规格参数"
-                       style="width: 180px;height: 28px"
+                       style="width: 165px;height: 28px"
                        ng-model="spec"
                        class="form-control" maxlength="50"/>
             </div>
@@ -311,9 +343,13 @@
         <li class="wuliao_list clearboth">
           <div class="name pull-left" style="width: 60px">规格书:</div>
           <div ng-show="RegulChange" style="line-height: 30px;position: relative;height: 30px;width: 60px;text-align: center;" class="pull-left">
-            <input type="file" image-upload class="uploadImage" accept=".pdf"   on-success="onUploadSuccess($data, $file)" maxSize="20971520" errorSizeMsg="'文件大小不能超过20M'">
+            <input style="display: inline-block" type="file" image-upload class="uploadImage" accept=".pdf"  on-success="onUploadSuccess($data, $file)" max-size="20971520" errorSizeMsg="'文件大小不能超过20M'">
             <span style="color: #5078cb;cursor: pointer;">点击上传</span>
           </div>
+          <div ng-show="RegulChange" style="position: relative;display: inline-block" class="ToforAdminLook" ng-if="ChooseItem.productAttachSubmit.uploadAttach">
+            <img src="static/img/vendor/images/fireinfo_icon.png" width="18" height="18" style="width:18px;height:18px;border: 0px;margin-left:5px;"/>
+            <div class="forAdminLook">待审核</div>
+          </div>
           <div ng-show="!RegulChange">
             <a href="{{Regulpic}}" target="_blank">
               <img src="static/img/vendor/images/pdf.png" style="width:31px;height:35px;" />
@@ -325,7 +361,7 @@
         <div class="update-big-img" style="margin-top: 0px;width: 197px;">
           <div class="previewImage" style="height: 197px;width: 197px;line-height: 197px;text-align: center">
             <!--<img ng-if="Regulpic" ng-src="static/img/vendor/images/pdf.png" alt="商品图片"  style="height: 197px;line-height: 197px;width: 197px;">-->
-            <input type="file" image-upload class="uploadImage" accept=".pdf"   on-success="onUploadSuccess($data, $file)" maxSize="20971520" errorSizeMsg="'文件大小不能超过20M'">
+            <input ng-show="!Ischange" type="file" image-upload class="uploadImage" accept=".pdf"   on-success="onUploadSuccess($data, $file)" max-size="20971520" errorSizeMsg="'文件大小不能超过20M'">
             <img ng-src="{{Ischange ? 'static/img/vendor/images/pdf.png' : Regulpic}}" alt="商品图片" style="height: 159px;width: 130px;">
             <!--<img ng-src="{{Regulpic}}" alt="商品图片" ng-if="!Ischange" style="height: 197px;line-height: 197px;width: 197px;">-->
             <div class="cover" style="background: rgba(0,0,0,0)">
@@ -342,9 +378,9 @@
         <div class="update-file-btn" style="width: 323px;">
           <div class="file-text" style="margin-top: 0px">
             <h3>规格书上传须知</h3>
-            <div style="height: 171px;">1、规格书上传后,商城会在两个工作日内进行审核,审核通过后规格书将会被展示在在售产品中;<br/>
+            <div style="height: 171px;font-size: 14px;">1、规格书上传后,商城会在两个工作日内进行审核,审核通过后规格书将会被展示在在售产品中;<br/>
               2、当规格书处于<span style="color:#ef0606">待审核</span>状态时,再次上传规格书,则前份规格书失效,需重新等待审核;<br/>
-              3、如审核不通过,将会以小心的形式通知您;<br/>
+              3、如审核不通过,将会以消息的形式通知您;<br/>
               4、商城已收录规格书的器件暂不开放上传<br/>
             </div>
           </div>
@@ -370,9 +406,9 @@
 
       <!-- 在售产品 -->
       <div ng-if="!showAction" class="clearboth">
-        <div class="update-big-img">
-          <div class="previewImage" style="text-align: center">
-            <input type="file" image-upload class="uploadImage" accept=".pdf"   on-success="onUploadSuccess($data, $file)" maxSize="20971520" errorSizeMsg="'文件大小不能超过20M'">
+        <div class="update-big-img" style="margin-top: 0px;width: 197px;">
+          <div class="previewImage" style="height: 197px;width: 197px;line-height: 197px;text-align: center">
+            <input ng-show="!Ischange" type="file" image-upload class="uploadImage" accept=".pdf"   on-success="onUploadSuccess($data, $file)" max-size="20971520" errorSizeMsg="'文件大小不能超过20M'">
             <img ng-src="{{Ischange ? 'static/img/vendor/images/pdf.png' : Regulpic}}" alt="商品图片" style="height: 159px;width: 130px;">
             <!--<img ng-if="Regulpic" ng-src="static/img/vendor/images/pdf.png" alt="商品图片">-->
             <!--<img ng-src="{{Regulpic}}" alt="商品图片" ng-if="!Regulpic">-->
@@ -387,21 +423,23 @@
           </div>
           <span class="prompt"><em style="color: #f00;">*</em>仅允许上传PDF格式文件,大小不超过20M</span>
         </div>
-        <div class="update-file-btn">
+        <div class="update-file-btn" style="width: 323px;">
           <div class="file-text"  style="margin-top: 0px">
             <h3>规格书上传须知</h3>
-            <div>1、规格书上传后,商城会在两个工作日内进行审核,审核通过后规格书将会被展示在在售产品中;<br/>
+            <div style="height: 171px;font-size: 14px;">1、规格书上传后,商城会在两个工作日内进行审核,审核通过后规格书将会被展示在在售产品中;<br/>
               2、当规格书处于<span style="color:#ef0606">待审核</span>状态时,再次上传规格书,则前份规格书失效,需重新等待审核;<br/>
-              3、如审核不通过,将会以小心的形式通知您;<br/>
+              3、如审核不通过,将会以消息的形式通知您;<br/>
               4、商城已收录规格书的器件暂不开放上传<br/>
             </div>
           </div>
+        </div>
+        <div class="update-file-btn clearboth"  style="width: 100%; float: none">
           <p>
-                          <span style="left:40px;">
-                              <input maxSize="20971520" type="file" image-upload class="uploadImage" accept=".pdf" on-success="onUploadSuccess($data, $file)"  errorSizeMsg="'文件大小不能超过20M'">
-                              <span>选择文件</span>
-                          </span>
-            <a ng-click="confirm()" class="ok">确定</a>
+            <a ng-click="confirm()" class="ok" style="float: none">确定</a>
+            <span style="position:static;vertical-align: top;" ng-click="cancel()">
+          取消
+              <!--<span >取消</span>-->
+            </span>
           </p>
         </div>
       </div>