Browse Source

优化库存管理

shenjj 7 years ago
parent
commit
0a883ff5b3
1 changed files with 30 additions and 13 deletions
  1. 30 13
      pages/mobile/center/vendor/material.vue

+ 30 - 13
pages/mobile/center/vendor/material.vue

@@ -109,6 +109,11 @@
                       <div v-else>${{price.rMBPrice}}</div>
                     </li>
                   </template>
+                  <template v-else>
+                    <li>
+                      <div style="color: #666;width: 100%">暂无梯度数据</div>
+                    </li>
+                  </template>
                 </ul>
               </div>
             </div>
@@ -126,7 +131,7 @@
 
     </div>
     <!-- 编辑物料 -->
-    <div class="update-materiel" v-show="showMateriel" @click="closeAlert">
+    <div class="update-materiel" v-show="showMateriel">
       <div class="mobile-nav">
         <div class="mobile-header mobile-center-header">
           <a @click="showMateriel = false"><i class="iconfont icon-fanhui"></i></a>
@@ -219,23 +224,23 @@
               </div>
               <div class="clearfix">
                 <div class="update-materiel-wrapper-image">
-                  <a v-if="MaterielItem.IsSave" @click="WinOpen(MaterielItem.Regulpic)">
+                  <a v-if="MaterielItem.IsSave" @click.stop="WinOpen(MaterielItem.Regulpic)">
                    <img src="/images/mobile/openStore/pdf.png"  style='width: 0.49rem; height: 0.49rem;display:block;margin: 0.2rem auto 0'/>
                   </a>
                   <img v-else src="/images/mobile/openStore/upload.png"  style='width: 0.49rem; height: 0.49rem;display:block;margin: 0.2rem auto 0'/>
                   <!--v-if="MaterielItem.standard !== 1"-->
-                  <input type="file" class="com-input" @change="update" accept="*.pdf" v-if="!MaterielItem.IsSave"/>
+                  <input type="file" class="com-input" @change.stop="update" accept="*.pdf" v-if="!MaterielItem.IsSave"/>
                   <span style="position: relative" v-if="MaterielItem.Regulpic === ''">上传规格书</span>
                 </div>
                 <span class="uploadImgInfo pull-left">
                   <div class="name"><a class="red">*</a>仅支持PDF格式文件,大小不超过20M:</div>
                   <div class="name"><a class="red">*</a>规格书上传后,将在两个工作日内完成审核</div>
                   <div class="name"><a class="red">*</a>如审核不通过,将会以消息的形式通知您</div>
-                  <div class="name"><a class="red">*</a>已有原厂规格书的器件暂不开放上传</div>s
+                  <div class="name"><a class="red">*</a>已有原厂规格书的器件暂不开放上传</div>
                   <div class="name"><a class="red">*</a>更新规格书需重新审核</div>
                 </span>
                 <div style="clear:both"></div>
-                <div class="uploadImgBtn pull-left">上传规格书<input type="file" class="com-input" @change="update" accept=".pdf" /></div>
+                <div class="uploadImgBtn pull-left">上传规格书<input type="file" class="com-input" @change.stop="update" accept=".pdf" /></div>
 
               </div>
 
@@ -245,14 +250,14 @@
               <div class="clearfix">
                 <div class="update-materiel-wrapper-image">
                   <img  :src="MaterielItem.cmpImg || '/images/mobile/openStore/upload.png'"  style='width: 0.49rem; height: 0.49rem;display:block;margin: 0.2rem auto 0'/>
-                  <input type="file" class="com-input" @change="update2" accept="image/jpeg,image/jpg,image/png" />
+                  <input type="file" class="com-input" @change.stop="update2" accept="image/jpeg,image/jpg,image/png" />
                   <span style="position: relative" v-if="MaterielItem.cmpImg === ''">上传图片</span>
                 </div>
                 <span class="uploadImgInfo pull-left" style="line-height: 1.09rem">
                   <div class="name"><a class="red">*</a>仅支持JPG、PNG格式文件,大小不超过1M</div>
                 </span>
                 <div style="clear:both"></div>
-                <div class="uploadImgBtn pull-left" style="margin-top: 0.15rem">上传图片<input type="file" class="com-input" @change="update2" accept="image/jpeg,image/jpg,image/png" /></div>
+                <div class="uploadImgBtn pull-left" style="margin-top: 0.15rem">上传图片<input type="file" class="com-input" @change.stop="update2" accept="image/jpeg,image/jpg,image/png" /></div>
               </div>
             </div>
             <div class="update-materiel-wrapper-controll clearfix">
@@ -331,7 +336,7 @@
           keyword: this.seekKeyword || '',
           page: this.seekPage,
           sorting: { id: 'DESC' },
-          type: 'nStandard'
+          type: 'all'
         }
         return this.$http.get('/trade/products', { params })
       },
@@ -350,7 +355,7 @@
       },
       ChangeList(_tp) {
         this.activeType = _tp
-        this.seekPage = 0
+        this.seekPage = 1
         this.GetEnterpriseListData = []
         this.getResourceProvidor()
       },
@@ -406,6 +411,14 @@
       },
       // 编辑上架
       toAddpro(item, index) {
+        if (item.erpReserve === '' || item.minPackQty === 0) {
+          this.setRemindText(`当前物料库存为0,请先入库`)
+          return false
+        }
+        if (item.minPackQty === '' || item.minPackQty === 0) {
+          this.setRemindText(`请先编辑物料,最小包装数选项`)
+          return false
+        }
         // this.$item = this.baseUtils.deepCopy(item)
         this.$index = index
         // this.MaterielItem = item
@@ -426,8 +439,11 @@
             minBuyQty: 1
           })
         }
-        console.log(item)
+        let rf = document.body.offsetHeight // 触发浏览器重绘
+        // console.log(item)
+        this.nextTick(() => {
         this.$refs.upoffMaterial.show()
+        })
       },
       update2 (e) {
         // 上传图片
@@ -474,9 +490,9 @@
         // Object.assign(this.MaterielItem, item, {Regulpic: '', IsSave: false, cmpImg: ''})
         this.MaterielItem = item
         this.$item = this.baseUtils.deepCopy(item)
-        this.MaterielItem.IsSave = (item.productAttachSubmit && item.productAttachSubmit.uploadAttach || item.attach) ? true : false // 规格书是否存在
-        this.MaterielItem.minPackQty = (this.MaterielItem.minPackQty === '' || this.MaterielItem.minPackQty === 0) ? 1 : 0
-        this.MaterielItem.packaging = this.MaterielItem.packaging === '' ? this.MaterielItem.packaging : this.packObj[1]
+        this.MaterielItem.minPackQty = (this.MaterielItem.minPackQty === '' || this.MaterielItem.minPackQty === 0) ? 1 : this.MaterielItem.minPackQty
+        this.MaterielItem.packaging = this.MaterielItem.packaging !== '' ? this.MaterielItem.packaging : this.packObj[1]
+        this.$set(this.MaterielItem, 'IsSave', (item.productAttachSubmit && item.productAttachSubmit.uploadAttach || item.attach) ? true : false) // 规格书是否存在
         this.$set(this.MaterielItem, 'cmpImg', item.cmpImg || '')
         this.$set(this.MaterielItem, 'Regulpic', (item.productAttachSubmit && item.productAttachSubmit.uploadAttach) || item.attach || '')
         this.showMateriel = true
@@ -665,6 +681,7 @@
           // delete item.goods
           // this.MaterielItem = this.$item
         }
+        this.MaterielItem = {}
       }
       // _initScroll() {
       //   this.$nextTick(() => {