shenjj 7 лет назад
Родитель
Сommit
c570da28b5

+ 132 - 48
components/applyPurchase/BatchPublish.vue

@@ -1,6 +1,31 @@
 <template>
   <div class="batch-publish">
-    <p><img src="/images/applyPurchase/batch-icon.png" alt="">共上传<b class="blue-text">{{bomNumber.successImport || 0}}</b>个产品,其中<span class="red-text">{{bomNumber.nullField || 0}}</span>个产品的必填项缺失,请在当前页完善信息</p>
+    <div class="batch-publish-top clearfix">
+      <div class="w50">
+        <img src="/images/applyPurchase/batch-icon.png" alt="">
+        Bom名称:<input type="text" v-model="bomInfo.name" class="text" />
+        共上传<b class="blue-text">{{bomNumber.successImport || 0}}</b>个产品
+        <!--,其中<span class="red-text">{{bomNumber.nullField || 0}}</span>个产品的必填项缺失,请在当前页完善信息-->
+      </div>
+      <div class="w50">
+        采购套数:<input type="text" v-model="bomInfo.count" class="text"/>
+      </div>
+      <div class="w50" style="padding-left: 62px;">
+        规格:<input type="text" v-model="bomInfo.spec" class="text" />
+      </div>
+      <div class="w50">
+        <span style="margin-right: 1px;">*截止时间: </span><el-date-picker
+        v-model="bomInfo.endTime"
+        type="date"
+        :picker-options="pickerOptions"
+        :editable="false"
+        :class="{'error': !bomInfo.flag}"
+        @change="getDate1()"
+        size="mini">
+      </el-date-picker>
+      </div>
+      <a class="modify-btn" @click="submitBOM">确认发布</a>
+    </div>
     <div class="list-wrap" v-if="bomList.content.length">
       <table class="list-content">
         <thead>
@@ -13,9 +38,9 @@
           <!--</th>-->
           <th width="307">品牌/物料名称</th>
           <th width="307">型号/规格</th>
-          <th width="95">采购数量(PCS)</th>
+          <th width="95">单位用量(PCS)</th>
           <!--<th width="114">生产日期</th>-->
-          <th width="136"><i class="red-text">*</i>截止时间</th>
+          <!--<th width="136"><i class="red-text">*</i>截止时间</th>-->
           <th width="186">操作</th>
         </tr>
         </thead>
@@ -93,20 +118,21 @@
               {{item.produceDate || '-'}}
             </div>
           </td>-->
-          <td>
-            <span v-if="item.deadline">{{item.deadline | date}}</span>
-            <span class="red-text" v-if="!item.deadline">请完善信息</span>
-            <div class="red-text remind" v-if="!isValidTime(item.deadline)">默认≤90天</div>
-          </td>
+          <!--<td>-->
+            <!--<span v-if="item.deadline">{{item.deadline | date}}</span>-->
+            <!--<span class="red-text" v-if="!item.deadline">请完善信息</span>-->
+            <!--<div class="red-text remind" v-if="!isValidTime(item.deadline)">默认≤90天</div>-->
+          <!--</td>-->
           <td class="operate">
             <a @click="modifyItem(index)" class="size-s">编辑</a>
             <a @click="deleteItem(index)" class="size-s">删除</a>
+            <!-- -->
             <a @click="setShowSpotGoods(true, item)" class="size-m" v-if="item.spotGoods && item.spotGoods.length && !item.showSpotGoods">商城现货&nbsp;<i class="fa fa-angle-double-down"></i></a>
             <a @click="setShowSpotGoods(false)" class="size-m" v-if="item.spotGoods && item.spotGoods.length && item.showSpotGoods">收起&nbsp;<i class="fa fa-angle-double-up"></i></a>
           </td>
         </tr>
         <tr class="spot-goods" v-if="item.showSpotGoods">
-          <td colspan="5">
+          <td colspan="4">
             <div class="spot-goods-body">
               <div class="spot-goods-title">商城现货({{spotGoodsData.length || 0}})</div>
               <table>
@@ -204,18 +230,18 @@
           <!--<td>
             <input type="text" class="form-control" v-model="modifyObj.produceDate" @input="onProduceDateChange">
           </td>-->
-          <td>
-            <el-date-picker
-              v-model="modifyObj.deadline"
-              type="date"
-              :picker-options="pickerOptions"
-              :editable="false"
-              :class="{'error': !validObj.deadline}"
-              @change="getDate1()"
-              size="mini">
-            </el-date-picker>
+          <!--<td>-->
+            <!--<el-date-picker-->
+              <!--v-model="modifyObj.deadline"-->
+              <!--type="date"-->
+              <!--:picker-options="pickerOptions"-->
+              <!--:editable="false"-->
+              <!--:class="{'error': !validObj.deadline}"-->
+              <!--@change="getDate1()"-->
+              <!--size="mini">-->
+            <!--</el-date-picker>-->
             <!--<input type="text" class="form-control" v-model="modifyObj.deadline">-->
-          </td>
+          <!--</td>-->
           <td class="operate">
             <a class="btn-ok size-s" @click="submitModify(index)">确认</a>
             <a class="btn-cancel size-s" @click="cancelModify(index)">取消</a>
@@ -251,7 +277,7 @@
           amount: '',
           deadline: '',
           kind: '',
-          spec: ''
+          spec: '',
         },
         pickerOptions: {
           disabledDate (time) {
@@ -277,7 +303,8 @@
         showSimilarBrandList: false,
         spotGoodsData: [],
         fragments: [],
-        bomList: {}
+        bomList: {},
+        bomInfo: {}
       }
     },
     components: {
@@ -361,8 +388,10 @@
     },
     methods: {
       getDate1: function () {
-        this.modifyObj.deadline = this.modifyObj.deadline ? this.baseUtils.getFullDay(this.baseUtils.getClearDay(new Date(this.baseUtils.formatDate(new Date(this.modifyObj.deadline), 'yyyy-MM-dd')))) : null
-        this.validObj.deadline = true
+        this.bomInfo.endTime = this.bomInfo.endTime ? this.baseUtils.getFullDay(this.baseUtils.getClearDay(new Date(this.baseUtils.formatDate(new Date(this.bomInfo.endTime), 'yyyy-MM-dd')))) : null
+        this.bomInfo.flag = true
+        // this.modifyObj.deadline = this.modifyObj.deadline ? this.baseUtils.getFullDay(this.baseUtils.getClearDay(new Date(this.baseUtils.formatDate(new Date(this.modifyObj.deadline), 'yyyy-MM-dd')))) : null
+        // this.validObj.deadline = true
       },
       initModifyObj: function () {
         for (let attr in this.modifyObj) {
@@ -403,26 +432,40 @@
 //          str = str.substring(0, str.length - 1)
 //          param.spIds = str
 //        }
-        this.$http.post('/seek/confirmBom?bomId=' + Number(this.$route.params.id))
-          .then(response => {
-            if (response.data.success) {
+        if (!this.bomInfo.count || this.bomInfo.count === '') {
+          this.$message.error('请输入采购套数')
+          return
+        } else if (!this.bomInfo.endTime || this.bomInfo.endTime === '') {
+          this.$message.error('请选择截止时间')
+          return
+        } else if (!this.bomInfo.spec || this.bomInfo.spec === '') {
+          this.$message.error('请输入规格')
+          return
+        }
+        let bom = this.bomInfo
+        this.$http.post('/seek/bom/edit', bom).then(response => {
+          this.$http.post('/seek/confirmBom?bomId=' + Number(this.$route.params.id) + '&endTime=' + this.bomInfo.endTime.getTime() + '&count=' + this.bomInfo.count)
+            .then(response => {
+              if (response.data.success) {
 //              this.showRemindBox = true
 //              this.successResult = response.data.data
 //              this.listenPage(1)
 //              this.$store.dispatch('applyPurchase/loadBOMNumber', {bomId: this.$route.params.id})
-              if (response.data.data.successAmount && response.data.data.successAmount > 0) {
-                this.$router.push('/applyPurchase/result?status=success&count=' + response.data.data.successAmount)
+                if (response.data.data.successAmount && response.data.data.successAmount > 0) {
+                  this.$router.push('/applyPurchase/result?status=success&count=' + response.data.data.successAmount)
+                } else {
+                  this.$router.push('/applyPurchase/result?status=error')
+                }
               } else {
+//              this.$message.error(response.data.message)
                 this.$router.push('/applyPurchase/result?status=error')
               }
-            } else {
-//              this.$message.error(response.data.message)
-              this.$router.push('/applyPurchase/result?status=error')
-            }
-          }, err => {
-            console.log(err)
-            this.$message.error('系统错误')
-          })
+            }, err => {
+              console.log(err)
+              this.$message.error('系统错误')
+            })
+        })
+
       },
       onCheck: function (index) {
         if (typeof index === 'undefined') {
@@ -509,13 +552,14 @@
             })
         } else {
           if (!checkValid) {
-            if (!this.validObj.deadline) {
-              if (!this.isValidDate(this.modifyObj.deadline)) {
-                this.$message.error('截止日期需在90天以内')
-              } else {
-                this.$message.error('截止日期不能为空')
-              }
-            } else if (!this.validObj.amount || !this.validObj.unitPrice) {
+            // if (!this.validObj.deadline) {
+            //   if (!this.isValidDate(this.modifyObj.deadline)) {
+            //     this.$message.error('截止日期需在90天以内')
+            //   } else {
+            //     this.$message.error('截止日期不能为空')
+            //   }
+            // } else
+            if (!this.validObj.amount || !this.validObj.unitPrice) {
               this.$message.error('请输入正确的数值')
             }
           } else {
@@ -602,7 +646,8 @@
         }
       },
       getSingleValidInfo: function (item) {
-        return item.code && item.brand && item.deadline && this.isValidDate(item.deadline)
+      // && item.deadline && this.isValidDate(item.deadline)
+        return item.code && item.brand
       },
       checkCode: function () {
         let code = this.modifyObj.code.trim()
@@ -658,7 +703,10 @@
         return this.validObj.spec
       },
       checkAll: function () {
-        return this.checkBrand() && this.checkCode() && this.checkKind() && this.checkDeadline() && this.checkUnitPrice() && this.checkAmount() && this.checkSpec()
+      // && this.checkSpec()
+      // && this.checkUnitPrice()
+      // && this.checkDeadline()
+        return this.checkBrand() && this.checkCode() && this.checkKind()  && this.checkAmount()
       },
       checkDeadline: function () {
         this.validObj.deadline = this.modifyObj.deadline && this.modifyObj.deadline !== '' && this.isValidDate(this.modifyObj.deadline)
@@ -1064,6 +1112,12 @@
             }
           })
       }
+    },
+    created() {
+      // noDetail
+      this.$http.get('/seek/bom/noDetail?bomId=' + this.$route.params.id).then(res => {
+        this.bomInfo = res.data
+      })
     }
   }
 </script>
@@ -1082,18 +1136,48 @@
       text-overflow: ellipsis;
       white-space: nowrap;
     }
-    > p {
+    div.batch-publish-top {
       margin: 30px 0 0 0;
       font-size: 16px;
-      height: 60px;
+      /*height: 60px;*/
       line-height: 60px;
       background: #f7f9fd;
       padding-left: 24px;
+      position: relative;
+      .modify-btn {
+        position: absolute;
+        right: 20px;
+        top: 40px;
+        font-size: 14px;
+        width: 126px;
+        height: 34px;
+        line-height: 34px;
+        text-align: center;
+        border-radius: 2px;
+        color: #fff;
+        background: #ff8522;
+      }
       > img {
         width: 23px;
         height: 31px;
         margin-right: 12px;
       }
+      .w50 {
+        width: 50%;
+        float: left
+      }
+      input {
+        height: 28px;
+        line-height: 28px;
+        color: #333;
+        border-radius: 5px;
+        font-size: 14px;
+        border: 1px solid #ddd;
+      }
+      input.text {
+        width: 280px;
+        text-indent: 12px;
+      }
     }
     .list-wrap {
       padding: 30px 0 72px 0;

+ 1 - 1
pages/mobile/order/details.vue

@@ -237,7 +237,7 @@
         </div>
         <div class="list-btn clearfix" ref="listBtn" v-show="ShowFixedBtn">
           <template v-if="vendorType === 'buyer'">
-            <div class="sendGoods" v-if="orderList.status === 404" @click="buyerGetGoods(orderList)">确认收货</div>
+            <div class="sendGoods" v-if="orderList.status === 404  || orderList.signReceive" @click="buyerGetGoods(orderList)">确认收货</div>
             <div class="sendGoods" v-if="!orderList.installmentId && (orderList.status === 503 || orderList.status === 501)" @click="gotoPay(orderList)">立即付款</div>
             <div class="sendGoods" @click="onMind('此订单为分期付款,请前往【PC】端进行相关操作')" v-if="orderList.installmentId && (orderList.status === 503 || orderList.status === 504 || orderList.status === 524 ) && orderList.installment.status !== 505 && !orderList.againUpload">立即付款</div>
             <div class="" @click="onMind('此订单为分期付款,请前往【PC】端进行相关操作')" v-if="orderList.installmentId && (orderList.status === 503 || orderList.status === 504 || orderList.status === 524 ) && orderList.installment.status !== 505 && orderList.againUpload">重新上传</div>

+ 1 - 1
pages/mobile/order/index.vue

@@ -116,7 +116,7 @@
         </div>
         <div class="list-btn clearfix">
           <template v-if="vendorType === 'buyer'">
-            <div class="pull-right sendGoods" v-if="item.status === 404" @click="buyerGetGoods(item)">确认收货</div>
+            <div class="pull-right sendGoods" v-if="item.status === 404 || item.signReceive" @click="buyerGetGoods(item)">确认收货</div>
             <div class="pull-right sendGoods" v-if="!item.installmentId && (item.status === 503 || item.status === 501)" @click="gotoPay(item)">立即付款</div>
             <div class="pull-right" @click="lookOrderDetail(item)">订单详情</div>
             <div class="pull-right sendGoods" @click="onMind('此订单为分期付款,请前往【PC】端进行相关操作')" v-if="item.installmentId && (item.status === 503 || item.status === 504 || item.status === 524 ) && item.installment.status !== 505 && !item.againUpload">立即付款</div>