Browse Source

部分验收修改

yangc 8 years ago
parent
commit
f498454252

+ 5 - 2
components/applyPurchase/ApplyInfo.vue

@@ -4,7 +4,7 @@
       <p>最新求购信息</p>
       <p>最新求购信息</p>
       <span>海量求购,一网打尽</span>
       <span>海量求购,一网打尽</span>
       <div>
       <div>
-        <input type="text" class="form-control" v-model="keyWord" @keyup.13="searchList" placeholder="请输入要查找的内容" />
+        <input type="text" class="form-control" v-model="keyWord" @keyup.13="searchList" placeholder="型号/品牌" />
         <span @click="searchList">查询</span>
         <span @click="searchList">查询</span>
       </div>
       </div>
     </div>
     </div>
@@ -39,7 +39,7 @@
           <span :title="getPurchaseManName(purchaseMan)">{{getPurchaseManName(purchaseMan)}}</span>
           <span :title="getPurchaseManName(purchaseMan)">{{getPurchaseManName(purchaseMan)}}</span>
           <span :title="purchaseMan.code">{{purchaseMan.code}}</span>
           <span :title="purchaseMan.code">{{purchaseMan.code}}</span>
           <span :title="purchaseMan.brand">{{purchaseMan.brand}}</span>
           <span :title="purchaseMan.brand">{{purchaseMan.brand}}</span>
-          <span class="date-content"><span>剩余&nbsp;</span><span v-text="getDay(purchaseMan.remainingTime)"></span>&nbsp;天&nbsp;<span v-text="getHours(purchaseMan.remainingTime)"></span>&nbsp;小时</span>
+          <span class="date-content"><span>剩余&nbsp;</span><span v-if="getDay(purchaseMan.remainingTime) > 0" v-text="getDay(purchaseMan.remainingTime)"></span><i v-if="getDay(purchaseMan.remainingTime) > 0">&nbsp;天&nbsp;</i><span v-if="getDay(purchaseMan.remainingTime) <= 0" v-text="getHours(purchaseMan.remainingTime)"></span><i v-if="getDay(purchaseMan.remainingTime) <= 0" >&nbsp;小时</i></span>
           <span class="number-content"><img src="/images/applyPurchase/hot-fire.png" alt="" v-if="purchaseMan.offerAmount > 10"><span :style="purchaseMan.offerAmount > 10 ? 'color: #ff9a00': ''">{{purchaseMan.offerAmount || 0}}</span>&nbsp;条</span>
           <span class="number-content"><img src="/images/applyPurchase/hot-fire.png" alt="" v-if="purchaseMan.offerAmount > 10"><span :style="purchaseMan.offerAmount > 10 ? 'color: #ff9a00': ''">{{purchaseMan.offerAmount || 0}}</span>&nbsp;条</span>
           <span class="btn-content">
           <span class="btn-content">
             <a>联系买家</a>
             <a>联系买家</a>
@@ -465,6 +465,9 @@
                 }
                 }
                 color: #f71026;
                 color: #f71026;
               }
               }
+              i {
+                font-style: normal;
+              }
             }
             }
             &.number-content {
             &.number-content {
               span {
               span {

+ 30 - 9
components/applyPurchase/BatchPublish.vue

@@ -36,7 +36,7 @@
         <td>{{item.produceDate}}</td>
         <td>{{item.produceDate}}</td>
         <td>{{item.deadline | date}}</td>
         <td>{{item.deadline | date}}</td>
         <td class="operate">
         <td class="operate">
-          <a class="modify-btn" @click="modifyItem(index)">修改</a>
+          <a class="delete-btn" @click="modifyItem(index)">编辑</a>
           <a class="delete-btn" @click="deleteItem(index)">删除</a>
           <a class="delete-btn" @click="deleteItem(index)">删除</a>
         </td>
         </td>
       </tr>
       </tr>
@@ -70,7 +70,15 @@
           <input type="text" class="form-control" v-model="modifyObj.produceDate">
           <input type="text" class="form-control" v-model="modifyObj.produceDate">
         </td>
         </td>
         <td>
         <td>
-          <input type="text" class="form-control" v-model="modifyObj.deadline">
+          <el-date-picker
+            v-model="modifyObj.deadline"
+            type="date"
+            :picker-options="pickerOptions"
+            :editable="false"
+            :clearable="true"
+            size="mini">
+          </el-date-picker>
+          <!--<input type="text" class="form-control" v-model="modifyObj.deadline">-->
         </td>
         </td>
         <td class="operate">
         <td class="operate">
           <a class="submit-btn" @click="submitModify(index)">确认</a>
           <a class="submit-btn" @click="submitModify(index)">确认</a>
@@ -83,7 +91,7 @@
           :current="nowPage" @childEvent="listenPage"></page>
           :current="nowPage" @childEvent="listenPage"></page>
     <div class="submit-area" v-if="bomList.content.length">
     <div class="submit-area" v-if="bomList.content.length">
       <a class="delete-btn" @click="deleteItem()">删除</a>
       <a class="delete-btn" @click="deleteItem()">删除</a>
-      <a class="modify-btn" @click="submitBOM">确认发布</a>
+      <a class="modify-btn delete-btn" @click="submitBOM">确认发布</a>
     </div>
     </div>
     <!--提示框-->
     <!--提示框-->
     <div class="apply-del-box" v-if="showRemindBox">
     <div class="apply-del-box" v-if="showRemindBox">
@@ -96,7 +104,7 @@
         <p><img src="/images/applyPurchase/check.png" alt="">发布成功</p>
         <p><img src="/images/applyPurchase/check.png" alt="">发布成功</p>
         <p>其中<span>100</span>个求购型号有现货在售,您可前往“<span>买家中心-我的求购</span>”查询并直接购买</p>
         <p>其中<span>100</span>个求购型号有现货在售,您可前往“<span>买家中心-我的求购</span>”查询并直接购买</p>
         <div>
         <div>
-          <a @click="showRemindBox = false">我知道了</a>
+          <a @click="showRemindBox = false">继续发布</a>
           <a href="/user#/seekPurchase">前往我的求购</a>
           <a href="/user#/seekPurchase">前往我的求购</a>
         </div>
         </div>
       </div>
       </div>
@@ -112,7 +120,13 @@
         nowPage: 1,
         nowPage: 1,
         isCheckAll: false,
         isCheckAll: false,
         showRemindBox: false,
         showRemindBox: false,
-        modifyObj: {}
+        modifyObj: {},
+        pickerOptions: {
+          disabledDate (time) {
+            // 大于等于今天 小于三个月后
+            return time.getTime() < Date.now() - 1000 * 60 * 60 * 24 || time.getTime() > Date.now() + 1000 * 60 * 60 * 24 * 30 * 3
+          }
+        }
       }
       }
     },
     },
     components: {
     components: {
@@ -262,7 +276,7 @@
     }
     }
   }
   }
 </script>
 </script>
-<style lang="scss" scoped>
+<style lang="scss">
   .batch-publish {
   .batch-publish {
     margin: 0 auto;
     margin: 0 auto;
     width: 998px;
     width: 998px;
@@ -329,9 +343,9 @@
                   background: #f64900;
                   background: #f64900;
                 }
                 }
                 &.cancel-btn {
                 &.cancel-btn {
-                  border: 1px solid #dddddd;
+                  border: 1px solid #bbb;
                   color: #fff;
                   color: #fff;
-                  background: #dddddd;
+                  background: #bbb;
                 }
                 }
               }
               }
             }
             }
@@ -391,8 +405,11 @@
                 }
                 }
               }
               }
               &:nth-child(8) {
               &:nth-child(8) {
-                input {
+                div {
                   width: 101px;
                   width: 101px;
+                  input {
+                    width: 101px;
+                  }
                 }
                 }
               }
               }
             }
             }
@@ -458,6 +475,10 @@
         p{
         p{
           padding: 12px 31px;
           padding: 12px 31px;
           margin: 0;
           margin: 0;
+          &:nth-child(2) {
+            font-size: 12px;
+            padding-top: 0;
+          }
           i{
           i{
             color: #5078cb;
             color: #5078cb;
             font-size: 16px;
             font-size: 16px;

+ 80 - 7
components/applyPurchase/PublishApply.vue

@@ -65,7 +65,9 @@
               type="date"
               type="date"
               :picker-options="pickerOptions"
               :picker-options="pickerOptions"
               :class="{'error': !validObj.deadline}"
               :class="{'error': !validObj.deadline}"
-              @change="checkDeadline"
+              @change="setDeadLineValid"
+              :editable="false"
+              :clearable="true"
               size="mini">
               size="mini">
             </el-date-picker>
             </el-date-picker>
           </div>
           </div>
@@ -75,7 +77,18 @@
       <div class="publish-upload">
       <div class="publish-upload">
         <h1>批量发布</h1>
         <h1>批量发布</h1>
         <h2>3秒一键配单采购</h2>
         <h2>3秒一键配单采购</h2>
-        <img src="/images/applyPurchase/upload.png" alt="" />
+        <label>
+          <img src="/images/applyPurchase/upload.png" alt="" />
+          <!--<input type="file" accept="*.xls, *.xlsx" @change="upload">-->
+          <el-upload
+            drag
+            action="/seek/importBom"
+            accept="*.xls, *.xlsx"
+            :show-file-list="false"
+            :on-success="onSuccess"
+            :on-error="onError">
+          </el-upload>
+        </label>
         <h3>把Excel格式的BOM拖放到框中</h3>
         <h3>把Excel格式的BOM拖放到框中</h3>
         <img class="download-line" src="/images/applyPurchase/download.png" alt="">
         <img class="download-line" src="/images/applyPurchase/download.png" alt="">
         <img class="apply-logo" src="/images/applyPurchase/publish-apply.png" alt="">
         <img class="apply-logo" src="/images/applyPurchase/publish-apply.png" alt="">
@@ -150,8 +163,8 @@
           unitPrice: true,
           unitPrice: true,
 //          encapsulation: true,
 //          encapsulation: true,
 //          produceDate: true,
 //          produceDate: true,
-          amount: true
-//          deadline: true,
+          amount: true,
+          deadline: true
         },
         },
         pickerOptions: {
         pickerOptions: {
           disabledDate (time) {
           disabledDate (time) {
@@ -173,6 +186,11 @@
         return this.$store.state.option.user
         return this.$store.state.option.user
       }
       }
     },
     },
+    mounted () {
+      document.getElementsByClassName('el-upload-dragger')[0].onclick = function (event) {
+        event.stopPropagation()
+      }
+    },
     methods: {
     methods: {
       emptyForm: function () {
       emptyForm: function () {
         for (let attr in this.applyObj) {
         for (let attr in this.applyObj) {
@@ -190,6 +208,7 @@
                 this.$message.success('发布成功')
                 this.$message.success('发布成功')
 //                this.showRemindBox = true
 //                this.showRemindBox = true
                 this.emptyForm()
                 this.emptyForm()
+//                this.validObj.deadline = true
                 this.$store.dispatch('applyPurchase/loadPurchaseManList', {page: 1, count: 10})
                 this.$store.dispatch('applyPurchase/loadPurchaseManList', {page: 1, count: 10})
               }, error => {
               }, error => {
                 console.log(error)
                 console.log(error)
@@ -234,12 +253,15 @@
         return this.validObj.amount
         return this.validObj.amount
       },
       },
       checkAll: function () {
       checkAll: function () {
-        return this.checkCode() && this.checkBrand() && this.checkUnitPrice() && this.checkAmount() && this.checkDeadline()
+        return this.checkCode() && this.checkBrand() && this.checkDeadline() && this.checkUnitPrice() && this.checkAmount()
       },
       },
       checkDeadline: function () {
       checkDeadline: function () {
-        this.validObj.deadline = this.applyObj.deadline && this.applyObj.deadline !== ''
+        this.validObj.deadline = Boolean(this.applyObj.deadline)
         return this.validObj.deadline
         return this.validObj.deadline
       },
       },
+      setDeadLineValid: function () {
+        this.validObj.deadline = true
+      },
       onUnitPriceInput: function () {
       onUnitPriceInput: function () {
         let price = this.applyObj.unitPrice
         let price = this.applyObj.unitPrice
         if (price >= 10000) {
         if (price >= 10000) {
@@ -272,11 +294,35 @@
         if (this.applyObj.brand && getRealLen(this.applyObj.brand) > 20) {
         if (this.applyObj.brand && getRealLen(this.applyObj.brand) > 20) {
           this.applyObj.brand = this.applyObj.brand.substring(0, this.applyObj.brand.length - 1)
           this.applyObj.brand = this.applyObj.brand.substring(0, this.applyObj.brand.length - 1)
         }
         }
+      },
+      onSuccess: function (data) {
+        window.open('/applyPurchase/' + data.data)
+      },
+      onError: function () {
+        this.$message.error('上传失败')
       }
       }
+//      upload: function (e) {
+//        let file = e.target.files[0]
+//        let param = new FormData()
+//        param.append('file', file, file.name)
+//        let config = {
+//          headers: {'Content-Type': file.type}
+//        }
+//        this.$http.post('/seek/importBom', param, config).then(response => {
+//          if (response.data.success) {
+//            window.open('/applyPurchase/' + response.data.data)
+//          } else {
+//            this.$message.error('上传失败')
+//          }
+//        }, err => {
+//          console.log(err)
+//          this.$message.error('系统错误')
+//        })
+//      }
     }
     }
   }
   }
 </script>
 </script>
-<style lang="scss" scoped>
+<style lang="scss">
   .publish-apply {
   .publish-apply {
     background: url('/images/applyPurchase/banner.png') center center/cover no-repeat;
     background: url('/images/applyPurchase/banner.png') center center/cover no-repeat;
     height: 583px;
     height: 583px;
@@ -361,6 +407,11 @@
                 padding-left: 34px;
                 padding-left: 34px;
               }
               }
             }
             }
+            .el-input {
+              width: 111px;
+              .el-input__inner {
+              }
+            }
             input {
             input {
               width: 111px;
               width: 111px;
               height: 20px;
               height: 20px;
@@ -410,6 +461,28 @@
           font-size: 16px;
           font-size: 16px;
           margin: 20px 0 13px 0;
           margin: 20px 0 13px 0;
         }
         }
+        label {
+          position: relative;
+          /*input {
+            display: none;
+          }*/
+          > div {
+            position: absolute;
+            .el-upload {
+              input {
+                display: none;
+              }
+              .el-upload-dragger {
+                width: 66px;
+                height: 66px;
+                position: absolute;
+                bottom: 17px;
+                right: -66px;
+                opacity: 0;
+              }
+            }
+          }
+        }
         .download-line {
         .download-line {
           cursor: pointer;
           cursor: pointer;
         }
         }

+ 1 - 1
nuxt.config.js

@@ -1,6 +1,6 @@
 const path = require('path')
 const path = require('path')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
-const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://10.10.100.107:8081/platform-b2c/' : 'http://10.1.51.88:8080/platform-b2c/')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://10.10.100.107:8081/platform-b2c/' : 'http://10.1.51.90:8080/platform-b2c/')
 
 
 module.exports = {
 module.exports = {
   router: {
   router: {