Browse Source

报价bug修复及部分页面调整

yangc 7 years ago
parent
commit
3ead2f305d

+ 1 - 1
components/applyPurchase/ApplyInfo.vue

@@ -205,7 +205,7 @@ export default {
       return this.$store.state.shop.storeInfo.store.data
     },
     purchaseManList() {
-      return this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
+      return JSON.parse(JSON.stringify(this.$store.state.applyPurchase.purchaseManList.purchaseManList.data))
     },
     totalCount() {
       return this.purchaseManList.totalElements

+ 4 - 4
components/applyPurchase/SayPrice.vue

@@ -41,7 +41,7 @@
           <div class="content-line" v-for="(reply, index) in sayPriceObj.replies">
             <div class="form-item form-left">
               <span><i>*</i>价格梯度:</span>
-              <input type="number" class="form-control" @blur="onReplyLapQtyBlur(index)" @input="onReplyLapQtyInput(index)" v-model="reply.lapQty" placeholder="数量">
+              <input type="number" class="form-control" @blur="onReplyLapQtyBlur(index)" @input="onReplyLapQtyInput(index)" v-model="reply.lapQty" placeholder="分段数量">
               <!-- -
                <input type="text" class="form-control" placeholder="数量">-->
             </div>
@@ -52,7 +52,7 @@
                 <option value="RMB">¥</option>
                 <option value="USD">$</option>
               </select>
-              <input type="number" class="form-control" @input="onReplyPriceInput(index)" @blur="onReplyPriceBlur(index)" placeholder="单价" v-model="reply.price">
+              <input type="number" class="form-control" @input="onReplyPriceInput(index)" @blur="onReplyPriceBlur(index)" placeholder="分段单价" v-model="reply.price">
               <i class="fa fa-minus-circle" v-if="sayPriceObj.replies.length > 1" @click="setReplies('sub', index)"></i>
               <i class="fa fa-plus-circle" v-if="sayPriceObj.replies.length < 5" @click="setReplies('add', index)"></i>
             </div>
@@ -118,7 +118,7 @@
           if (this.user.data.enterprise.uu) {
             if (this.user.data.enterprise.isVendor && this.user.data.enterprise.isVendor !== '1690') {
               this.resetSayPrice()
-              purchaseMan.active = true
+//              purchaseMan.active = true
               this.setIndex(index)
             } else {
               this.$message.error('抱歉,您需开通卖家功能才可报价')
@@ -135,7 +135,7 @@
       },
       commitSayPrice: function () {
         if (this.checkValid()) {
-          let purchaseMan = this.purchaseManList.content[this.currentSayPriceIndex]
+          let purchaseMan = JSON.parse(JSON.stringify(this.purchaseManList.content[this.currentSayPriceIndex]))
           this.showLoading = true
           purchaseMan.leadtime = this.sayPriceObj.leadtime
           purchaseMan.replies = this.sayPriceObj.replies

+ 2 - 2
components/home/floor/FloorList.vue

@@ -223,7 +223,7 @@
         if (this.user.logged) {
           if (this.user.data.enterprise.uu) {
             if (this.user.data.enterprise.isVendor && this.user.data.enterprise.isVendor !== '1690') {
-              purchaseMan.active = true
+//              purchaseMan.active = true
               this.currentSayPriceIndex = index
             } else {
               this.$message.error('抱歉,您需开通卖家功能才可报价')
@@ -242,7 +242,7 @@
         this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: this.nowPage, pageSize: this.pageSize, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
       },
       cancelSayPrice: function () {
-        this.purchaseManList.content[this.currentSayPriceIndex].active = false
+//        this.purchaseManList.content[this.currentSayPriceIndex].active = false
         this.currentSayPriceIndex = -1
       }
     }

+ 2 - 2
components/mobile/applyPurchase/SayPrice.vue

@@ -42,8 +42,8 @@
         </span>
           </div>
           <div class="form-item" v-for="(reply, index) in sayPriceObj.replies">
-            <input type="text" placeholder="梯度" class="fl" @blur="onReplyLapQtyBlur(index)" @input="onReplyLapQtyInput(index)" v-model="reply.lapQty">
-            <input type="text" placeholder="单价" class="fr" @input="onReplyPriceInput(index)" @blur="onReplyPriceBlur(index)" v-model="reply.price">
+            <input type="text" placeholder="分段数量" class="fl" @blur="onReplyLapQtyBlur(index)" @input="onReplyLapQtyInput(index)" v-model="reply.lapQty">
+            <input type="text" placeholder="分段单价" class="fr" @input="onReplyPriceInput(index)" @blur="onReplyPriceBlur(index)" v-model="reply.price">
             <i class="iconfont icon-minus" v-if="index > 0" @click="setReplies('sub', index)"></i>
             <i class="iconfont icon-add" v-if="index == 0 && sayPriceObj.replies.length < 5" @click="setReplies('add', index)"></i>
           </div>

+ 15 - 9
components/mobile/applyPurchase/SeekList.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <ul class="seek-list">
-      <li v-for="(item, index) in purchaseManList">
+      <li v-for="(item, index) in purchaseManListData">
         <p>
           <span v-if="item.inquiry.enterprise && item.inquiry.enterprise.enName">{{[item.inquiry.enterprise.enName, user.logged] | enterpriseFilter}}</span>
           <span v-else>{{[item.userName, user.logged] | userNameFilter}}</span>
@@ -49,7 +49,7 @@
         </div>
       </li>
     </ul>
-    <div class="none-state" v-if="!purchaseManList || !purchaseManList.length && !isDataChange">
+    <div class="none-state" v-if="!purchaseManListData || !purchaseManListData.length && !isDataChange">
       <img src="/images/mobile/@2x/car@2x.png">
       <p v-text="'抱歉,暂无求购信息'"></p>
     </div>
@@ -77,7 +77,8 @@ export default {
       activeIndex: -1,
       remindText: '',
       timeoutCount: 0,
-      agreed: 0
+      agreed: 0,
+      purchaseManListData: []
     }
   },
   props: ['userType', 'seekType', 'purchaseManList', 'isDataChange'],
@@ -114,10 +115,15 @@ export default {
       }
     }
   },
+  watch: {
+    'purchaseManList': {
+      handler () {
+        this.purchaseManListData = JSON.parse(JSON.stringify(this.purchaseManList))
+      },
+      immediate: true
+    }
+  },
   computed: {
-    //      purchaseManList () {
-    //        return this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
-    //      },
     user() {
       return this.$store.state.option.user
     }
@@ -170,15 +176,15 @@ export default {
     },
     onSayPriceCancel: function(flag, quteId) {
       if (flag) {
-        this.purchaseManList[this.activeIndex].quoted = 1
-        this.purchaseManList[this.activeIndex].quteId = quteId
+        this.purchaseManListData[this.activeIndex].quoted = 1
+        this.purchaseManListData[this.activeIndex].quteId = quteId
         this.onRemind('报价成功')
       }
       this.showSayPriceBox = false
     },
     onSayPriceInfoCancel: function(flag) {
       if (flag) {
-        this.purchaseManList[this.activeIndex].agreed = 1
+        this.purchaseManListData[this.activeIndex].agreed = 1
         this.onRemind('采纳成功')
       }
       this.showSayPriceInfoBox = false

+ 8 - 8
components/store/common/StoreHeader.vue

@@ -48,17 +48,17 @@
                 <li v-if="storeInfo.enterprise.enFax">
                   <span class="public">传真:</span><span v-text="storeInfo.enterprise.enFax"></span>
                 </li>
-                <li v-if="storeInfo.enterprise.address || storeInfo.enterprise.enAddress">
-                  <span class="public">地址:</span><span v-text="storeInfo.enterprise.address || storeInfo.enterprise.enAddress"></span>
+                <li v-if="storeInfo.enterprise.address">
+                  <span class="public">地址:</span><span v-text="storeInfo.enterprise.address"></span>
                 </li>
-                <li v-if="storeInfo.enterprise.enPhone || storeInfo.enterprise.enPhone">
-                  <span class="public">手机:</span><span v-text="storeInfo.enterprise.enPhone || storeInfo.enterprise.enPhone"></span>
+                <li v-if="storeInfo.enterprise.enPhone">
+                  <span class="public">手机:</span><span v-text="storeInfo.enterprise.enPhone"></span>
                 </li>
-                <li v-if="storeInfo.enterprise.enWeixin || storeInfo.enterprise.enWeixin">
-                  <span class="public">微信:</span><span v-text="storeInfo.enterprise.enWeixin || storeInfo.enterprise.enWeixin"></span>
+                <li v-if="storeInfo.enterprise.enWeixin">
+                  <span class="public">微信:</span><span v-text="storeInfo.enterprise.enWeixin"></span>
                 </li>
-                <li v-if="storeInfo.enterprise.enQQ || storeInfo.enterprise.enQQ">
-                  <span class="public">Q&nbsp;Q:</span><span v-text="storeInfo.enterprise.enQQ || storeInfo.enterprise.enQQ"></span>
+                <li v-if="storeInfo.enterprise.enQQ">
+                  <span class="public">Q&nbsp;Q:</span><span v-text="storeInfo.enterprise.enQQ"></span>
                 </li>
                 <li class="text-right">
                   <nuxt-link :to="{ name: 'store-uuid-description', params: { uuid: storeInfo.uuid } }">了解更多&gt;</nuxt-link>