Browse Source

处理卖家中心打样管理

wangcz 6 years ago
parent
commit
786c45e55f

+ 6 - 3
components/main/Nav.vue

@@ -50,9 +50,12 @@
       <a class="item" href="https://bbs.usoftchina.com/" target="_blank">
         <span>U客论坛</span>
       </a>
-      <nuxt-link to="/news" class="item">
-        <span>优软快讯</span>
-      </nuxt-link>
+      <a class="item" href="https://new.usoftchina.com/" target="_blank">
+        <span>U客资讯</span>
+      </a>
+      <!--<nuxt-link to="/news" class="item">-->
+        <!--<span>优软快讯</span>-->
+      <!--</nuxt-link>-->
     </div>
   </nav>
 </template>

+ 6 - 0
components/mobile/MobileHeader.vue

@@ -253,6 +253,12 @@
         } else if (this.startWith(val, '/mobile/center/vendor/invoice')) {
           this.showSearchIcon = false
           title = '发票管理'
+        } else if (this.startWith(val, '/mobile/center/vendor/sample')) {
+          this.showSearchIcon = false
+          title = '打样管理'
+        } else if (this.startWith(val, '/mobile/center/vendor/approval')) {
+          this.showSearchIcon = false
+          title = '打样管理'
         } else {
           this.showSearchIcon = true
           title = '优软商城'

+ 365 - 3
components/store/home/CommodityList.vue

@@ -1,5 +1,65 @@
 <template>
   <div id="goods-list-fragment">
+    <el-dialog
+      title="我要询价"
+      :visible.sync="hasDialog">
+      <div class="form_dialog">
+        <ul class="list-inline">
+          <li class="form-item">
+            <span>品牌:</span>
+            <p v-text="applyObj.brand ? spliceString(applyObj.brand, 90) : '-'">32432</p>
+          </li>
+          <li class="form-item">
+            <span>物料名称:</span>
+            <p v-text="applyObj.prodName ? spliceString(applyObj.prodName, 90) : '-'">32</p>
+          </li>
+          <li class="form-item">
+            <span>型号:</span>
+            <p v-text="applyObj.cmpCode ? spliceString(applyObj.cmpCode, 90) : '-'">32432</p>
+          </li>
+          <li class="form-item">
+            <span>规格:</span>
+            <p v-text="applyObj.spec ? spliceString(applyObj.spec, 90) : '-'">32432</p>
+          </li>
+          <li class="form-item">
+            <span><i>*</i>截止日期:</span>
+            <el-date-picker
+              :class="{'error': !validObj.deadline}"
+              v-model="applyObj.deadline"
+              type="date"
+              :picker-options="pickerOptions"
+              @change="setDeadLineValid"
+              :editable="false"
+              :clearable="true"
+              size="mini">
+            </el-date-picker>
+          </li>
+          <li class="form-item">
+            <span>封装:</span>
+            <input type="text" class="form-control" v-model="applyObj.encapsulation"/>
+          </li>
+          <!--<li class="form-item">-->
+          <!--<span>单价预算:</span>-->
+          <!--<select v-model="applyObj.currency" class="form-control" style="width:40px;">-->
+          <!--<option value="RMB">¥</option>-->
+          <!--<option value="USD">$</option>-->
+          <!--</select>-->
+          <!--<input type="number" v-model="applyObj.unitPrice" class="form-control" :class="{'error': !validObj.unitPrice}"/>-->
+          <!--</li>-->
+          <!--<li class="form-item">-->
+          <!--<span>生产日期:</span>-->
+          <!--<input type="text" class="form-control" v-model="applyObj.produceDate"/>-->
+          <!--</li>-->
+          <li class="form-item">
+            <span>采购数量(PCS):</span>
+            <input type="number" class="form-control" v-model="applyObj.amount" :class="{'error': !validObj.amount}"/>
+          </li>
+        </ul>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <button @click="authorityInterceptor(baseUrls.userPublishSeek, goPublish)" :disabled="isClick">询价提交</button>
+      </span>
+    </el-dialog>
     <div class="container">
       <div class="content-adv">
         <div class="title-adv"><span>全球共享交易平台</span><span>全球共享询价平台</span></div>
@@ -121,7 +181,14 @@
               <div v-if="!commodity.attach">—</div>
             </td>
             <td>
-              <buy :item="commodity"></buy>
+              <buy :item="commodity" v-if="commodity.attach"></buy>
+              <button  v-if="!commodity.attach"
+                       style="z-index: 1000;"
+                      class="btn btn-primary btn-buy-now"
+                      :class="{'disabled': isClick}"
+                      @click="immediatelyClick(commodity, $event)">
+                <span class="watch">立即询价</span>
+              </button>
             </td>
           </tr>
           <tr class="active-empty" v-if="!commodities.content || commodities.content.length == 0">
@@ -190,6 +257,31 @@
     },
     data () {
       return {
+        isClick: false,
+        applyObj: {
+          cmpCode: '',
+          brand: '',
+          unitPrice: '',
+          currency: 'RMB',
+          prodName: '',
+          spec: '',
+          encapsulation: '',
+          produceDate: '',
+          amount: '',
+          deadline: ''
+        },
+        validObj: {
+          unitPrice: true,
+          amount: true,
+          deadline: true
+        },
+        pickerOptions: {
+          disabledDate (time) {
+            // 大于等于今天 小于三个月后
+            return time.getTime() < Date.now() - 1000 * 60 * 60 * 24 || time.getTime() > Date.now() + 1000 * 60 * 60 * 24 * 30 * 3
+          }
+        },
+        hasDialog: false,
         defaultProps: {
           children: 'children',
           label: 'nameCn'
@@ -392,11 +484,281 @@
       goBrandDetail (url, event) {
         event.stopPropagation()
         window.open(url)
+      },
+      // 格式化字符串长度
+      spliceString (str, length) {
+        return str && str.length ? this.baseUtils.spliceStr(str, length) : '暂无信息'
+      },
+      // 弹出询价界面
+      immediatelyClick (type, event) {
+        event.stopPropagation()
+        if (!this.user.logged) {
+          this.$router.push('/auth/login?returnUrl=' + window.location.href)
+        } else {
+          this.hasDialog = true
+          this.applyObj.cmpCode = type.code
+          this.applyObj.brand = type.brandNameEn
+          this.applyObj.spec = type.spec
+          this.applyObj.prodName = type.kindNameCn
+        }
+      },
+      // 时间格式化
+      setDeadLineValid: function () {
+        if(this.applyObj.deadline === '') {return ''}
+        this.applyObj.deadline = this.baseUtils.formatDate(this.baseUtils.getFullDay(new Date(this.applyObj.deadline)), 'yyyy-MM-dd hh:mm:ss')
+        this.validObj.deadline = true
+      },
+      // 检查单价预算
+      checkUnitPrice () {
+        this.validObj.unitPrice = this.applyObj.unitPrice === '' ? true : this.applyObj.unitPrice > 0 && this.applyObj.unitPrice < 100000000
+        if (!this.validObj.unitPrice && this.applyObj.unitPrice <= 0) {
+          this.$message.error('单价必须是大于0的数字')
+        }
+        return this.validObj.unitPrice
+      },
+      // 检查采购数量
+      checkAmount () {
+        this.validObj.amount = this.applyObj.amount === '' ? true : this.applyObj.amount > 0 && this.applyObj.amount < 1000000000
+        return this.validObj.amount
+      },
+      // 检查时间是否有输入
+      checkDeadline () {
+        this.validObj.deadline = Boolean(this.applyObj.deadline)
+        return this.validObj.deadline
+      },
+      // 检查各个字段输入正常数据
+      checkAll () {
+        return this.checkDeadline() && this.checkUnitPrice() && this.checkAmount()
+      },
+      emptyForm () {
+        for (let attr in this.applyObj) {
+          this.applyObj[attr] = attr === 'currency' ? 'RMB' : ''
+        }
+      },
+      // 请求询价信息
+      goPublish () {
+        let _this = this
+        this.isClick = true
+        setTimeout(function () {
+          _this.isClick = false
+        }, 1000)
+        if (this.checkAll()) {
+          let inquiry = {}
+          let inquiryItem = {}
+          if (this.user.data.enterprise) {
+            inquiry.enUU = this.user.data.enterprise.uu
+          }
+          let date = new Date()
+          let currency = this.applyObj.unitPrice ? this.applyObj.currency : null
+          inquiry.recorderUU = this.user.data.userUU
+          inquiry.code = 'MALL' + date.getTime()
+          inquiry.date = date
+          inquiry.recorder = this.user.data.userName
+          inquiry.endDate = this.applyObj.deadline
+          inquiry.sourceapp = 'MALL'
+          inquiry.amount = 1
+          inquiryItem.userUU = this.user.data.userUU
+          inquiryItem.source = 'MALL'
+          inquiryItem.userName = this.user.data.userName
+          inquiryItem.userTel = this.user.data.userTel
+          inquiryItem.needquantity = this.applyObj.amount
+          inquiryItem.inbrand = this.applyObj.brand
+          inquiryItem.currency = currency
+          inquiryItem.cmpCode = this.applyObj.cmpCode.toUpperCase()
+          inquiryItem.unitPrice = this.applyObj.unitPrice
+          inquiryItem.produceDate = this.applyObj.produceDate
+          inquiryItem.date = date
+          inquiryItem.endDate = this.applyObj.deadline
+          inquiryItem.encapsulation = this.applyObj.encapsulation
+          inquiryItem.spec = this.applyObj.spec
+          inquiryItem.prodTitle = this.applyObj.prodName
+          let inquiryItems = []
+          inquiryItems.push(inquiryItem)
+          inquiry.inquiryItems = inquiryItems
+          inquiry.currency = this.applyObj.unitPrice ? this.applyObj.currency : null
+          this.$http.post('/inquiry/buyer/save', inquiry)
+            .then(res => {
+              this.$message.success('发布成功')
+              this.hasDialog = false
+              this.emptyForm()
+            }, error => {
+              console.log(error)
+              this.$message.error('发布失败')
+            })
+        } else {
+          if (!this.validObj.deadline) {
+            this.$message.error('截止日期不能为空')
+          } else if (!this.validObj.amount) {
+            this.$message.error('请输入正确的数值')
+          }
+        }
       }
     }
   }
 </script>
-<style>
+<style type="text/scss" lang="scss">
+  #goods-list-fragment {
+    .btn-buy-now {
+      background-color: #5078CB;
+      color: #fff;
+      width: 80px;
+      height: 30px;
+      font-size: 12px;
+      border: 1px solid #5078cb;
+      position: relative;
+    }
+    .btn-add-cart {
+      margin-top: 10px;
+      color: #214797;
+      width: 80px;
+      height: 30px;
+      font-size: 12px;
+      background-color: #fff;
+      border: 1px solid #e8e8e8;
+    }
+    .btn-buy-now:hover{
+      background: #214797;
+    }
+    .btn-buy-now.disabled,
+    .btn-buy-now.disabled:focus{
+      background-color: #d1d2d3!important;
+      border: none!important;
+      outline: none;
+      color: #fff!important;
+      cursor: not-allowed;
+    }
+    .el-dialog{
+      width: 680px!important;
+      .el-dialog__header{
+        background: #4290f7;
+        line-height: 40px;
+        padding: 0 20px 0;
+        display:block;
+        .el-dialog__title{
+          color:#fff;
+        }
+        .el-dialog__headerbtn:hover .el-dialog__close, .el-dialog__headerbtn:focus .el-dialog__close{
+          color:#fff;
+        }
+      }
+      .el-dialog__body{
+        padding: 10px 20px;
+      }
+      .el-dialog__footer{
+        text-align: center;
+        button{
+          display:inline-block;
+          background: #3c7cf5;
+          color:#fff;
+          font-size: 14px;
+          line-height: 30px;
+          height:30px;
+          padding:0 10px;
+          box-shadow: none;
+          border: 0;
+          border-radius:5px;
+        }
+      }
+    }
+    .form_dialog{
+      .el-date-editor--date{
+        width: 230px;
+        &.error {
+          input {
+            border: 1px solid #f4645f !important;
+          }
+        }
+      }
+      ul{
+        li{
+          width:50%;
+          font-size: 14px;
+          color:#666;
+          vertical-align: top;
+          margin-bottom:15px;
+          &.form-item {
+            position: relative;
+            p{
+              margin:0;
+              margin-left:80px;
+              word-break: break-all;
+              word-wrap: break-word;
+            }
+            span {
+              float:left;
+              width: 112px;
+              text-align: right;
+              display: inline-block;
+              color:#3c7cf5;
+              i {
+                position: relative;
+                top: 2px;
+                right: 5px;
+                color: #e41515;
+              }
+            }
+            ul {
+              line-height: normal;
+              position: absolute;
+              top: 19px;
+              left: 79px;
+              background: #fff;
+              border: 1px solid #b5b5b5;
+              z-index: 1;
+              max-height: 120px;
+              overflow-y: auto;
+              overflow-x: hidden;
+              border-radius: 3px;
+              width: 114px;
+              font-size: 12px;
+              li {
+                height: 24px;
+                line-height: 24px;
+                cursor: pointer;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                white-space: nowrap;
+                padding: 0 5px;
+                &:hover {
+                  background: #ddd;
+                }
+              }
+            }
+            select {
+              width: 40px;
+              position: absolute;
+              height: 20px;
+              background: url('/images/applyPurchase/select.png')no-repeat right;
+              background-position-x: 23px;
+              padding: 0 0 0 7px;
+              border-radius: 0;
+              & + input {
+                padding-left: 45px;
+              }
+            }
+            .el-input {
+              width: 198px;
+            }
+            input {
+              font-size: 14px;
+              width: 198px;
+              height: 20px;
+              line-height: 20px;
+              border-radius: 2px;
+              padding: 0 3px;
+              box-shadow: none;
+              -webkit-box-shadow: none;
+              -moz-box-shadow: none;
+              &.error {
+                border-color: #f4645f!important;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+
   #goods-list-fragment{
     width: 100%;
     background: #ece9ec;
@@ -856,7 +1218,7 @@
     url('//at.alicdn.com/t/font_27kjyd082ezpk3xr.svg#iconfont') format('svg');
   }
 
-  <!-- 分页 -->
+  /*-- 分页 --*/
   #goods-list-fragment .el-pagination .el-pager li.active {
     border-color: #5078cb !important;
     background-color: #5078cb !important;

+ 1 - 0
components/supplier/resource.vue

@@ -263,6 +263,7 @@
       },
       // 时间格式化
       setDeadLineValid: function () {
+        if(this.applyObj.deadline === '') {return ''}
         this.applyObj.deadline = this.baseUtils.formatDate(this.baseUtils.getFullDay(new Date(this.applyObj.deadline)), 'yyyy-MM-dd hh:mm:ss')
         this.validObj.deadline = true
       },

+ 375 - 0
pages/mobile/center/vendor/approval/index.vue

@@ -0,0 +1,375 @@
+<template>
+  <div class="order-wrapper">
+    <div class="order-tab">
+      <div class="order-tab-wrapper clearfix">
+        <nuxt-link class="fl tab" to="/mobile/center/vendor/sample" tag="div" >
+          客户打样申请
+        </nuxt-link>
+        <div class="fl active tab">客户认定单</div>
+      </div>
+    </div>
+    <div class="order-nav">
+      <div :class="activeType === 'todo' ? 'active': ''" @click="ChangeList('todo')"><span>全部</span></div>
+      <div :class="activeType === 'todo' ? 'active': ''" @click="ChangeList('todo')"><span>已送样</span></div>
+      <div :class="activeType === 'done' ? 'active' : ''" @click="ChangeList('done')"><span>待送样</span></div>
+      <div :class="activeType === 'end' ? 'active' : ''" @click="ChangeList('end')"><span>已作废</span></div>
+    </div>
+    <div class="search-content search-content2">
+      <input type="text" placeholder="单据编号/客户名称/物料名称" v-model="keyword" @keyup.13="searchOrderlist">
+      <span @click="searchOrderlist">
+          <i class="iconfont icon-sousuo"></i>
+      </span>
+    </div>
+    <div class="filters-wrap">
+      <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>
+    <ul class="order-list-wrap" id="b2border-wrapper" v-show="orderList.length > 0">
+      <li v-for="item in orderList" @click="goDetails(item)">
+        <div class="list-title">{{item.enName}}</div>
+        <div class="clearfix list-content">
+          <div class="fl left">
+            <div class="item">
+              <span>单号:</span>
+              <label v-html="item.code" style="color: #333;font-weight: 500"></label>
+            </div>
+            <div class="item">
+              <span>币别:</span>{{item.currency}}
+            </div>
+            <div class="item pric">
+              <span>金额:</span>{{item.sum}}
+            </div>
+            <div class="item">
+              <span>时间:</span>{{item.date | time}}
+            </div>
+          </div>
+          <div class="fr right">
+            <div v-if="activeType === 'todo'" class="todo">
+              待回复
+            </div>
+            <div v-else-if="activeType === 'done'" class="done">
+              已回复
+            </div>
+            <div v-else-if="activeType === 'end'" class="end">
+              已结案
+            </div>
+          </div>
+        </div>
+      </li>
+    </ul>
+    <div v-if="orderList.length === 0" class="com-none-state">
+      <img src="/images/mobile/@2x/search-empty.png">
+      <p>抱歉,暂无订单消息</p>
+      <nuxt-link to="/">返回首页</nuxt-link>
+    </div>
+    <pull-up :fixId="'b2border-wrapper'"
+             :allPage="allPage"
+             :page="page"
+             :FixedEl="true"
+             @pullUpAction="getMoreSearch"></pull-up>
+  </div>
+</template>
+
+<script>
+  import { RemindBox, PullUp } from '~components/mobile/common'
+  import { ModalWrapper, BaseFilter } from '~components/mobile/base'
+  export default {
+    name: 'sample',
+    layout: 'mobile',
+    middleware: 'authenticated',
+    data() {
+      return {
+        filterOptions: [
+          {
+            title: '交易时间',
+            selectOption: 'date',
+            selectItems: [{
+              key: '30天',
+              val: 1
+            }, {
+              key: '90天',
+              val: 2
+            }, {
+              key: '180天',
+              val: 3
+            }, {
+              key: '自定义',
+              val: 4
+            }],
+            defaultVal: 1
+          }
+        ],
+        filterParams:{
+          count: 10
+        },
+        filter:{
+          count: 10,
+          sorting: {"createtime":"DESC"},
+          status: '502-406'
+        },
+        activeType: 'todo',
+        page: 1,
+        // isSearchSearchingMore: false,
+        orderList: [],
+        keyword: '',
+        allPage: 0
+      }
+    },
+    created() {
+      this.getResource()
+    },
+    methods: {
+      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)
+      },
+      goDetails(item) {
+        this.$router.push('/mobile/order/orderbtob_details?id=' + item.id)
+      },
+      getResource(Reset) {
+        // this.isSearchSearchingMore = false
+        this.$http.get('/sale/orders/info/nosearch', {params: {
+            _state: this.activeType,
+            count: 10,
+            page: this.page,
+            searchFilter: {'fromDate': 1293811200000, 'endDate': new Date().getTime(), 'keyword': this.keyword},
+            sorting: {date: 'desc', id: 'desc'}
+          }}).then(res => {
+          if (Reset) {
+            this.orderList = []
+          }
+          res.data.content.forEach(item => {
+            item.sum = 0
+            item.orderItems.forEach(order => {
+              item.sum += order.qty * order.price
+            })
+          })
+          this.orderList.push(...res.data.content)
+          this.allPage = Math.floor(res.data.totalElement / 10)
+          // this.isSearchSearchingMore = true
+          console.log(this.orderList)
+        })
+      },
+      ChangeList(_tp) {
+        this.activeType = _tp
+        this.getResource(true)
+      },
+      getMoreSearch() {
+        this.page++
+        this.getResource()
+      },
+      searchOrderlist() {
+        this.page = 1
+        this.getResource(true)
+      }
+    },
+    components: {
+      RemindBox, PullUp, ModalWrapper, BaseFilter
+    },
+    filters: {
+      time: function(time) {
+        if (typeof time === 'number') {
+          if (!time) {
+            return '无'
+          } else {
+            let d = new Date(time)
+            let year = d.getFullYear()
+            let month = d.getMonth() + 1
+            let day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
+            return year + '-' + month + '-' + day
+          }
+        }
+      }
+    }
+  }
+</script>
+
+<style scoped lang="scss">
+  @mixin overFlowHidden {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+  @mixin lineHeight($value) {
+    height: $value;
+    line-height: $value;
+  }
+
+  .order-wrapper {
+    background: #f1f3f6;
+    margin: 1.26rem 0 0.98rem 0;
+    height: calc(100vh - 1.26rem - 0.98rem);
+    /*padding-bottom: 0.96rem;*/
+    .filters-wrap{
+      background: #fff;
+      margin: 0 auto .13rem;
+      width: 7.1rem;
+      overflow: hidden;
+      padding: .1rem;
+    }
+    .order-tab {
+      background: #3f84f6;
+      padding-bottom: 0.2rem;
+      .order-tab-wrapper {
+        border: solid 1px #ffffff;
+        width: 7.06rem;
+        margin: 0 auto;
+        border-radius: 0.04rem;
+        line-height: 0.72rem;
+        height: 0.72rem;
+        overflow: hidden;
+        div {
+          color: #ffffff;
+          font-size: 0.28rem;
+          text-align: center;
+          width: 50%;
+          &.active {
+            background-color: #ffffff;
+            color: #3f84f6;
+          }
+        }
+      }
+    }
+    .order-nav {
+      background: #fff;
+      div {
+        height: 0.82rem;
+        line-height: 0.82rem;
+        display: inline-block;
+        width: 25%;
+        text-align: center;
+        font-size: .28rem;
+        color: #666;
+        &.active span{
+          color: #3f84f6;
+          border-bottom: 0.04rem solid #3f84f6;
+          padding-bottom: 0.2rem;
+        }
+      }
+    }
+    .search-content2 {
+      text-align: center;
+      padding: .25rem 0 0 0;
+      margin-top: 0 !important;
+      margin-bottom:.25rem;
+      input {
+        width: 7.1rem;
+        border: 1px solid #376ff3;
+      }
+      span {
+        /*height: .46rem;*/
+        /*line-height: .46rem;*/
+      }
+    }
+    .order-list-wrap {
+      height: calc(100vh - 1.26rem - 0.96rem - 0.84rem - 1rem - 0.92rem);
+      overflow-y: scroll;
+      margin-top: 0.2rem;
+      li {
+        background: #fff;
+        width: 7.1rem;
+        margin: 0 auto 0.2rem;
+        border-radius: 0.04rem;
+        border: 1px solid #e4e4e4;
+        padding: 0 0.24rem;
+        .list-title {
+          @include lineHeight(0.91rem);
+          @include overFlowHidden();
+          font-size: 0.28rem;
+          color: #3a3a3a;
+          border-bottom: 1px solid #d3d3d3;
+        }
+        .list-content {
+          margin-top: 0.23rem;
+          padding-bottom: 0.28rem;
+          .left {
+            border-right: dashed 1px #9f9f9f;
+            width: 4.6rem;
+            .item {
+              font-size: 0.28rem;
+              color: #333;
+              @include overFlowHidden();
+              margin-bottom: 0.15rem;
+              span {
+                color: #666;
+              }
+              &.pric {
+                color: #e6353d;
+              }
+            }
+          }
+          .right {
+            div {
+              width: 1.7rem;
+              height: 0.47rem;
+              line-height: 0.47rem;
+              font-size: 0.28rem;
+              text-align: center;
+              border-radius: 0.04rem;
+              margin-top: 0.7rem;
+              &.todo {
+                border: 1px solid #3e82f5;
+                background: #3e82f5;
+                color: #fff;
+              }
+              &.done {
+                border: 1px solid #3e82f5;
+                color: #3e82f5;
+              }
+              &.end {
+                background: #cccccc;
+                border: 1px solid #cccccc;
+                color: #fff;
+              }
+            }
+          }
+        }
+      }
+    }
+    .com-none-state{
+      background: #f1f3f6
+    }
+  }
+</style>

+ 8 - 0
pages/mobile/center/vendor/index.vue

@@ -70,6 +70,14 @@
             <img src="/images/mobile/center/user/message.png" alt="">
             <p>消息中心<span class="text" v-if="messageCount.count > 0">{{messageCount.count && messageCount.count >= 99 ? 99 : messageCount.count || 0}}</span></p>
           </nuxt-link>
+          <nuxt-link tag="li" to="/mobile/center/vendor/customer">
+            <img src="/images/mobile/center/vendor/customer.png" alt="">
+            <p>客户资料</p>
+          </nuxt-link>
+          <nuxt-link tag="li" to="/mobile/center/vendor/sample">
+            <img src="/images/mobile/center/vendor/sample.png" alt="">
+            <p>打样管理</p>
+          </nuxt-link>
         </ul>
       </div>
 

+ 375 - 0
pages/mobile/center/vendor/sample/index.vue

@@ -0,0 +1,375 @@
+<template>
+  <div class="order-wrapper">
+    <div class="order-tab">
+      <div class="order-tab-wrapper clearfix">
+        <div class="fl active tab">客户打样申请</div>
+        <nuxt-link class="fl tab" to="/mobile/center/vendor/approval" tag="div" >
+          客户认定单
+        </nuxt-link>
+      </div>
+    </div>
+    <div class="order-nav">
+      <div :class="activeType === 'todo' ? 'active': ''" @click="ChangeList('todo')"><span>全部</span></div>
+      <div :class="activeType === 'todo' ? 'active': ''" @click="ChangeList('todo')"><span>已送样</span></div>
+      <div :class="activeType === 'done' ? 'active' : ''" @click="ChangeList('done')"><span>待送样</span></div>
+      <div :class="activeType === 'end' ? 'active' : ''" @click="ChangeList('end')"><span>已作废</span></div>
+    </div>
+    <div class="search-content search-content2">
+      <input type="text" placeholder="单据编号/客户名称/物料名称" v-model="keyword" @keyup.13="searchOrderlist">
+      <span @click="searchOrderlist">
+          <i class="iconfont icon-sousuo"></i>
+      </span>
+    </div>
+    <div class="filters-wrap">
+      <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>
+    <ul class="order-list-wrap" id="b2border-wrapper" v-show="orderList.length > 0">
+      <li v-for="item in orderList" @click="goDetails(item)">
+        <div class="list-title">{{item.enName}}</div>
+        <div class="clearfix list-content">
+          <div class="fl left">
+            <div class="item">
+              <span>单号:</span>
+              <label v-html="item.code" style="color: #333;font-weight: 500"></label>
+            </div>
+            <div class="item">
+              <span>币别:</span>{{item.currency}}
+            </div>
+            <div class="item pric">
+              <span>金额:</span>{{item.sum}}
+            </div>
+            <div class="item">
+              <span>时间:</span>{{item.date | time}}
+            </div>
+          </div>
+          <div class="fr right">
+            <div v-if="activeType === 'todo'" class="todo">
+              待回复
+            </div>
+            <div v-else-if="activeType === 'done'" class="done">
+              已回复
+            </div>
+            <div v-else-if="activeType === 'end'" class="end">
+              已结案
+            </div>
+          </div>
+        </div>
+      </li>
+    </ul>
+    <div v-if="orderList.length === 0" class="com-none-state">
+      <img src="/images/mobile/@2x/search-empty.png">
+      <p>抱歉,暂无订单消息</p>
+      <nuxt-link to="/">返回首页</nuxt-link>
+    </div>
+    <pull-up :fixId="'b2border-wrapper'"
+             :allPage="allPage"
+             :page="page"
+             :FixedEl="true"
+             @pullUpAction="getMoreSearch"></pull-up>
+  </div>
+</template>
+
+<script>
+  import { RemindBox, PullUp } from '~components/mobile/common'
+  import { ModalWrapper, BaseFilter } from '~components/mobile/base'
+  export default {
+    name: 'sample',
+    layout: 'mobile',
+    middleware: 'authenticated',
+    data() {
+      return {
+        filterOptions: [
+          {
+            title: '交易时间',
+            selectOption: 'date',
+            selectItems: [{
+              key: '30天',
+              val: 1
+            }, {
+              key: '90天',
+              val: 2
+            }, {
+              key: '180天',
+              val: 3
+            }, {
+              key: '自定义',
+              val: 4
+            }],
+            defaultVal: 1
+          }
+        ],
+        filterParams:{
+          count: 10
+        },
+        filter:{
+          count: 10,
+          sorting: {"createtime":"DESC"},
+          status: '502-406'
+        },
+        activeType: 'todo',
+        page: 1,
+        // isSearchSearchingMore: false,
+        orderList: [],
+        keyword: '',
+        allPage: 0
+      }
+    },
+    created() {
+      this.getResource()
+    },
+    methods: {
+      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)
+      },
+      goDetails(item) {
+        this.$router.push('/mobile/order/orderbtob_details?id=' + item.id)
+      },
+      getResource(Reset) {
+        // this.isSearchSearchingMore = false
+        this.$http.get('/sale/orders/info/nosearch', {params: {
+            _state: this.activeType,
+            count: 10,
+            page: this.page,
+            searchFilter: {'fromDate': 1293811200000, 'endDate': new Date().getTime(), 'keyword': this.keyword},
+            sorting: {date: 'desc', id: 'desc'}
+          }}).then(res => {
+          if (Reset) {
+            this.orderList = []
+          }
+          res.data.content.forEach(item => {
+            item.sum = 0
+            item.orderItems.forEach(order => {
+              item.sum += order.qty * order.price
+            })
+          })
+          this.orderList.push(...res.data.content)
+          this.allPage = Math.floor(res.data.totalElement / 10)
+          // this.isSearchSearchingMore = true
+          console.log(this.orderList)
+        })
+      },
+      ChangeList(_tp) {
+        this.activeType = _tp
+        this.getResource(true)
+      },
+      getMoreSearch() {
+        this.page++
+        this.getResource()
+      },
+      searchOrderlist() {
+        this.page = 1
+        this.getResource(true)
+      }
+    },
+    components: {
+      RemindBox, PullUp, ModalWrapper, BaseFilter
+    },
+    filters: {
+      time: function(time) {
+        if (typeof time === 'number') {
+          if (!time) {
+            return '无'
+          } else {
+            let d = new Date(time)
+            let year = d.getFullYear()
+            let month = d.getMonth() + 1
+            let day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
+            return year + '-' + month + '-' + day
+          }
+        }
+      }
+    }
+  }
+</script>
+
+<style scoped lang="scss">
+  @mixin overFlowHidden {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+  @mixin lineHeight($value) {
+    height: $value;
+    line-height: $value;
+  }
+
+  .order-wrapper {
+    background: #f1f3f6;
+    margin: 1.26rem 0 0.98rem 0;
+    height: calc(100vh - 1.26rem - 0.98rem);
+    /*padding-bottom: 0.96rem;*/
+    .filters-wrap{
+      background: #fff;
+      margin: 0 auto .13rem;
+      width: 7.1rem;
+      overflow: hidden;
+      padding: .1rem;
+    }
+    .order-tab {
+      background: #3f84f6;
+      padding-bottom: 0.2rem;
+      .order-tab-wrapper {
+        border: solid 1px #ffffff;
+        width: 7.06rem;
+        margin: 0 auto;
+        border-radius: 0.04rem;
+        line-height: 0.72rem;
+        height: 0.72rem;
+        overflow: hidden;
+        div {
+          color: #ffffff;
+          font-size: 0.28rem;
+          text-align: center;
+          width: 50%;
+          &.active {
+            background-color: #ffffff;
+            color: #3f84f6;
+          }
+        }
+      }
+    }
+    .order-nav {
+      background: #fff;
+      div {
+        height: 0.82rem;
+        line-height: 0.82rem;
+        display: inline-block;
+        width: 25%;
+        text-align: center;
+        font-size: .28rem;
+        color: #666;
+        &.active span{
+          color: #3f84f6;
+          border-bottom: 0.04rem solid #3f84f6;
+          padding-bottom: 0.2rem;
+        }
+      }
+    }
+    .search-content2 {
+      text-align: center;
+      padding: .25rem 0 0 0;
+      margin-top: 0 !important;
+      margin-bottom:.25rem;
+      input {
+        width: 7.1rem;
+        border: 1px solid #376ff3;
+      }
+      span {
+        /*height: .46rem;*/
+        /*line-height: .46rem;*/
+      }
+    }
+    .order-list-wrap {
+      height: calc(100vh - 1.26rem - 0.96rem - 0.84rem - 1rem - 0.92rem);
+      overflow-y: scroll;
+      margin-top: 0.2rem;
+      li {
+        background: #fff;
+        width: 7.1rem;
+        margin: 0 auto 0.2rem;
+        border-radius: 0.04rem;
+        border: 1px solid #e4e4e4;
+        padding: 0 0.24rem;
+        .list-title {
+          @include lineHeight(0.91rem);
+          @include overFlowHidden();
+          font-size: 0.28rem;
+          color: #3a3a3a;
+          border-bottom: 1px solid #d3d3d3;
+        }
+        .list-content {
+          margin-top: 0.23rem;
+          padding-bottom: 0.28rem;
+          .left {
+            border-right: dashed 1px #9f9f9f;
+            width: 4.6rem;
+            .item {
+              font-size: 0.28rem;
+              color: #333;
+              @include overFlowHidden();
+              margin-bottom: 0.15rem;
+              span {
+                color: #666;
+              }
+              &.pric {
+                color: #e6353d;
+              }
+            }
+          }
+          .right {
+            div {
+              width: 1.7rem;
+              height: 0.47rem;
+              line-height: 0.47rem;
+              font-size: 0.28rem;
+              text-align: center;
+              border-radius: 0.04rem;
+              margin-top: 0.7rem;
+              &.todo {
+                border: 1px solid #3e82f5;
+                background: #3e82f5;
+                color: #fff;
+              }
+              &.done {
+                border: 1px solid #3e82f5;
+                color: #3e82f5;
+              }
+              &.end {
+                background: #cccccc;
+                border: 1px solid #cccccc;
+                color: #fff;
+              }
+            }
+          }
+        }
+      }
+    }
+    .com-none-state{
+      background: #f1f3f6
+    }
+  }
+</style>

BIN
static/images/mobile/center/vendor/customer.png


BIN
static/images/mobile/center/vendor/sample.png