Browse Source

收发货优化

shenjj 7 years ago
parent
commit
eb1fe30388

+ 9 - 3
pages/mobile/center/vendor/material.vue

@@ -219,18 +219,19 @@
               </div>
               </div>
               <div class="clearfix">
               <div class="clearfix">
                 <div class="update-materiel-wrapper-image">
                 <div class="update-materiel-wrapper-image">
-                  <a :href="MaterielItem.Regulpic" target="_blank" v-if="MaterielItem.IsSave">
+                  <a v-if="MaterielItem.IsSave" @click="WinOpen(MaterielItem.Regulpic)">
                    <img src="/images/mobile/openStore/pdf.png"  style='width: 0.49rem; height: 0.49rem;display:block;margin: 0.2rem auto 0'/>
                    <img src="/images/mobile/openStore/pdf.png"  style='width: 0.49rem; height: 0.49rem;display:block;margin: 0.2rem auto 0'/>
                   </a>
                   </a>
                   <img v-else src="/images/mobile/openStore/upload.png"  style='width: 0.49rem; height: 0.49rem;display:block;margin: 0.2rem auto 0'/>
                   <img v-else src="/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="update" accept=".pdf" v-if="MaterielItem.standard !== 1"/>
+                  <!--v-if="MaterielItem.standard !== 1"-->
+                  <input type="file" class="com-input" @change="update" accept="*.pdf" v-if="!MaterielItem.IsSave"/>
                   <span style="position: relative" v-if="MaterielItem.Regulpic === ''">上传规格书</span>
                   <span style="position: relative" v-if="MaterielItem.Regulpic === ''">上传规格书</span>
                 </div>
                 </div>
                 <span class="uploadImgInfo pull-left">
                 <span class="uploadImgInfo pull-left">
                   <div class="name"><a class="red">*</a>仅支持PDF格式文件,大小不超过20M:</div>
                   <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>
                   <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>
                 </span>
                 <div style="clear:both"></div>
                 <div style="clear:both"></div>
@@ -275,6 +276,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
+  // 移动端IOS不支持上传PDF文件
   import { RemindBox, PullUp } from '~components/mobile/common'
   import { RemindBox, PullUp } from '~components/mobile/common'
   import { upoffMaterial } from '~components/mobile/center'
   import { upoffMaterial } from '~components/mobile/center'
   export default {
   export default {
@@ -316,6 +318,10 @@
       }
       }
     },
     },
     methods: {
     methods: {
+      // 打开pdf
+      WinOpen(item) {
+        window.open(item, '_blank')
+      },
       // 获取当前企业产品库
       // 获取当前企业产品库
       GetEnterpriseList: function() {
       GetEnterpriseList: function() {
         let params = {
         let params = {

+ 35 - 21
pages/mobile/order/details.vue

@@ -659,25 +659,28 @@
                 // 选择发货地址
                 // 选择发货地址
                 if (res.data[0]) {
                 if (res.data[0]) {
                   this.sendGoodstype = 'add'
                   this.sendGoodstype = 'add'
-                  if (item.inid) {
-                    this._id = EncryptionFilter(item.inid)
-                    this.$http.get(`/trade/inFpu/tobeshipped/${this._id}`).then(res => {
-                      this.sendGoodsInfo = res.data[0]
-                      this.sendGoodsInfo.area = JSON.parse(res.data[0].jsonSpAddress)
-                      this.showSend = true
-                    })
-                  } else {
-                    this.$http.get(`/trade/purchase/vendor/tobeshiped/${item.id}`).then(res => {
-                      this._id = EncryptionFilter(res.data.inId)
-                      this.$http.get(`/trade/inFpu/tobeshipped/${this._id}`).then(res => {
-                        this.sendGoodsInfo = res.data[0]
-                        this.sendGoodsInfo.area = JSON.parse(res.data[0].jsonSpAddress)
-                        this.showSend = true
-                      })
-                    }, err => {
-                      this.onMind('转出货单失败' + err.response.data)
-                    })
-                  }
+                  this.sendGoodsInfo = this.orderList
+                  this.sendGoodsInfo.area = JSON.parse(this.orderList.jsonAddress)
+                  this.showSend = true
+                  // if (item.inid) {
+                  //   this._id = EncryptionFilter(item.inid)
+                  //   this.$http.get(`/trade/inFpu/tobeshipped/${this._id}`).then(res => {
+                  //     this.sendGoodsInfo = res.data[0]
+                  //     this.sendGoodsInfo.area = JSON.parse(res.data[0].jsonSpAddress)
+                  //     this.showSend = true
+                  //   })
+                  // } else {
+                  //   this.$http.get(`/trade/purchase/vendor/tobeshiped/${item.id}`).then(res => {
+                  //     this._id = EncryptionFilter(res.data.inId)
+                  //     this.$http.get(`/trade/inFpu/tobeshipped/${this._id}`).then(res => {
+                  //       this.sendGoodsInfo = res.data[0]
+                  //       this.sendGoodsInfo.area = JSON.parse(res.data[0].jsonSpAddress)
+                  //       this.showSend = true
+                  //     })
+                  //   }, err => {
+                  //     this.onMind('转出货单失败' + err.response.data)
+                  //   })
+                  // }
                 } else {
                 } else {
                   this.onMind('您还未填写设置发货地址 ,请进行完善')
                   this.onMind('您还未填写设置发货地址 ,请进行完善')
                 }
                 }
@@ -727,6 +730,17 @@
               this.onMind('请输入正确的物流单号')
               this.onMind('请输入正确的物流单号')
             } else {
             } else {
               let sendInfo = this.getLogisticsInfo()
               let sendInfo = this.getLogisticsInfo()
+              let _obj = []
+              for (let i = 0; i < this.sendGoodsInfo.purchaseDetails.length; i++) {
+                if (Math.abs(this.sendGoodsInfo.purchaseDetails[i].number) > 0) {
+                  let _id = this.sendGoodsInfo.purchaseDetails[i].id
+                  _obj.push({
+                    id: _id,
+                    qty: this.sendGoodsInfo.purchaseDetails[i].number - this.sendGoodsInfo.purchaseDetails[i].shipQty
+                  })
+                }
+              }
+              sendInfo.map = _obj
               this.$http.post(`/trade/inFpu/save?id=${this.sendGoodsInfo.id}`, sendInfo).then(res => {
               this.$http.post(`/trade/inFpu/save?id=${this.sendGoodsInfo.id}`, sendInfo).then(res => {
                 if (res.data.success) {
                 if (res.data.success) {
                   this.onMind('发货成功')
                   this.onMind('发货成功')
@@ -920,7 +934,7 @@
         getLogisticsInfo(_type) {
         getLogisticsInfo(_type) {
           let sendInfo = {}
           let sendInfo = {}
           sendInfo.sendType = this.sendGoodsInfo.sendType
           sendInfo.sendType = this.sendGoodsInfo.sendType
-          sendInfo.jsonSdAddress = this.sendGoodsInfo.jsonSpAddress
+          sendInfo.jsonSdAddress = this.sendGoodsInfo.jsonSpAddress || this.sendGoodsInfo.jsonAddress
           sendInfo.logisticsInfo = {}
           sendInfo.logisticsInfo = {}
           if (this.peisongShowName) {
           if (this.peisongShowName) {
             sendInfo.logisticsInfo.companyName = this.peisongShowName
             sendInfo.logisticsInfo.companyName = this.peisongShowName
@@ -937,7 +951,7 @@
         },
         },
         // 买家确认收货
         // 买家确认收货
         buyerGetGoods(item) {
         buyerGetGoods(item) {
-          this.$http.put(`/trade/order/simpleinfo/ones/${item.id}?_status=ensureaccept`).then(res => {
+          this.$http.put(`/trade/order/signReceive?id=${item.id}&_status=ensureaccept`).then(res => {
             this.onMind('确认收货成功')
             this.onMind('确认收货成功')
             location.reload()
             location.reload()
           })
           })

+ 32 - 19
pages/mobile/order/index.vue

@@ -511,25 +511,27 @@
               // 选择发货地址
               // 选择发货地址
               if (res.data[0]) {
               if (res.data[0]) {
                 this.sendGoodstype = 'add'
                 this.sendGoodstype = 'add'
-                if (item.inid) {
-                  this._id = EncryptionFilter(item.inid)
-                  this.$http.get(`/trade/inFpu/tobeshipped/${this._id}`).then(res => {
-                    this.sendGoodsInfo = res.data[0]
-                    this.sendGoodsInfo.area = JSON.parse(res.data[0].jsonSpAddress)
+                // this.showSend = true
+                // if (item.inid) {
+                //   this._id = EncryptionFilter(item.inid)
+                  let _id = EncryptionFilter(item.purchaseid)
+                  this.$http.get(`/trade/purchase/purchaseId/${_id}`).then(res => {
+                    this.sendGoodsInfo = res.data.data
+                    this.sendGoodsInfo.area = JSON.parse(res.data.data.jsonAddress)
                     this.showSend = true
                     this.showSend = true
                   })
                   })
-                } else {
-                  this.$http.get(`/trade/purchase/vendor/tobeshiped/${item.id}`).then(res => {
-                    this._id = EncryptionFilter(res.data.inId)
-                    this.$http.get(`/trade/inFpu/tobeshipped/${this._id}`).then(res => {
-                      this.sendGoodsInfo = res.data[0]
-                      this.sendGoodsInfo.area = JSON.parse(res.data[0].jsonSpAddress)
-                      this.showSend = true
-                    })
-                  }, err => {
-                    this.onMind('转出货单失败' + err.response.data)
-                  })
-                }
+                // } else {
+                //   this.$http.get(`/trade/purchase/vendor/tobeshiped/${item.id}`).then(res => {
+                //     this._id = EncryptionFilter(res.data.inId)
+                //     this.$http.get(`/trade/inFpu/tobeshipped/${this._id}`).then(res => {
+                //       this.sendGoodsInfo = res.data[0]
+                //       this.sendGoodsInfo.area = JSON.parse(res.data[0].jsonSpAddress)
+                //       this.showSend = true
+                //     })
+                //   }, err => {
+                //     this.onMind('转出货单失败' + err.response.data)
+                //   })
+                // }
               } else {
               } else {
                 this.onMind('您还未填写设置发货地址 ,请进行完善')
                 this.onMind('您还未填写设置发货地址 ,请进行完善')
               }
               }
@@ -578,7 +580,18 @@
           } else if (!patt.test(this.sendGoodsInfo.kuaidinumber)) {
           } else if (!patt.test(this.sendGoodsInfo.kuaidinumber)) {
             this.onMind('请输入正确的物流单号')
             this.onMind('请输入正确的物流单号')
           } else {
           } else {
+            let _obj = []
             let sendInfo = this.getLogisticsInfo()
             let sendInfo = this.getLogisticsInfo()
+            for (let i = 0; i < this.sendGoodsInfo.purchaseDetails.length; i++) {
+              if (Math.abs(this.sendGoodsInfo.purchaseDetails[i].number) > 0) {
+                let _id = this.sendGoodsInfo.purchaseDetails[i].id
+                _obj.push({
+                  id: _id,
+                  qty: this.sendGoodsInfo.purchaseDetails[i].number - this.sendGoodsInfo.purchaseDetails[i].shipQty
+                })
+              }
+            }
+            sendInfo.map = _obj
             this.$http.post(`/trade/inFpu/save?id=${this.sendGoodsInfo.id}`, sendInfo).then(res => {
             this.$http.post(`/trade/inFpu/save?id=${this.sendGoodsInfo.id}`, sendInfo).then(res => {
               if (res.data.success) {
               if (res.data.success) {
                 this.onMind('发货成功')
                 this.onMind('发货成功')
@@ -793,7 +806,7 @@
       getLogisticsInfo(_type) {
       getLogisticsInfo(_type) {
         let sendInfo = {}
         let sendInfo = {}
         sendInfo.sendType = this.sendGoodsInfo.sendType
         sendInfo.sendType = this.sendGoodsInfo.sendType
-        sendInfo.jsonSdAddress = this.sendGoodsInfo.jsonSpAddress
+        sendInfo.jsonSdAddress = this.sendGoodsInfo.jsonSpAddress || this.sendGoodsInfo.jsonAddress
         sendInfo.logisticsInfo = {}
         sendInfo.logisticsInfo = {}
         if (this.peisongShowName) {
         if (this.peisongShowName) {
           sendInfo.logisticsInfo.companyName = this.peisongShowName
           sendInfo.logisticsInfo.companyName = this.peisongShowName
@@ -819,7 +832,7 @@
       },
       },
       // 买家确认收货
       // 买家确认收货
       buyerGetGoods(item) {
       buyerGetGoods(item) {
-        this.$http.put(`/trade/order/simpleinfo/ones/${item.id}?_status=ensureaccept`).then(res => {
+        this.$http.put(`/trade/order/signReceive?id=${item.id}&_status=ensureaccept`).then(res => {
           this.onMind('确认收货成功')
           this.onMind('确认收货成功')
           this.ChangeList(this.activeType)
           this.ChangeList(this.activeType)
         })
         })