Przeglądaj źródła

处理出入库

wangcz 7 lat temu
rodzic
commit
2a8530d246

+ 44 - 98
components/mobile/center/outOfStorage/StorageList.vue

@@ -1,24 +1,24 @@
 <template>
   <div class="storage">
     <ul class="list-unstyled">
-      <li>
-        <div class="linetext">入库单: <span>21324</span></div>
-        <div class="linetext">买家名称: <span>21324</span></div>
-        <div class="linetext">类型: <span>21324</span></div>
-        <div class="linetext">录入人: <span>21324</span></div>
-        <div class="linetext">录入时间: <span>21324</span></div>
+      <li v-for="item in listData" v-if="handleItem === 0">
+        <div class="linetext">{{switchType === 'INBOUND' ? '入库单' : '出库单'}}: <span v-text="item.inOutId || '-'">21324</span></div>
+        <div class="linetext">{{switchType === 'INBOUND' ? '卖家名称' : '买家名称'}}: <span v-text="item.affiliatedEnterprise || '-'">21324</span></div>
+        <div class="linetext">类型: <span v-text="setFilterType(item.opertatorType)">21324</span></div>
+        <div class="linetext">录入人: <span v-text="item.operaterUserName || '-'">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>查看更多</span>
+          <span @click="loadAllInfo(item.id, 0)">查看更多</span>
         </div>
       </li>
-      <li>
-        <div class="linetext">入库单: <span>21324</span></div>
-        <div class="linetext">买家名称: <span>21324</span></div>
-        <div class="linetext">类型: <span>21324</span></div>
-        <div class="linetext">录入人: <span>21324</span></div>
-        <div class="linetext">录入时间: <span>21324</span></div>
+      <li v-for="item in listData" v-if="handleItem === 2">
+        <div class="linetext">{{switchType === 'INBOUND' ? '入库单' : '出库单'}}: <span>系统自动生成</span></div>
+        <div class="linetext">订单号: <span v-text="item.purchaseid || '-'">21324</span></div>
+        <div class="linetext">{{switchType === 'INBOUND' ? '卖家名称' : '买家名称'}}: <span v-text="item.buyentername || item.buyername || '-'">21324</span></div>
+        <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>查看更多</span>
+          <span @click="loadAllInfo(item.storeid, 1)" v-text="switchType === 'INBOUND' ? '收货入库' : '发货出库'"></span>
         </div>
       </li>
     </ul>
@@ -26,94 +26,43 @@
 </template>
 <script>
   export default {
-    data () {
-      return {
-        remindText: '',
-        timeoutCount: 0,
-        switchType: 'inBound',
-        handleItem:0,
-        filterOptions: [
-          {
-            title: '交易时间',
-            selectOption: 'date',
-            selectItems: [{
-              key: '30天',
-              val: 1
-            }, {
-              key: '90天',
-              val: 2
-            }, {
-              key: '180天',
-              val: 3
-            }, {
-              key: '自定义',
-              val: 4
-            }],
-            defaultVal: 1
-          }
-        ]
+    props: {
+      handleItem: {
+        type: Number,
+        default: 0
+      },
+      listData: {
+        type: Array,
+        default: []
+      },
+      switchType: {
+        type: String,
+        default: 'INBOUND'
       }
     },
     methods: {
-      onRemind: function (str) {
-        this.remindText = str
-        this.timeoutCount++
-      },
-      setSwitchType (type) {
-        this.switchType = type
-      },
-      setSelect (type, val) {
-        if (type === 'date') {
-          if (val) {
-            this.filterParams.fromDate = val.fromDate
-            this.filterParams.toDate = val.toDate
-          } else {
-            this.filterParams.fromDate = null
-            this.filterParams.toDate = null
-          }
+      setFilterType (type) {
+        let bound = ''
+        if(type === 'OTHER_INBOUND') {
+          bound = '其他入库'
+        } else if(type === 'OTHER_OUTBOUND'){
+          bound = '其他出库'
+        } else if (type === 'PURCHASE_INBOUND') {
+          bound = '采购入库'
+        } else if(type === 'SELL_OUTBOUND') {
+          bound = '销售出库'
         } else {
-          this.filterParams[type] = val
-        }
-        this.filterRecord()
-      },
-      initFilterParams () {
-        this.filterParams = {
-          keyword: '',
-          fromDate: '',
-          toDate: '',
-          currencyName: '',
-          method: ''
+          bound = '全部类型'
         }
+        return bound
       },
-      onSelectAction (selectObj) {
-        this.setSelect(selectObj.key, selectObj.value)
-      },
-      filterRecord () {
-        this.page = 1
-        this.isChange = true
-        this.reloadList()
-      },
-      reloadList () {
-        if (this.switchType === 'account') {
-          this.$store.dispatch('payCenter/loadBuyerAccount', {
-            count: this.count,
-            page: this.page,
-            sorting: {num: 'ASC'},
-            type: 'buyer'
-          })
-        } else {
-          this.$store.dispatch('payCenter/loadBuyerRecord', {
-            count: this.count,
-            page: this.page,
-            sorting: {'paytime': 'DESC'},
-            currencyName: this.filterParams.currencyName || null,
-            fromDate: this.filterParams.fromDate || null,
-            toDate: this.filterParams.toDate || null,
-            remitteeType: this.filterParams.remitteeType || null,
-            keyword: this.filterParams.keyword || null
-          })
+      loadAllInfo (type, i) {
+        if(i === 0) {
+          this.$router.push('/mobile/center/vendor/outOfStorage/' + type)
+        } else if(i === 1){
+          this.$router.push('/mobile/center/vendor/outOfStorage/purchase/' + type)
         }
-      },
+      }
     }
   }
 </script>
@@ -140,9 +89,6 @@
           padding: 0.2rem 0;
           border-top: 1px solid #d3d3d3;
           text-align: center;
-          a{
-
-          }
         }
       }
     }

+ 0 - 168
components/mobile/center/outOfStorage/detailStorage.vue

@@ -1,168 +0,0 @@
-<template>
-  <div class="storage">
-    <div class="storage-info">
-      <div class="linetext">入库单: <span>21324</span></div>
-      <div class="linetext">买家名称: <span>21324</span></div>
-      <div class="linetext">所属订单: <span>21324</span></div>
-      <div class="linetext">物流公司: <span>323425</span></div>
-      <div class="linetext">物流单号:<span>34254</span></div>
-      <div class="linetext">录入人: <span>21324</span></div>
-      <div class="linetext">录入时间: <span>21324</span></div>
-    </div>
-    <ul class="list-unstyled">
-      <li class="info-list clearfix">
-        <span class="super"><em>1</em></span>
-        <div class="linetext width50 fl">型号: <span>21324</span></div>
-        <div class="linetext width50 fl">品牌: <span>21324</span></div>
-        <div class="linetext width50 fl">物料名称: <span>21324</span></div>
-        <div class="linetext width50 fl">规格: <span>21324</span></div>
-        <div class="linetext width50 fl">应出库(PCS): <span>21324</span></div>
-        <div class="linetext width50 fl">已出库(PCS): <span>21324</span></div>
-        <div class="linetext width50 fl"><em>*</em>本次出库(PCS): <span>21324</span></div>
-        <div class="linetext width50 fl">单价($): <span class="base-color">21324</span></div>
-      </li>
-    </ul>
-  </div>
-</template>
-<script>
-  export default {
-    data () {
-      return {
-        remindText: '',
-        timeoutCount: 0,
-        switchType: 'inBound',
-        handleItem:0,
-        filterOptions: [
-          {
-            title: '交易时间',
-            selectOption: 'date',
-            selectItems: [{
-              key: '30天',
-              val: 1
-            }, {
-              key: '90天',
-              val: 2
-            }, {
-              key: '180天',
-              val: 3
-            }, {
-              key: '自定义',
-              val: 4
-            }],
-            defaultVal: 1
-          }
-        ]
-      }
-    },
-    methods: {
-      onRemind: function (str) {
-        this.remindText = str
-        this.timeoutCount++
-      },
-      setSwitchType (type) {
-        this.switchType = type
-      },
-      setSelect (type, val) {
-        if (type === 'date') {
-          if (val) {
-            this.filterParams.fromDate = val.fromDate
-            this.filterParams.toDate = val.toDate
-          } else {
-            this.filterParams.fromDate = null
-            this.filterParams.toDate = null
-          }
-        } else {
-          this.filterParams[type] = val
-        }
-        this.filterRecord()
-      },
-      initFilterParams () {
-        this.filterParams = {
-          keyword: '',
-          fromDate: '',
-          toDate: '',
-          currencyName: '',
-          method: ''
-        }
-      },
-      onSelectAction (selectObj) {
-        this.setSelect(selectObj.key, selectObj.value)
-      },
-      filterRecord () {
-        this.page = 1
-        this.isChange = true
-        this.reloadList()
-      },
-      reloadList () {
-        if (this.switchType === 'account') {
-          this.$store.dispatch('payCenter/loadBuyerAccount', {
-            count: this.count,
-            page: this.page,
-            sorting: {num: 'ASC'},
-            type: 'buyer'
-          })
-        } else {
-          this.$store.dispatch('payCenter/loadBuyerRecord', {
-            count: this.count,
-            page: this.page,
-            sorting: {'paytime': 'DESC'},
-            currencyName: this.filterParams.currencyName || null,
-            fromDate: this.filterParams.fromDate || null,
-            toDate: this.filterParams.toDate || null,
-            remitteeType: this.filterParams.remitteeType || null,
-            keyword: this.filterParams.keyword || null
-          })
-        }
-      },
-    }
-  }
-</script>
-<style lang="scss" scoped>
-  $base-color: #3f84f6;
-  $title-color: #ffa200;
-  .storage{
-    .storage-info{
-      padding: 0.24rem 0.24rem;
-      background: #fff;
-      margin-bottom:.2rem;
-    }
-    .linetext{
-      color:#666;
-      line-height: .6rem;
-      overflow: hidden;
-      -o-text-overflow: ellipsis;
-      text-overflow: ellipsis;
-      white-space: nowrap;
-      span{
-        color:#333;
-        &.base-color{
-          color:$base-color;
-        }
-      }
-    }
-    .info-list{
-      position:relative;
-      padding: 0.3rem 0.24rem;
-      background: #fff;
-      margin-bottom:.2rem;
-      .width50{
-        display:inline-block;
-        width: 48%;
-        margin-left: .1rem;
-      }
-      >span{
-        display:inline-block;
-        position:absolute;
-        left:0;
-        top:0;
-        padding: 0 .1rem;
-        background: $title-color;
-        border-radius: 0 .5rem .5rem 0;
-        line-height: .3rem;
-        height:.3rem;
-        color:#fff;
-        font-size: .24rem;
-      }
-    }
-  }
-</style>

+ 1 - 3
components/mobile/center/outOfStorage/index.js

@@ -1,6 +1,4 @@
 import StorageList from './StorageList.vue'
-import DetailStorage from './detailStorage'
 import OtherStorage from './otherStorage'
-import PurchaseStorage from './purchaseStorage'
 
-export { StorageList, DetailStorage, OtherStorage, PurchaseStorage }
+export { StorageList, OtherStorage }

+ 197 - 89
components/mobile/center/outOfStorage/otherStorage.vue

@@ -1,57 +1,82 @@
 <template>
   <div class="storage">
     <div class="btn-click">
-      <span class="base-color">新增</span>
-      <span class="base-color">保存</span>
-      <span class="clear">取消</span>
+      <span class="base-color" @click="saveClick()">保存</span>
+      <span class="clear" @click="saveClick('clear')">取消</span>
     </div>
     <div class="storage-info">
-      <div class="linetext">入库单: <span>21324</span></div>
-      <div class="linetext">买家名称: <span><input type="text"></span></div>
-      <div class="linetext">录入人: <span>21324</span></div>
-      <div class="linetext">录入时间: <span>21324</span></div>
+      <div class="linetext">{{switchType === 'INBOUND' ? '入库单' : '出库单'}}:<span>系统自动生成</span></div>
+      <div class="linetext">{{switchType === 'INBOUND' ? '卖家名称' : '买家名称'}}:
+        <span><input type="text" v-model="enName" :placeholder="switchType === 'INBOUND' ? '请输入卖家名称' : '请输入买家名称'"></span>
+      </div>
+      <div class="linetext">录入人: <span v-text="user.logged">21324</span></div>
+      <div class="linetext">录入时间: <span v-text="baseUtils.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')">21324</span></div>
     </div>
     <ul class="list-unstyled">
-      <li class="info-list clearfix">
-        <span class="super"><em>1</em></span>
-        <div class="linetext width50 fl">型号: <span><input type="text"></span></div>
-        <div class="linetext width50 fl">品牌: <span>21324</span></div>
-        <div class="linetext width50 fl">物料名称: <span>21324</span></div>
-        <div class="linetext width50 fl">规格: <span>21324</span></div>
-        <div class="linetext width50 fl"><em>*</em>出库数(PCS): <span><input type="text"></span></div>
-        <div class="linetext width50 fl">单价($): <span><input type="text"></span></div>
+      <li class="info-list clearfix" v-for="(item, index) in allObj">
+        <span class="super"><em v-text="index + 1">1</em></span>
+        <div class="linetext width50 fl">型号:
+          <span>
+            <input type="text" style="width:2rem;" v-model="item.cmpCode" @input="onCodeChange(index)" placeholder="">
+          </span>
+        </div>
+        <div class="linetext width50 fl">品牌: <span v-text="item.brand">21324</span></div>
+        <div class="linetext width50 fl">物料名称: <span v-text="item.pcmpcode">21324</span></div>
+        <div class="linetext width50 fl">规格: <span v-text="item.spec">21324</span></div>
+        <div class="linetext width50 fl"><em>*</em>{{switchType === 'INBOUND' ? '入库数' : '出库数'}}(PCS): <span><input type="text" style="width:1rem;" v-model.number="item.qty"></span></div>
+        <div class="linetext width50 fl">单价(¥):<span><input type="text" style="width:2rem;" v-model.number="item.price"></span></div>
+        <div class="content-line" v-show="item.showSimilarCodeList && item.cmpCode">
+          <ul class="similar">
+            <li v-for="sCode in similarCode" @click.stop="setCode(sCode, index)">
+              <span v-text="sCode.cmpCode"></span>
+              <span v-text="sCode.brand"></span>
+            </li>
+          </ul>
+        </div>
+        <div class="look-btn">
+          <span @click="addClick()" v-if="index === allObj.length - 1">新增</span>
+          <span @click="addClick(index)" v-if="index !== 0">删除</span>
+        </div>
       </li>
     </ul>
+    <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
   </div>
 </template>
 <script>
+  import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
   export default {
+    props: {
+      switchType: {
+        type: String,
+        default: 'INBOUND'
+      }
+    },
     data () {
       return {
         remindText: '',
-        timeoutCount: 0,
-        switchType: 'inBound',
-        handleItem:0,
-        filterOptions: [
-          {
-            title: '交易时间',
-            selectOption: 'date',
-            selectItems: [{
-              key: '30天',
-              val: 1
-            }, {
-              key: '90天',
-              val: 2
-            }, {
-              key: '180天',
-              val: 3
-            }, {
-              key: '自定义',
-              val: 4
-            }],
-            defaultVal: 1
-          }
-        ]
+        timeoutCount:0,
+        enName: '',
+        allObj:[],
+        storageObj: {
+          cmpCode: '',
+          brand: '',
+          pcmpcode: '',
+          spec: '',
+          qty: '',
+          price: '',
+          showSimilarCodeList: false,
+        },
+        similarCode:[]
+      }
+    },
+    components: {
+      RemindBox
+    },
+    mounted () {
+      let _this = this
+      this.allObj.push(this.storageObj)
+      document.body.onclick = function() {
+        _this.showSimilarCodeList = false
       }
     },
     methods: {
@@ -59,61 +84,99 @@
         this.remindText = str
         this.timeoutCount++
       },
-      setSwitchType (type) {
-        this.switchType = type
-      },
-      setSelect (type, val) {
-        if (type === 'date') {
-          if (val) {
-            this.filterParams.fromDate = val.fromDate
-            this.filterParams.toDate = val.toDate
-          } else {
-            this.filterParams.fromDate = null
-            this.filterParams.toDate = null
-          }
+      setFilterType (type) {
+        let bound = ''
+        if(type === 'OTHER_INBOUND') {
+          bound = '其他入库'
+        } else if(type === 'OTHER_OUTBOUND'){
+          bound = '其他出库'
+        } else if (type === 'PURCHASE_INBOUND') {
+          bound = '采购入库'
+        } else if(type === 'SELL_OUTBOUND') {
+          bound = '销售出库'
         } else {
-          this.filterParams[type] = val
+          bound = '全部类型'
         }
-        this.filterRecord()
+        return bound
       },
-      initFilterParams () {
-        this.filterParams = {
-          keyword: '',
-          fromDate: '',
-          toDate: '',
-          currencyName: '',
-          method: ''
-        }
+      initData () {
+        this.enName = ''
+        this.allObj = []
+        this.allObj.push(this.storageList)
+      },
+      onCodeChange (type) {
+        this.allObj[type].showSimilarCodeList = true
+        this.allObj[type].cmpCode = this.allObj[type].cmpCode.trim()
+        this.getSimilarCode(type)
       },
-      onSelectAction (selectObj) {
-        this.setSelect(selectObj.key, selectObj.value)
+      getSimilarCode: function (type) {
+        if (this.allObj[type].cmpCode) {
+          this.$http.get('/trade/products/code/keyword', {params: {keyword: this.allObj[type].cmpCode}})
+            .then(response => {
+              if(response.data){
+                this.similarCode = response.data || []
+              } else {
+                this.onRemind('没有找到产品信息')
+              }
+              this.allObj[type].showSimilarCodeList = response.data.length > 0
+            }).catch((err) => {
+              this.allObj[type].showSimilarCodeList = false
+              this.similarCode = []
+              this.onRemind('没有找到产品信息')
+            })
+        } else {
+          this.allObj[type].showSimilarCodeList = false
+        }
       },
-      filterRecord () {
-        this.page = 1
-        this.isChange = true
-        this.reloadList()
+      setCode (data, type) {
+        this.allObj[type].cmpCode = data.cmpCode
+        this.allObj[type].brand = data.pbranden
+        this.allObj[type].pcmpcode = data.kind
+        this.allObj[type].spec = data.spec
+        this.allObj[type].productId = data.id
+        this.allObj[type].showSimilarCodeList = false
       },
-      reloadList () {
-        if (this.switchType === 'account') {
-          this.$store.dispatch('payCenter/loadBuyerAccount', {
-            count: this.count,
-            page: this.page,
-            sorting: {num: 'ASC'},
-            type: 'buyer'
-          })
+      addClick (type) {
+        if(type) {
+         this.allObj.splice(type, 1)
         } else {
-          this.$store.dispatch('payCenter/loadBuyerRecord', {
-            count: this.count,
-            page: this.page,
-            sorting: {'paytime': 'DESC'},
-            currencyName: this.filterParams.currencyName || null,
-            fromDate: this.filterParams.fromDate || null,
-            toDate: this.filterParams.toDate || null,
-            remitteeType: this.filterParams.remitteeType || null,
-            keyword: this.filterParams.keyword || null
-          })
+          let _item = {
+            cmpCode: '',
+            brand: '',
+            pcmpcode: '',
+            spec: '',
+            qty: '',
+            price: '',
+            showSimilarCodeList: false,
+          }
+          this.allObj.push(_item)
         }
       },
+      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('保存信息成功')
+                }
+              })
+          }
+        }
+      }
     }
   }
 </script>
@@ -153,6 +216,52 @@
       background: #fff;
       margin-bottom:.2rem;
     }
+    .content-line{
+      position: absolute;
+      border: 1px solid #7e7e7e;
+      border-radius: .05rem;
+      left: .3rem;
+      top: 32%;
+      background: #fff;
+      width: 6.5rem;
+      max-height: 2.5rem;
+      overflow-y: auto;
+      z-index: 12;
+      .similar {
+        li {
+          height: .5rem;
+          line-height: .5rem;
+          font-size: .26rem;
+          color: #999;
+          padding-left: .19rem;
+          &:focus, &:active, &:hover {
+            background: #999;
+            color: #fff;
+          }
+          span{
+            display: inline-block;
+            width: 50%;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+          }
+        }
+      }
+    }
+    .look-btn{
+      position: absolute;
+      bottom: 0;
+      left: 0;
+      width: 100%;
+      border-top: 1px solid #d3d3d3;
+      text-align: center;
+      span{
+        display:inline-block;
+        width:50%;
+        text-align: center;
+        line-height: .8rem;
+      }
+    }
     .linetext{
       color:#666;
       line-height: .6rem;
@@ -161,12 +270,11 @@
       text-overflow: ellipsis;
       white-space: nowrap;
       input{
-        width: 1rem;
-        height: .56rem;
+        height: .5rem;
         font-size: .24rem;
         border-radius: .04rem;
         border: 1px solid #d2d2d2;
-        padding: 0 .2rem;
+        padding: 0 .1rem;
       }
       em{
         color:$red-color;
@@ -178,12 +286,12 @@
         }
       }
     }
-    ul{
+    > ul{
       margin-bottom:1rem;
     }
     .info-list{
       position:relative;
-      padding: 0.3rem 0.24rem;
+      padding: 0.3rem 0.24rem 1rem;
       background: #fff;
       margin-bottom:.2rem;
       .width50{

+ 0 - 172
components/mobile/center/outOfStorage/purchaseStorage.vue

@@ -1,172 +0,0 @@
-<template>
-  <div class="storage">
-    <div class="storage-info">
-      <div class="linetext">入库单: <span>21324</span></div>
-      <div class="linetext">买家名称: <span>21324</span></div>
-      <div class="linetext">所属订单: <span>21324</span></div>
-      <div class="linetext"><em>*</em>物流公司: <span>323425</span></div>
-      <div class="linetext"><em>*</em>物流单号:<span>34254</span></div>
-      <div class="linetext">录入人: <span>21324</span></div>
-      <div class="linetext">录入时间: <span>21324</span></div>
-    </div>
-    <ul class="list-unstyled">
-      <li class="info-list clearfix">
-        <span class="super"><em>1</em></span>
-        <div class="linetext width50 fl">型号: <span>21324</span></div>
-        <div class="linetext width50 fl">品牌: <span>21324</span></div>
-        <div class="linetext width50 fl">物料名称: <span>21324</span></div>
-        <div class="linetext width50 fl">规格: <span>21324</span></div>
-        <div class="linetext width50 fl">应出库(PCS): <span>21324</span></div>
-        <div class="linetext width50 fl">已出库(PCS): <span>21324</span></div>
-        <div class="linetext width50 fl"><em>*</em>本次出库(PCS): <span>21324</span></div>
-        <div class="linetext width50 fl">单价($): <span class="base-color">21324</span></div>
-      </li>
-    </ul>
-  </div>
-</template>
-<script>
-  export default {
-    data () {
-      return {
-        remindText: '',
-        timeoutCount: 0,
-        switchType: 'inBound',
-        handleItem:0,
-        filterOptions: [
-          {
-            title: '交易时间',
-            selectOption: 'date',
-            selectItems: [{
-              key: '30天',
-              val: 1
-            }, {
-              key: '90天',
-              val: 2
-            }, {
-              key: '180天',
-              val: 3
-            }, {
-              key: '自定义',
-              val: 4
-            }],
-            defaultVal: 1
-          }
-        ]
-      }
-    },
-    methods: {
-      onRemind: function (str) {
-        this.remindText = str
-        this.timeoutCount++
-      },
-      setSwitchType (type) {
-        this.switchType = type
-      },
-      setSelect (type, val) {
-        if (type === 'date') {
-          if (val) {
-            this.filterParams.fromDate = val.fromDate
-            this.filterParams.toDate = val.toDate
-          } else {
-            this.filterParams.fromDate = null
-            this.filterParams.toDate = null
-          }
-        } else {
-          this.filterParams[type] = val
-        }
-        this.filterRecord()
-      },
-      initFilterParams () {
-        this.filterParams = {
-          keyword: '',
-          fromDate: '',
-          toDate: '',
-          currencyName: '',
-          method: ''
-        }
-      },
-      onSelectAction (selectObj) {
-        this.setSelect(selectObj.key, selectObj.value)
-      },
-      filterRecord () {
-        this.page = 1
-        this.isChange = true
-        this.reloadList()
-      },
-      reloadList () {
-        if (this.switchType === 'account') {
-          this.$store.dispatch('payCenter/loadBuyerAccount', {
-            count: this.count,
-            page: this.page,
-            sorting: {num: 'ASC'},
-            type: 'buyer'
-          })
-        } else {
-          this.$store.dispatch('payCenter/loadBuyerRecord', {
-            count: this.count,
-            page: this.page,
-            sorting: {'paytime': 'DESC'},
-            currencyName: this.filterParams.currencyName || null,
-            fromDate: this.filterParams.fromDate || null,
-            toDate: this.filterParams.toDate || null,
-            remitteeType: this.filterParams.remitteeType || null,
-            keyword: this.filterParams.keyword || null
-          })
-        }
-      },
-    }
-  }
-</script>
-<style lang="scss" scoped>
-  $base-color: #3f84f6;
-  $title-color: #ffa200;
-  $red-color: #ff0000;
-  .storage{
-    .storage-info{
-      padding: 0.24rem 0.24rem;
-      background: #fff;
-      margin-bottom:.2rem;
-    }
-    .linetext{
-      color:#666;
-      line-height: .6rem;
-      overflow: hidden;
-      -o-text-overflow: ellipsis;
-      text-overflow: ellipsis;
-      white-space: nowrap;
-      em{
-        color:$red-color;
-      }
-      span{
-        color:#333;
-        &.base-color{
-          color:$base-color;
-        }
-      }
-    }
-    .info-list{
-      position:relative;
-      padding: 0.3rem 0.24rem;
-      background: #fff;
-      margin-bottom:.2rem;
-      .width50{
-        display:inline-block;
-        width: 48%;
-        margin-left: .1rem;
-      }
-      >span{
-        display:inline-block;
-        position:absolute;
-        left:0;
-        top:0;
-        padding: 0 .1rem;
-        background: $title-color;
-        border-radius: 0 .5rem .5rem 0;
-        line-height: .3rem;
-        height:.3rem;
-        color:#fff;
-        font-size: .24rem;
-      }
-    }
-  }
-</style>

+ 141 - 0
pages/mobile/center/vendor/outOfStorage/_id.vue

@@ -0,0 +1,141 @@
+<template>
+  <div class="storage">
+    <div class="com-mobile-header mobile-center-header">
+      <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
+      <p v-text="storageList.type === 'INBOUND' ? '查看入库记录' : '查看出库记录'"></p>
+      <p class="en-name"><img :src="`/images/mobile/center/${user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}</p>
+    </div>
+    <div class="mobile-fix-content mobile-centerfix-content" id="mobile-storage-center">
+      <div class="storage-record">
+        <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" 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>
+        <ul class="list-unstyled" v-if="storageList.inOutboundDetails">
+          <li class="info-list clearfix" v-for="(item, index) in storageList.inOutboundDetails">
+            <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.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">单价(¥): <span class="base-color" v-text="item.price || '-'">21324</span></div>
+          </li>
+        </ul>
+      </div>
+    </div>
+    <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
+  </div>
+</template>
+<script>
+  import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
+  export default {
+    middleware: 'authenticated',
+    layout: 'mobile',
+    fetch({route, store}) {
+      return Promise.all([
+        store.dispatch('product/getLoadStorageId', {id:route.params.id})
+      ])
+    },
+    data () {
+      return {
+        remindText: '',
+        timeoutCount: 0
+      }
+    },
+    components: {
+      RemindBox,
+      PullUp,
+      EmptyStatus
+    },
+    computed: {
+      storageList () {
+        console.log(this.$store.state.product.storage.detail.data)
+        return this.$store.state.product.storage.detail.data
+      }
+    },
+    methods: {
+      onRemind: function (str) {
+        this.remindText = str
+        this.timeoutCount++
+      },
+      setFilterType (type) {
+        let bound = ''
+        if(type === 'OTHER_INBOUND') {
+          bound = '其他入库'
+        } else if(type === 'OTHER_OUTBOUND'){
+          bound = '其他出库'
+        } else if (type === 'PURCHASE_INBOUND') {
+          bound = '采购入库'
+        } else if(type === 'SELL_OUTBOUND') {
+          bound = '销售出库'
+        } else {
+          bound = '全部类型'
+        }
+        return bound
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  $base-color: #3f84f6;
+  $title-color: #ffa200;
+  #mobile-storage-center {
+    padding-bottom: .5rem;
+    margin: 0 auto;
+  }
+  .storage-record{
+    padding: 0.24rem 0.24rem;
+    margin: 0 auto;
+    .storage-info{
+      padding: 0.24rem 0.24rem;
+      background: #fff;
+      margin-bottom:.2rem;
+    }
+    .linetext{
+      color:#666;
+      line-height: .6rem;
+      overflow: hidden;
+      -o-text-overflow: ellipsis;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      span{
+        color:#333;
+        &.base-color{
+          color:$base-color;
+        }
+      }
+    }
+    .info-list{
+      position:relative;
+      padding: 0.3rem 0.24rem;
+      background: #fff;
+      margin-bottom:.2rem;
+      .width50{
+        display:inline-block;
+        width: 48%;
+        margin-left: .1rem;
+      }
+      >span{
+        display:inline-block;
+        position:absolute;
+        left:0;
+        top:0;
+        padding: 0 .1rem;
+        background: $title-color;
+        border-radius: 0 .5rem .5rem 0;
+        line-height: .3rem;
+        height:.3rem;
+        color:#fff;
+        font-size: .24rem;
+      }
+    }
+  }
+</style>
+

+ 99 - 45
pages/mobile/center/vendor/outOfStorage/index.vue

@@ -6,25 +6,24 @@
       <p class="en-name"><img :src="`/images/mobile/center/${user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}</p>
     </div>
     <div class="mobile-fix-content mobile-centerfix-content" id="mobile-storage-center">
-      <!--入库记录-->
       <div>
         <div class="storage-head">
-          <span class="inline-block" :class="{'active': switchType === 'inBound'}" @click="setSwitchType('inBound')">入库</span>
-          <span class="inline-block" :class="{'active': switchType === 'outBound'}" @click="setSwitchType('outBound')">出库</span>
+          <span class="inline-block" :class="{'active': switchType === 'INBOUND'}" @click="setSwitchType('INBOUND')">入库</span>
+          <span class="inline-block" :class="{'active': switchType === 'OUTBOUND'}" @click="setSwitchType('OUTBOUND')">出库</span>
         </div>
         <div class="storage-record">
           <div class="search-content clearfix">
             <div class="search">
-              <input type="text" placeholder="卖家/发货单" class="staff-search">
-              <span><i class="iconfont icon-sousuo"></i></span>
+              <input type="text" v-model="filterParams.keyword" :placeholder="switchType ==='OUTBOUND' ? '发货单/卖家' : '订单号/买家'" class="staff-search" @keyup.13="filterRecord">
+              <span @click="filterRecord"><i class="iconfont icon-sousuo"></i></span>
             </div>
           </div>
           <div class="tab-content">
-            <span :class="{'active': handleItem === 0}" @click="handleItem = 0">{{switchType === 'inBound' ? '查看入库记录' : '查看出库记录'}}</span>
-            <span :class="{'active': handleItem === 1}" @click="handleItem = 1">{{switchType === 'inBound' ? '其它入库' : '其它出库'}}</span>
-            <span v-if="switchType === 'outBound'" :class="{'active': handleItem === 2}" @click="handleItem = 2">{{switchType === 'inBound' ? '采购入库' : '销售出库'}}</span>
+            <span :class="{'active': handleItem === 0}" @click="setHandleItem(0)">{{switchType === 'INBOUND' ? '查看入库记录' : '查看出库记录'}}</span>
+            <span :class="{'active': handleItem === 1}" @click="setHandleItem(1)">{{switchType === 'INBOUND' ? '其它入库' : '其它出库'}}</span>
+            <span :class="{'active': handleItem === 2}" @click="setHandleItem(2)">{{switchType === 'INBOUND' ? '采购入库' : '销售出库'}}</span>
           </div>
-          <div class="filters-wrap">
+          <div class="filters-wrap" v-if="handleItem !== 1">
             <base-filter
               v-for="filterOption in filterOptions"
               :key="filterOption.selectOption"
@@ -36,13 +35,11 @@
             </base-filter>
           </div>
           <div class="list-content">
-            <storage-list :listData="listData" v-if="handleItem === 0"></storage-list>
-            <!--<detail-storage></detail-storage>-->
-            <other-storage v-if="handleItem === 1"></other-storage>
-            <purchase-storage v-if="handleItem === 2"></purchase-storage>
+            <storage-list :listData="storageList" :switchType="switchType" :handleItem="handleItem" v-show="handleItem !== 1"></storage-list>
+            <other-storage :switchType="switchType" v-show="handleItem === 1"></other-storage>
           </div>
-          <!--<empty-status :type="'collect'" :showLink="true" :text="'抱歉,没有相关信息'" v-else></empty-status>-->
-          <!--<pull-up :fixId="'mobile-storage-center'" :searchMore="fetching" :allPage="allPage" :page="page" @pullUpAction="onPullUpAction"></pull-up>-->
+          <empty-status  v-if="isEmpty && handleItem !== 1" :type="'collect'" :showLink="true" :text="'抱歉,没有相关信息'"></empty-status>
+          <pull-up :fixId="'mobile-storage-center'" :searchMore="fetching" :allPage="allPage" :page="page" @pullUpAction="onPullUpAction"></pull-up>
         </div>
       </div>
     </div>
@@ -52,18 +49,15 @@
 <script>
   import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
   import { ModalWrapper, BaseFilter } from '~components/mobile/base'
-  import { StorageList, DetailStorage, OtherStorage, PurchaseStorage } from '~components/mobile/center/outOfStorage'
+  import { StorageList, OtherStorage } from '~components/mobile/center/outOfStorage'
   export default {
     middleware: 'authenticated',
     layout: 'mobile',
-    fetch({route, store}) {
-      return Promise.all([store.dispatch('product/getLoadStorageData', {})])
-    },
     data () {
       return {
         remindText: '',
         timeoutCount: 0,
-        switchType: 'inBound',
+        switchType: 'INBOUND',
         handleItem:0,
         filterOptions: [
           {
@@ -84,7 +78,18 @@
             }],
             defaultVal: 1
           }
-        ]
+        ],
+        page: 0,
+        isChange: false,
+        storageList: [],
+        filterParams:{
+          count: 10
+        },
+        filter:{
+          count: 10,
+          sorting: {"createtime":"DESC"},
+          status: '502-406'
+        }
       }
     },
     components: {
@@ -93,29 +98,85 @@
       EmptyStatus,
       BaseFilter,
       StorageList,
-      DetailStorage,
-      OtherStorage,
-      PurchaseStorage
+      OtherStorage
+    },
+    created () {
+      let currentTime = this.baseUtils.getClearDay(new Date())
+      let fromDate = currentTime - 29 * 24 * 60 * 60 * 1000
+      let toDate = currentTime + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
+      this.$store.dispatch('product/getLoadStorageData', {count: 10, page: 1, fromDate: fromDate, toDate: toDate, type: 'INBOUND'})
+    },
+    watch: {
+      'storageData': {
+        handler: function (val) {
+          if (val && val.content) {
+            this.storageList = val.content
+            this.isChange = false
+          }
+          this.storageList = [...this.storageList, ...val.content]
+        }
+      }
+    },
+    computed: {
+      storageData () {
+        return this.allStorageData.data
+      },
+      allStorageData () {
+        return this.$store.state.product.storage.list
+      },
+      fetching () {
+        return this.allStorageData.fetching
+      },
+      allPage () {
+        return this.allStorageData.totalPages
+      },
+      isEmpty () {
+        return this.storageList.length === 0
+      }
     },
     methods: {
       onRemind: function (str) {
         this.remindText = str
         this.timeoutCount++
       },
+      onPullUpAction () {
+        this.filterParams.page++
+        this.filter.page++
+        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) {
+          this.filterParams.page = 1
+          this.filter.page = 1
+          this.isChange = true
+          this.reloadList()
+        }
       },
       setSelect (type, val) {
         if (type === 'date') {
           if (val) {
             this.filterParams.fromDate = val.fromDate
+            this.filter.startMils = val.fromDate
             this.filterParams.toDate = val.toDate
+            this.filter.endMils = val.toDate
           } else {
             this.filterParams.fromDate = null
+            this.filter.startMils = null
             this.filterParams.toDate = null
+            this.filter.endMils = null
           }
         } else {
           this.filterParams[type] = val
+          this.filter[type] = val
         }
         this.filterRecord()
       },
@@ -125,36 +186,29 @@
           fromDate: '',
           toDate: '',
           currencyName: '',
-          method: ''
-        }
+          type: ''
+        },
+          this.filter = {
+            keyword: '',
+            startMils: '',
+            endMils: ''
+          }
       },
       onSelectAction (selectObj) {
         this.setSelect(selectObj.key, selectObj.value)
       },
       filterRecord () {
-        this.page = 1
+        this.filterParams.page = 1
+        this.filter.page = 1
+        this.filterParams.type = this.switchType
         this.isChange = true
         this.reloadList()
       },
       reloadList () {
-        if (this.switchType === 'account') {
-          this.$store.dispatch('payCenter/loadBuyerAccount', {
-            count: this.count,
-            page: this.page,
-            sorting: {num: 'ASC'},
-            type: 'buyer'
-          })
-        } else {
-          this.$store.dispatch('payCenter/loadBuyerRecord', {
-            count: this.count,
-            page: this.page,
-            sorting: {'paytime': 'DESC'},
-            currencyName: this.filterParams.currencyName || null,
-            fromDate: this.filterParams.fromDate || null,
-            toDate: this.filterParams.toDate || null,
-            remitteeType: this.filterParams.remitteeType || null,
-            keyword: this.filterParams.keyword || null
-          })
+        if(this.handleItem === 0) {
+          this.$store.dispatch('product/getLoadStorageData', this.filterParams)
+        } else if(this.handleItem === 2) {
+          this.$store.dispatch('product/getLoadPurchaseData', this.filter)
         }
       },
     }

+ 169 - 0
pages/mobile/center/vendor/outOfStorage/purchase/_storeid.vue

@@ -0,0 +1,169 @@
+<template>
+  <div class="storage">
+    <div class="com-mobile-header mobile-center-header">
+      <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
+      <p v-text="storageList.type === 'INBOUND' ? '采购入库' : '销售出库'"></p>
+      <p class="en-name"><img :src="`/images/mobile/center/${user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}</p>
+    </div>
+    <div class="mobile-fix-content mobile-centerfix-content" id="mobile-storage-center">
+      <div class="storage-record">
+        <div class="btn-click">
+          <span class="base-color" @click="saveClick()">保存</span>
+          <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" 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>
+        <ul class="list-unstyled" v-if="storageList.inOutboundDetails">
+          <li class="info-list clearfix" v-for="(item, index) in storageList.inOutboundDetails">
+            <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.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">单价(¥): <span class="base-color" v-text="item.price || '-'">21324</span></div>
+          </li>
+        </ul>
+      </div>
+    </div>
+    <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
+  </div>
+</template>
+<script>
+  import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
+  export default {
+    middleware: 'authenticated',
+    layout: 'mobile',
+    fetch({route, store}) {
+      return Promise.all([
+        store.dispatch('product/getLoadPurchaseId', {id:route.params.storeid})
+      ])
+    },
+    data () {
+      return {
+        remindText: '',
+        timeoutCount: 0
+      }
+    },
+    components: {
+      RemindBox,
+      PullUp,
+      EmptyStatus
+    },
+    computed: {
+      storageList () {
+        console.log(this.$store.state.product.storage.detail.data)
+        return this.$store.state.product.storage.detail.data
+      }
+    },
+    methods: {
+      onRemind: function (str) {
+        this.remindText = str
+        this.timeoutCount++
+      },
+      setFilterType (type) {
+        let bound = ''
+        if(type === 'OTHER_INBOUND') {
+          bound = '其他入库'
+        } else if(type === 'OTHER_OUTBOUND'){
+          bound = '其他出库'
+        } else if (type === 'PURCHASE_INBOUND') {
+          bound = '采购入库'
+        } else if(type === 'SELL_OUTBOUND') {
+          bound = '销售出库'
+        } else {
+          bound = '全部类型'
+        }
+        return bound
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  $base-color: #3f84f6;
+  $title-color: #ffa200;
+  #mobile-storage-center {
+    padding-bottom: .5rem;
+    margin: 0 auto;
+  }
+  .storage-record{
+    padding: 0.24rem 0.24rem;
+    margin: 0 auto;
+    .btn-click{
+      padding: 0.24rem 0.24rem;
+      position: absolute;
+      bottom: -1rem;
+      left: 0;
+      right: 0;
+      text-align: center;
+      span{
+        display:inline-block;
+        width:30%;
+        height: .6rem;
+        line-height: .6rem;
+        margin: 0 .1rem;
+        border-radius:.05rem;
+        &.clear{
+          color:#fafbfc;
+          background: #b5b5b5;
+        }
+        &.base-color{
+          color:#fff;
+          background: $base-color;
+        }
+      }
+    }
+    .storage-info{
+      padding: 0.24rem 0.24rem;
+      background: #fff;
+      margin-bottom:.2rem;
+    }
+    .linetext{
+      color:#666;
+      line-height: .6rem;
+      overflow: hidden;
+      -o-text-overflow: ellipsis;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      span{
+        color:#333;
+        &.base-color{
+          color:$base-color;
+        }
+      }
+    }
+    .info-list{
+      position:relative;
+      padding: 0.3rem 0.24rem;
+      background: #fff;
+      margin-bottom:.2rem;
+      .width50{
+        display:inline-block;
+        width: 48%;
+        margin-left: .1rem;
+      }
+      >span{
+        display:inline-block;
+        position:absolute;
+        left:0;
+        top:0;
+        padding: 0 .1rem;
+        background: $title-color;
+        border-radius: 0 .5rem .5rem 0;
+        line-height: .3rem;
+        height:.3rem;
+        color:#fff;
+        font-size: .24rem;
+      }
+    }
+  }
+</style>
+

+ 31 - 1
store/product.js

@@ -233,11 +233,41 @@ export const actions = {
   // 获取出入库所有记录数据
   getLoadStorageData({commit}, params = {}) {
     commit('storage/REQUEST_LIST')
-    return axios.get('CommodityInOutbound/page', {params: params})
+    return axios.get('/CommodityInOutbound/page', {params: params})
       .then(res => {
         commit('storage/GET_LIST_SUCCESS', res.data)
       }, err => {
         commit('storage/GET_LIST_FAILURE', err)
       })
+  },
+  // 获取出入库单条记录数据
+  getLoadStorageId({commit}, params = {}) {
+    commit('storage/REQUEST_DETAIL')
+    return axios.get('/CommodityInOutbound/id', {params: params})
+      .then(res => {
+        commit('storage/GET_DETAIL_SUCCESS', res.data.data)
+      }, err => {
+        commit('storage/GET_DETAIL_FAILURE', err)
+      })
+  },
+  // 获取销售出库所有记录数据
+  getLoadPurchaseData({commit}, params = {}) {
+    commit('storage/REQUEST_LIST')
+    return axios.get('/trade/purchase/status/createtime', {params: params})
+      .then(res => {
+        commit('storage/GET_LIST_SUCCESS', res.data)
+      }, err => {
+        commit('storage/GET_LIST_FAILURE', err)
+      })
+  },
+  // 获取出入库单条记录数据
+  getLoadPurchaseId({commit}, params = {}) {
+    commit('storage/REQUEST_DETAIL')
+    return axios.get('/trade/purchase/purchaseId/' + params.id)
+      .then(res => {
+        commit('storage/GET_DETAIL_SUCCESS', res.data.data)
+      }, err => {
+        commit('storage/GET_DETAIL_FAILURE', err)
+      })
   }
 }

+ 14 - 0
store/product/storage.js

@@ -2,6 +2,10 @@ export const state = () => ({
   list: {
     fetching: false,
     data: []
+  },
+  detail: {
+    fetching: false,
+    data:[]
   }
 })
 
@@ -15,5 +19,15 @@ export const mutations = {
   },
   GET_LIST_FAILURE (state) {
     state.list.fetching = false
+  },
+  REQUEST_DETAIL (state) {
+    state.detail.fetching = true
+  },
+  GET_DETAIL_SUCCESS(state, result) {
+    state.detail.data = result
+    state.detail.fetching = false
+  },
+  GET_DETAIL_FAILURE(state) {
+    state.detail.fetching = false
   }
 }