Browse Source

处理出入库

wangcz 7 years ago
parent
commit
ee45b18368

+ 2 - 2
components/mobile/center/outOfStorage/StorageList.vue

@@ -18,7 +18,7 @@
         <div class="linetext">录入人: <span v-text="item.sellername || '-'">21324</span></div>
         <div class="linetext">录入时间: <span v-text="item.createtime ? baseUtils.formatDate(new Date(item.createtime), 'yyyy-MM-dd hh:mm:ss') : '-'">21324</span></div>
         <div class="look-btn">
-          <span @click="loadAllInfo(item.storeid, 1)" v-text="switchType === 'INBOUND' ? '收货入库' : '发货出库'"></span>
+          <span @click="loadAllInfo(item.purchaseid, 1)" v-text="switchType === 'INBOUND' ? '收货入库' : '发货出库'"></span>
         </div>
       </li>
     </ul>
@@ -60,7 +60,7 @@
         if(i === 0) {
           this.$router.push('/mobile/center/vendor/outOfStorage/' + type)
         } else if(i === 1){
-          this.$router.push('/mobile/center/vendor/outOfStorage/purchase/' + type)
+          this.$router.push('/mobile/center/vendor/outOfStorage/purchase/' + this.baseUtils.enidfilter(type))
         }
       }
     }

+ 2 - 2
components/mobile/center/outOfStorage/otherStorage.vue

@@ -189,8 +189,8 @@
     margin-bottom:.3rem;
     .btn-click{
       padding: 0.24rem 0.24rem;
-      position: absolute;
-      bottom: -1rem;
+      position: fixed;
+      bottom: 1rem;
       left: 0;
       right: 0;
       text-align: center;

+ 14 - 10
pages/mobile/center/vendor/outOfStorage/index.vue

@@ -145,22 +145,26 @@
         this.reloadList()
       },
       setSwitchType (type) {
-        this.switchType = type
-        this.filterParams.type = type
-        this.filterParams.page = 1
-        this.filter.page = 1
-        this.isChange = true
-        this.reloadList()
-      },
-      setHandleItem (type) {
-        this.handleItem = type
-        if(type !== 1) {
+        if(type !== this.switchType) {
+          this.switchType = type
+          this.filterParams.type = type
           this.filterParams.page = 1
           this.filter.page = 1
           this.isChange = true
           this.reloadList()
         }
       },
+      setHandleItem (type) {
+        if(type !== this.handleItem) {
+          this.handleItem = type
+          if(type !== 1) {
+            this.filterParams.page = 1
+            this.filter.page = 1
+            this.isChange = true
+            this.reloadList()
+          }
+        }
+      },
       setSelect (type, val) {
         if (type === 'date') {
           if (val) {

+ 50 - 14
pages/mobile/center/vendor/outOfStorage/purchase/_storeid.vue

@@ -12,23 +12,27 @@
           <span class="clear" @click="saveClick('clear')">取消</span>
         </div>
         <div class="storage-info">
-          <div class="linetext">{{storageList.type === 'INBOUND' ? '入库单' : '出库单'}}: <span v-text="storageList.inOutId"></span></div>
-          <div class="linetext">{{storageList.type === 'INBOUND' ? '卖家名称' : '买家名称'}}: <span v-text="storageList.affiliatedEnterprise">21324</span></div>
-          <div class="linetext">所属订单: <span v-text="storageList.associateOrderid || '-'">21324</span></div>
-          <div class="linetext">类型: <span v-text="setFilterType(storageList.opertatorType)">21324</span></div>
+          <div class="linetext">{{storageList.type === 'INBOUND' ? '入库单' : '出库单'}}: <span>系统自动生成</span></div>
+          <div class="linetext">{{storageList.type === 'INBOUND' ? '卖家名称' : '买家名称'}}: <span v-text="storageList.buyentername || storageList.buyername">21324</span></div>
+          <div class="linetext">所属订单: <span v-text="storageList.purchaseid || '-'">21324</span></div>
           <div class="linetext" v-if="storageList.logistics">物流公司: <span v-text="storageList.logistics ? storageList.logistics.companyName : '-'">323425</span></div>
           <div class="linetext" v-if="storageList.logistics">物流单号:<span v-text="storageList.logistics ? storageList.logistics.number : '-'">34254</span></div>
-          <div class="linetext">录入人: <span v-text="storageList.operaterUserName || '-'">21324</span></div>
-          <div class="linetext">录入时间: <span v-text="storageList.createTime ? baseUtils.formatDate(new Date(storageList.createTime), 'yyyy-MM-dd hh:mm:ss') : '-'">21324</span></div>
+          <div class="linetext">录入人: <span v-text="storageList.sellername || '-'">21324</span></div>
+          <div class="linetext">录入时间: <span v-text="storageList.createtime ? baseUtils.formatDate(new Date(storageList.createtime), 'yyyy-MM-dd hh:mm:ss') : '-'">21324</span></div>
         </div>
-        <ul class="list-unstyled" v-if="storageList.inOutboundDetails">
-          <li class="info-list clearfix" v-for="(item, index) in storageList.inOutboundDetails">
+        <ul class="list-unstyled" v-if="storageList.purchaseDetails" style="margin-bottom:.8rem;">
+          <li class="info-list clearfix" v-for="(item, index) in storageList.purchaseDetails">
             <span class="super"><em v-text="index + 1">1</em></span>
-            <div class="linetext width50 fl">型号: <span v-text="item.cmpCode || '-'">21324</span></div>
-            <div class="linetext width50 fl">品牌: <span v-text="item.brandEn || '-'">21324</span></div>
-            <div class="linetext width50 fl">物料名称: <span v-text="item.kindName || '-'">21324</span></div>
+            <div class="linetext width50 fl">型号: <span v-text="item.batchCode || '-'">21324</span></div>
+            <div class="linetext width50 fl">品牌: <span v-text="item.brName || '-'">21324</span></div>
+            <div class="linetext width50 fl">物料名称: <span v-text="item.kiName || '-'">21324</span></div>
             <div class="linetext width50 fl">规格: <span v-text="item.spec || '-'">21324</span></div>
-            <div class="linetext width50 fl">{{storageList.type === 'INBOUND' ? '入库数' : '出库数'}}(PCS): <span v-text="item.qty || '-'">21324</span></div>
+            <div class="linetext width50 fl">应出库(PCS): <span v-text="item.number || '-'">21324</span></div>
+            <div class="linetext width50 fl">已出库(PCS): <span v-text="item.shipQty || '-'">21324</span></div>
+            <div class="linetext width50 fl">{{storageList.type === 'INBOUND' ? '入库数' : '出库数'}}(PCS):
+              <span v-if="item.qty === item.number">-</span>
+              <input style="width:1.2rem;" v-else type="text" v-model="item.qty">
+            </div>
             <div class="linetext width50 fl">单价(¥): <span class="base-color" v-text="item.price || '-'">21324</span></div>
           </li>
         </ul>
@@ -83,6 +87,31 @@
           bound = '全部类型'
         }
         return bound
+      },
+      saveClick (type) {
+        if(type === 'clear') {
+          console.log('clear')
+          this.initData()
+        }else {
+          if(!this.enName) {
+            this.onRemind('请输入' + this.switchType === 'INBOUND' ? '请输入卖家名称' : '请输入买家名称')
+          } else {
+            let arr = []
+            this.allObj.forEach(val => {
+              if(!val.price && !val.qty && !val.productId) {
+                this.onRemind('请将数据补充完整')
+                return
+              }
+              arr.push({price: val.price, productId: val.productId, qty:val.qty})
+            })
+            this.$http.post(`/CommodityInOutbound/${this.switchType === 'INBOUND'? 'inBound': 'outBound'}/other?enName=${this.enName}`, arr)
+              .then(response => {
+                if(response.data.code === 1){
+                  this.onRemind('保存信息成功')
+                }
+              })
+          }
+        }
       }
     }
   }
@@ -99,8 +128,8 @@
     margin: 0 auto;
     .btn-click{
       padding: 0.24rem 0.24rem;
-      position: absolute;
-      bottom: -1rem;
+      position: fixed;
+      bottom: 1rem;
       left: 0;
       right: 0;
       text-align: center;
@@ -133,6 +162,13 @@
       -o-text-overflow: ellipsis;
       text-overflow: ellipsis;
       white-space: nowrap;
+      input{
+        height: .5rem;
+        font-size: .24rem;
+        border-radius: .04rem;
+        border: 1px solid #d2d2d2;
+        padding: 0 .1rem;
+      }
       span{
         color:#333;
         &.base-color{