Browse Source

Merge remote-tracking branch 'origin/release-201827-wangcz' into release-201827-wangcz

wangcz 7 years ago
parent
commit
035f4a86e2
2 changed files with 30 additions and 14 deletions
  1. 2 2
      components/mobile/center/upoff-material.vue
  2. 28 12
      pages/mobile/center/vendor/material.vue

+ 2 - 2
components/mobile/center/upoff-material.vue

@@ -15,7 +15,7 @@
             <div style="background: #fff;border: 1px solid #dcdcdc;padding:0 0.2rem 0.5rem">
               <div class="opoff-title clearfix">
                 <!-- :class="item.standard ? 'standed' : 'istanded'"-->
-                <div class="icon standed"  :class="chooseItem.standard ? 'standed' : 'istanded'"></div>
+                <div class="icon"  :class="chooseItem.standard === 1 ? 'standed' : 'istanded'"></div>
                 <div class="opoff-title-text pull-left">{{chooseItem.pcmpcode || '-'}}</div>
               </div>
               <div class="off-content">
@@ -311,7 +311,7 @@
         },
         hide(type) {
           this.showUpoff = false
-          this.$emit('upoffMaterial', type)
+          this.$emit('upoffMaterial', type, this.chooseItem)
         },
         // 开始价格阶段失去焦点
         startpriceBlur(item, index) {

+ 28 - 12
pages/mobile/center/vendor/material.vue

@@ -24,7 +24,7 @@
               <!--{{item.goods && item.goods.selfSale === 1 ? '自营' : '寄售' || '-'}}-->
             </div>
             <div class="text" style="width: 1rem;color: #666;font-size: 0.28rem">
-              {{item.goods && item.goods.autoPublish ? '已上架' : '已下架' }}
+              {{item.goods && (item.goods.status === 601 || item.goods.status === 602) ? '已上架' : '已下架' }}
             </div>
             <!-- <div class="pms">
                {{item.storeid === '33069557578d44e69bd91ad12d28a8d4' ? '寄售' : '自营'}}
@@ -61,7 +61,7 @@
                 <div class="text">{{item.packaging || '无包装信息'}}</div>
               </div>
               <div class="fr">
-                <div class="name">库存:</div>
+                <div class="name">库存(pcs):</div>
                 <div class="text">{{item.erpReserve || '-'}}</div>
               </div>
 
@@ -115,7 +115,7 @@
 
           </div>
           <div class="clearfix">
-            <div class="pull-right add" @click="addProtoperson(item)" :class="{noadd: item.addProductPerson}">加入个人产品</div>
+            <div class="pull-right add" @click="addProtoperson(item)" :class="{noadd: item.addProductPerson}" v-if="activeType !== 'mine'">加入个人产品</div>
             <div class="pull-right look" @click="toAddpro(item, index)">编辑上架</div>
             <div class="pull-right look" @click="updateMateriel(item)">编辑物料</div>
           </div>
@@ -397,7 +397,8 @@
             this.GetEnterpriseListData.splice(0, this.GetEnterpriseListData.length)
             this.GetEnterpriseListData = null
             this.GetEnterpriseListData = []
-            this.reloadData()
+            this.getResourceProvidor()
+            // this.reloadData()
           }, () => {
             this.collectResult = '绑定失败'
             this.timeoutCount++
@@ -405,21 +406,27 @@
       },
       // 编辑上架
       toAddpro(item, index) {
-        this.$item = this.baseUtils.deepCopy(item)
+        // this.$item = this.baseUtils.deepCopy(item)
         this.$index = index
+        // this.MaterielItem = item
         this.MaterielItem = item
+        this.$item = this.baseUtils.deepCopy(this.MaterielItem)
         if (!this.MaterielItem.goods) {
           this.$set(this.MaterielItem, 'goods', {
             prices: [{end: '',
               rMBNTPrice: '',
               rMBPrice: '',
-              start: ''}],
+              start: '1'}],
             selfSale: 1,
-            breakUp: false,
-            autoPublish: false,
-            productid: item.id
+            breakUp: true,
+            autoPublish: true,
+            productid: item.id,
+            minDelivery: 1,
+            maxDelivery: 10,
+            minBuyQty: 1
           })
         }
+        console.log(item)
         this.$refs.upoffMaterial.show()
       },
       update2 (e) {
@@ -468,6 +475,8 @@
         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.$set(this.MaterielItem, 'cmpImg', item.cmpImg || '')
         this.$set(this.MaterielItem, 'Regulpic', (item.productAttachSubmit && item.productAttachSubmit.uploadAttach) || item.attach || '')
         this.showMateriel = true
@@ -637,7 +646,7 @@
           this.MaterielItem.spec = this.baseUtils.cutOutString(this.MaterielItem.spec, 100)
         }
       },
-      upoffMaterial(type) {
+      upoffMaterial(type, item) {
         if (!type) {
           this.showMateriel = false
           this.page = 1
@@ -645,8 +654,15 @@
           this.GetEnterpriseListData = []
           this.getResourceProvidor()
         } else {
-          this.GetEnterpriseListData[this.$index] = this.$item
-          console.log(this.GetEnterpriseListData[this.$index])
+          // console.log(this.$item)
+          // console.log(this.MaterielItem)
+          // let _key1 = Object.keys(this.$item)
+          // let _key2 = Object.keys(this.MaterielItem)
+          // for (let i = 0; i < _key1.length; i++) {
+          //   this.MaterielItem[_key2[i]] = this.$item[_key1[i]]
+          // }
+          this.GetEnterpriseListData.splice(this.$index, 1, this.$item)
+          // delete item.goods
           // this.MaterielItem = this.$item
         }
       }