浏览代码

Merge branch 'release-201832-wangcz'

yangc 7 年之前
父节点
当前提交
217b1dc9aa

+ 4 - 5
components/home/Carousel.vue

@@ -35,11 +35,10 @@
     computed: {
       banners () {
         if (this.$store.state.carousel.banners.data && this.$store.state.carousel.banners.data.data) {
-          let banner = this.$store.state.carousel.banners.data.data.slice()
-           banner.sort(function (a, b) {
-             return a.contentId - b.contentId
-           })
-          return banner
+           // banner.sort(function (a, b) {
+           //   return a.contentId - b.contentId
+           // })
+          return this.$store.state.carousel.banners.data.data.slice()
         } else {
           return ''
         }

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

@@ -62,10 +62,10 @@
       },
       loadAllInfo (type, i) {
         if(i === 0) {
-          this.$router.push('/mobile/center/vendor/outOfStorage/' + type)
+          this.$router.push(`/mobile/center/${this.switchType === 'INBOUND' ? 'user' : 'vendor'}/outOfStorage/${type}`)
         } else if(i === 1){
           if(this.switchType === 'INBOUND') {
-            this.$router.push(`/mobile/center/vendor/outOfStorage/purchase/${type.id}?type=INBOUND`)
+            this.$router.push(`/mobile/center/user/outOfStorage/purchase/${type.id}?type=INBOUND`)
           } else {
             this.$router.push(`/mobile/center/vendor/outOfStorage/purchase/${this.baseUtils.enidfilter(type.purchaseid)}?type=OUTBOUND`)
           }

+ 22 - 22
pages/mobile/center/user/doPay/_ids.vue

@@ -117,28 +117,28 @@
         this.imgUrl = obj.url
       },
       submit () {
-        console.log(this.imgUrl)
-        if (this.imgUrl) {
-          let arr = []
-          this.orderData.forEach(item => {
-            arr.push(item.orderid)
-          })
-          this.$http.post(`/trade/transfer?order=${arr.join('-')}`, {
-            imgUrl: this.imgUrl,
-            total: this.totalPrice,
-            type: 'PAIDTOPLATFORM'
-          }).then(res => {
-            if (res.data === 'success') {
-              this.$router.push('/mobile/order?type=buyer')
-            } else {
-              this.setRemindText(res.data || '付款失败')
-            }
-          }, err => {
-            this.setRemindText(err.response.data || '付款失败')
-          })
-        } else {
-          this.setRemindText('请上传付款凭证')
-        }
+        // if (this.imgUrl) {
+        //
+        // } else {
+        //   this.setRemindText('请上传付款凭证')
+        // }
+        let arr = []
+        this.orderData.forEach(item => {
+          arr.push(item.orderid)
+        })
+        this.$http.post(`/trade/transfer?order=${arr.join('-')}`, {
+          imgUrl: this.imgUrl,
+          total: this.totalPrice,
+          type: 'PAIDTOPLATFORM'
+        }).then(res => {
+          if (res.data === 'success') {
+            this.$router.push('/mobile/order?type=buyer')
+          } else {
+            this.setRemindText(res.data || '付款失败')
+          }
+        }, err => {
+          this.setRemindText(err.response.data || '付款失败')
+        })
       }
     }
   }

+ 4 - 0
pages/mobile/center/user/index.vue

@@ -38,6 +38,10 @@
             <img src="/images/mobile/center/user/cart.jpg" alt="">
             <p>购物车<span class="text" v-if="carCount > 0">{{carCount && carCount >= 99 ? 99 : carCount || 0}}</span></p>
           </nuxt-link>
+          <nuxt-link tag="li" to="/mobile/center/user/outOfStorage?providerType=person">
+            <img src="/images/mobile/center/vendor/material-person.png" alt="">
+            <p>入库</p>
+          </nuxt-link>
           <nuxt-link tag="li" to="/mobile/center/user/invoice/waitinvoice" class="content-line">
             <img src="/images/mobile/center/user/invoice_icon.png" alt="">
             <p>发票管理</p>

+ 141 - 0
pages/mobile/center/user/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">单价({{currency === 'RMB' ? '¥': '$'}}): <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}),
+        store.dispatch('loadCurrencyData')
+      ])
+    },
+    data () {
+      return {
+        remindText: '',
+        timeoutCount: 0
+      }
+    },
+    components: {
+      RemindBox,
+      PullUp,
+      EmptyStatus
+    },
+    computed: {
+      storageList () {
+        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>
+

+ 289 - 0
pages/mobile/center/user/outOfStorage/index.vue

@@ -0,0 +1,289 @@
+<template>
+  <div class="storage">
+    <div class="com-mobile-header mobile-center-header">
+      <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
+      <p>产品入库</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>
+        <div class="storage-record">
+          <div class="search-content clearfix">
+            <div class="search">
+              <input type="text" v-model="filterParams.keyword" :placeholder="switchType ==='OUTBOUND' ? (handleItem === 0 ? '出库单号/买家名称':'订单号/买家名称') : (handleItem === 0 ? '入库单号/卖家名称':'发货单/卖家名称')" 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="setHandleItem(0)">{{switchType === 'INBOUND' ? '查看入库记录' : '查看出库记录'}}</span>
+            <span :class="{'active': handleItem === 2}" @click="setHandleItem(2)">{{switchType === 'INBOUND' ? '采购入库' : '销售出库'}}</span>
+            <span :class="{'active': handleItem === 1}" @click="setHandleItem(1)">{{switchType === 'INBOUND' ? '其它入库' : '其它出库'}}</span>
+          </div>
+          <div class="filters-wrap" v-show="handleItem !== 1">
+            <base-filter
+              v-for="filterOption in filterOptions"
+              :key="filterOption.selectOption"
+              :selectItems="filterOption.selectItems"
+              :defaultVal="filterOption.defaultVal"
+              :selectOption="filterOption.selectOption"
+              @selectAction="onSelectAction"
+              @valueAction="onValueAction"
+              :title="filterOption.title">
+            </base-filter>
+          </div>
+          <div class="list-content">
+            <storage-list :listData="storageList" :switchType="switchType" :handleItem="handleItem" v-if="handleItem !== 1"></storage-list>
+            <other-storage :switchType="switchType" v-else></other-storage>
+          </div>
+          <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>
+    <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
+  </div>
+</template>
+<script>
+  import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
+  import { ModalWrapper, BaseFilter } from '~components/mobile/base'
+  import { StorageList, OtherStorage } from '~components/mobile/center/outOfStorage'
+  export default {
+    middleware: 'authenticated',
+    layout: 'mobile',
+    fetch({store}) {
+      return Promise.all([
+        store.dispatch('loadCurrencyData')
+      ])
+    },
+    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
+          }
+        ],
+        page: 1,
+        isChange: false,
+        storageList: [],
+        filterParams:{
+          count: 10
+        },
+        filter:{
+          count: 10,
+          sorting: {"createtime":"DESC"},
+          status: '502-406'
+        }
+      }
+    },
+    components: {
+      RemindBox,
+      PullUp,
+      EmptyStatus,
+      BaseFilter,
+      StorageList,
+      OtherStorage
+    },
+    created () {
+      this.switchType = this.$route.query.type ? this.$route.query.type : 'INBOUND'
+      this.handleItem = this.$route.query.handleItem ? Number(this.$route.query.handleItem) : 0
+      this.reloadList()
+    },
+    watch: {
+      'storageData': {
+        handler: function (val) {
+          if (val && val.content) {
+            if(this.isChange){
+              this.storageList = []
+              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.storageData.totalPages
+      },
+      isEmpty () {
+        return this.storageList.length === 0
+      }
+    },
+    methods: {
+      onRemind: function (str) {
+        this.remindText = str
+        this.timeoutCount++
+      },
+      onPullUpAction () {
+        this.page++
+        this.filterParams.page = this.page
+        this.filter.page = this.page
+        this.reloadList()
+      },
+      setHandleItem (type) {
+        if(type !== this.handleItem) {
+          this.handleItem = type
+          if(type !== 1) {
+            this.filterParams.page = 1
+            this.filter.page = 1
+            this.page = 1
+            this.isChange = true
+            this.reloadList()
+          }
+        }
+      },
+      setSelect (type, val, isReload) {
+        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
+        }
+        isReload && this.filterRecord()
+      },
+      initFilterParams () {
+        this.filterParams = {
+          keyword: '',
+          fromDate: '',
+          toDate: '',
+          type: ''
+        },
+          this.filter = {
+            keyword: '',
+            startMils: '',
+            endMils: ''
+          }
+      },
+      onSelectAction (selectObj) {
+        this.setSelect(selectObj.key, selectObj.value, true)
+      },
+      onValueAction (selectObj) {
+        this.setSelect(selectObj.key, selectObj.value, false)
+      },
+      filterRecord () {
+        this.filterParams.page = 1
+        this.filter.page = 1
+        this.isChange = true
+        this.reloadList()
+      },
+      reloadList () {
+        this.filterParams.type = this.switchType
+        if(this.handleItem === 0) {
+          this.$store.dispatch('product/getLoadStorageData', this.filterParams)
+        } else if(this.handleItem === 2) {
+          if(this.switchType === 'INBOUND') {
+            this.filterParams.type = null
+            this.$store.dispatch('product/getLoadEnterpriseData', this.filterParams)
+          } else {
+            this.$store.dispatch('product/getLoadPurchaseData', this.filter)
+          }
+        }
+      }
+    }
+  }
+</script>
+<style lang="scss">
+  $base-color: #3f84f6;
+  #mobile-storage-center {
+    padding-bottom: .5rem;
+    margin: 0 auto;
+    .storage-record {
+      .search-content {
+        padding: .20rem 0;
+        text-align: center;
+        input {
+          margin: 0;
+          width: 7.1rem;
+          border: 1px solid $base-color;
+        }
+      }
+      .tab-content{
+        margin: 0 auto .13rem;
+        width: 7.1rem;
+        overflow: hidden;
+        text-align: center;
+        span{
+          float: left;
+          display: inline-block;
+          width: 2.36rem;
+          height: .62rem;
+          line-height: .62rem;
+          text-align: center;
+          color: #999999;
+          font-size: .26rem;
+          background-color: #ffffff;
+          border: solid 1px #d7d7d7;
+          -webkit-box-sizing: border-box;
+          box-sizing: border-box;
+          &.active{
+            background-color: #3f84f6;
+            border: none;
+            color: #fff;
+          }
+          &:first-child{
+            border-top-left-radius: .05rem;
+            border-bottom-left-radius: .05rem;
+          }
+          &:nth-child(2){
+            border-left: none;
+            border-right: none;
+          }
+          &:last-child{
+            border-top-right-radius: .05rem;
+            border-bottom-right-radius: .05rem;
+          }
+        }
+      }
+      .filters-wrap{
+        background: #fff;
+        margin: 0 auto .13rem;
+        width: 7.1rem;
+        overflow: hidden;
+        padding: .1rem;
+      }
+      .list-content{
+        margin: 0 auto;
+        padding: 0 .20rem;
+        margin-bottom:1.2rem;
+      }
+    }
+  }
+</style>

+ 337 - 0
pages/mobile/center/user/outOfStorage/purchase/_storeid.vue

@@ -0,0 +1,337 @@
+<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="switchType === '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" v-if="switchType === 'INBOUND'">
+        <div class="btn-click">
+          <span class="base-color" @click="saveClick('INBOUND')">保存</span>
+          <span class="clear" @click="saveClick('clear')">取消</span>
+        </div>
+        <div class="storage-info">
+          <div class="linetext">入库单: <span>系统自动生成</span></div>
+          <div class="linetext">卖家名称: <span v-text="storageList.sellername || '-'">21324</span></div>
+          <div class="linetext">所属订单: <span v-text="storageList.orid || '-'">21324</span></div>
+          <div class="linetext" v-if="allObj.logistics">物流公司:<span v-text="allObj.logistics.companyName"></span></div>
+          <div class="linetext" v-if="allObj.logistics">物流单号:<span v-text="allObj.logistics.number"></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.invoiceDetails" style="margin-bottom:.8rem;">
+          <li class="info-list clearfix" v-for="(item, index) in storageList.invoiceDetails">
+            <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.brandNameEn || '-'">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">入库数(PCS):<span v-text="item.qty || '-'">-</span></div>
+            <div class="linetext width50 fl">单价({{currency === 'RMB' ? '¥': '$'}}): <span class="base-color" v-text="item.taxUnitprice || '-'">21324</span></div>
+          </li>
+        </ul>
+      </div>
+      <div class="storage-record" v-if="switchType === 'OUTBOUND'">
+        <div class="btn-click">
+          <span class="base-color" @click="saveClick('OUTBOUND')">保存</span>
+          <span class="clear" @click="saveClick('clear')">取消</span>
+        </div>
+        <div class="storage-info">
+          <div class="logistics-line" v-show="showLogistics && logisticsCode">
+            <ul class="similar">
+              <li v-for="sCode in logisticsCode" @click.stop="setLogisticsCode(sCode.companyName)">
+                <span v-text="sCode.companyName"></span>
+              </li>
+              <li v-if="logisticsCode.length <= 0"><span>请去PC端物流管理维护物流信息</span></li>
+            </ul>
+          </div>
+          <div class="linetext">出库单: <span>系统自动生成</span></div>
+          <div class="linetext">买家名称: <span v-text="storageList.buyentername || storageList.buyername">21324</span></div>
+          <div class="linetext">所属订单: <span v-text="storageList.orderid || '-'">21324</span></div>
+          <div class="linetext"><em>*</em>物流公司:<span>
+            <input style="width:3rem;" type="text" readonly placeholder="请选择物流公司" v-model="allObj.logisticsInfo.companyName" @click.stop="showLogistics = !showLogistics">
+          </span></div>
+          <div class="linetext"><em>*</em>物流单号:<span>
+            <input style="width:3rem;" type="text" v-model="allObj.logisticsInfo.number">
+          </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.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.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">应出库(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">出库数(PCS):
+              <span v-if="item.qty === item.number">-</span>
+              <input style="width:1.2rem;" v-else type="text" v-model="item.qty" @blur="ChangeSendCount(item, item.qty)">
+            </div>
+            <div class="linetext width50 fl">单价(¥): <span class="base-color" v-text="item.taxUnitPrice || '-'">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 route.query.type === 'INBOUND' ? Promise.all([
+        store.dispatch('product/getLoadEnterpriseId', {id:route.params.storeid}),
+        store.dispatch('loadCurrencyData')
+      ]) : Promise.all([
+        store.dispatch('product/getLoadPurchaseId', {id:route.params.storeid}),
+        store.dispatch('product/getLoadLogistics', {count:30, page: 1}),
+        store.dispatch('loadCurrencyData')
+      ])
+    },
+    data () {
+      return {
+        remindText: '',
+        timeoutCount: 0,
+        switchType: this.$route.query.type,
+        storageList: {},
+        showLogistics: false,
+        allObj:{
+          logisticsInfo: {},
+          map: []
+        }
+      }
+    },
+    components: {
+      RemindBox,
+      PullUp,
+      EmptyStatus
+    },
+    mounted () {
+      let data = this.$store.state.product.storage.detail.data
+      this.storageList = data ? JSON.parse(JSON.stringify(this.$store.state.product.storage.detail.data)) : {}
+      let _this = this
+      document.body.onclick = function() {
+        _this.showLogistics = false
+      }
+    },
+    computed: {
+      logisticsCode () {
+        return this.$store.state.product.storage.logistics.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
+      },
+      ChangeSendCount (type, val) {
+        let newShipQty = type.shipQty ? type.shipQty : 0
+        if (val > type.number - newShipQty) {
+          this.onRemind('本次发货数量不能大于已剩数量')
+          val = type.number - newShipQty
+        }
+        type.qty = val
+      },
+      setLogisticsCode (val) {
+        this.showLogistics = false
+        this.allObj.logisticsInfo.companyName = val
+      },
+      saveClick (type) {
+        if(type === 'clear') {
+          this.$router.push(`/mobile/center/${this.switchType === 'OUTBOUND' ? 'vendor' : 'user'}/outOfStorage?providerType=person&handleItem=2&type=${this.$route.query.type}`)
+        }else if(type === 'OUTBOUND'){
+          if(!this.allObj.logisticsInfo.companyName) {
+            this.onRemind('请先选择物流公司')
+          } else if(!this.allObj.logisticsInfo.number) {
+              this.onRemind('请填写物流单号')
+          } else {
+            let arr = []
+            this.storageList.purchaseDetails.forEach(val => {
+              if(val.qty) {
+                arr.push({id: val.id, qty: Number(val.qty)})
+              }
+            })
+            if(arr.length <= 0) {
+              this.onRemind('最少填写一个发货数量')
+            } else {
+              console.log(type)
+              this.allObj.sendType = this.storageList.sendType
+              this.allObj.map = arr
+              this.allObj.jsonSdAddress = this.storageList.jsonAddress
+              this.$http.post(`/trade/invoice/inFpu/save?id=${this.storageList.id}`, this.allObj)
+                .then(response => {
+                  if(response.data.code === 1){
+                    this.onRemind('保存信息成功')
+                    setTimeout(() => {
+                      this.$router.push(`/mobile/center/vendor/outOfStorage?providerType=person&handleItem=2&type=${this.$route.query.type}`)
+                    }, 1000)
+                  } else {
+                    this.onRemind('保存信息失败')
+                  }
+                }).catch(err => {
+                  this.onRemind('保存信息失败')
+              })
+            }
+          }
+        } else if(type === 'INBOUND') {
+          this.$http.put(`/trade/order/signReceive?_status=ensureaccept&invoiceId=${this.storageList.invoiceid}`)
+            .then(response => {
+              if(response.data.code === 1){
+                this.onRemind('保存信息成功')
+                setTimeout(() => {
+                  this.$router.push(`/mobile/center/user/outOfStorage?providerType=person&handleItem=2&type=${this.$route.query.type}`)
+                }, 1000)
+              } else {
+                this.onRemind('保存信息失败')
+              }
+            }).catch(err => {
+              this.onRemind('保存信息失败')
+            })
+        }
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  $base-color: #3f84f6;
+  $title-color: #ffa200;
+  $red-color: #ff0000;
+  #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: fixed;
+      bottom: 1rem;
+      left: 0;
+      right: 0;
+      text-align: center;
+      background: #f1f3f6;
+      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{
+      position:relative;
+      padding: 0.24rem 0.24rem;
+      background: #fff;
+      margin-bottom:.2rem;
+      .logistics-line{
+        position: absolute;
+        top: 2.6rem;
+        left: 1.75rem;
+        border: 1px solid $base-color;
+        border-radius: .04rem;
+        width: 3rem;
+        background: #fff;
+        z-index: 1;
+        max-height: 3.96rem;
+        overflow-y: auto;
+        .similar {
+          li {
+            height: .66rem;
+            line-height: .66rem;
+            padding: 0 .19rem;
+            font-size: .24rem;
+            &:active, &:focus {
+              background: #f7f7f7;
+            }
+          }
+        }
+      }
+    }
+    .linetext{
+      color:#666;
+      line-height: .6rem;
+      overflow: hidden;
+      -o-text-overflow: ellipsis;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      em{
+        color:$red-color;
+      }
+      input{
+        height: .5rem;
+        font-size: .24rem;
+        border-radius: .04rem;
+        border: 1px solid #d2d2d2;
+        padding: 0 .1rem;
+      }
+      input[readonly] {
+        padding: 0 .2rem;
+        background: url('/images/mobile/select-arrow.png') no-repeat;
+        background-size: .24rem .15rem;
+        background-position: 2.6rem .2rem;
+      }
+      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 - 1
pages/mobile/center/vendor/index.vue

@@ -18,7 +18,7 @@
           </nuxt-link>
           <nuxt-link tag="li" to="/mobile/center/vendor/outOfStorage?providerType=person">
             <img src="/images/mobile/center/vendor/material-person.png" alt="">
-            <p>出库</p>
+            <p>出库</p>
           </nuxt-link>
           <!--<nuxt-link tag="li" to="/mobile/center/vendor/product?providerType=onLine">-->
             <!--<img src="/images/mobile/center/vendor/onsale.png" alt="">-->

+ 1 - 1
pages/mobile/center/vendor/outOfStorage/_id.vue

@@ -9,7 +9,7 @@
       <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">{{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>

+ 7 - 39
pages/mobile/center/vendor/outOfStorage/index.vue

@@ -2,15 +2,11 @@
   <div class="storage">
     <div class="com-mobile-header mobile-center-header">
       <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
-      <p>产品出库</p>
+      <p>产品出库</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>
-        <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>
-        </div>
         <div class="storage-record">
           <div class="search-content clearfix">
             <div class="search">
@@ -19,9 +15,9 @@
             </div>
           </div>
           <div class="tab-content">
-            <span :class="{'active': handleItem === 0}" @click="setHandleItem(0)">{{switchType === 'INBOUND' ? '查看入库记录' : '查看出库记录'}}</span>
-            <span :class="{'active': handleItem === 2}" @click="setHandleItem(2)">{{switchType === 'INBOUND' ? '采购入库' : '销售出库'}}</span>
-            <span :class="{'active': handleItem === 1}" @click="setHandleItem(1)">{{switchType === 'INBOUND' ? '其它入库' : '其它出库'}}</span>
+            <span :class="{'active': handleItem === 0}" @click="setHandleItem(0)">查看出库记录</span>
+            <span :class="{'active': handleItem === 2}" @click="setHandleItem(2)">销售出库</span>
+            <span :class="{'active': handleItem === 1}" @click="setHandleItem(1)">其它出库</span>
           </div>
           <div class="filters-wrap" v-show="handleItem !== 1">
             <base-filter
@@ -63,7 +59,7 @@
       return {
         remindText: '',
         timeoutCount: 0,
-        switchType: 'INBOUND',
+        switchType: 'OUTBOUND',
         handleItem: 0,
         filterOptions: [
           {
@@ -107,7 +103,6 @@
       OtherStorage
     },
     created () {
-      this.switchType = this.$route.query.type ? this.$route.query.type : 'INBOUND'
       this.handleItem = this.$route.query.handleItem ? Number(this.$route.query.handleItem) : 0
       this.reloadList()
     },
@@ -115,7 +110,7 @@
       'storageData': {
         handler: function (val) {
           if (val && val.content) {
-            if(this.isChange){
+            if (this.isChange) {
               this.storageList = []
               this.isChange = false
             }
@@ -152,17 +147,6 @@
         this.filter.page = this.page
         this.reloadList()
       },
-      setSwitchType (type) {
-        if(type !== this.switchType) {
-          this.switchType = type
-          this.filterParams.type = type
-          this.page = 1
-          this.filterParams.page = 1
-          this.filter.page = 1
-          this.isChange = true
-          this.reloadList()
-        }
-      },
       setHandleItem (type) {
         if(type !== this.handleItem) {
           this.handleItem = type
@@ -231,7 +215,7 @@
             this.$store.dispatch('product/getLoadPurchaseData', this.filter)
           }
         }
-      },
+      }
     }
   }
 </script>
@@ -240,22 +224,6 @@
   #mobile-storage-center {
     padding-bottom: .5rem;
     margin: 0 auto;
-    .storage-head {
-      height: .82rem;
-      line-height: .82rem;
-      text-align: center;
-      background: #fff;
-      span {
-        font-size: .29rem;
-        &:last-child {
-          margin-left: 2.6rem;
-        }
-        &.active {
-          color: $base-color;
-          border-bottom: 1px solid $base-color;
-        }
-      }
-    }
     .storage-record {
       .search-content {
         padding: .20rem 0;