Browse Source

求购验收修改

yangc 8 years ago
parent
commit
38363c1623

+ 1 - 1
components/applyPurchase/ApplyInfo.vue

@@ -43,7 +43,7 @@
           <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">
             <a>联系买家</a>
-            <a @click="sayPrice(purchaseMan)">我要报价</a>
+            <a @click="sayPrice(purchaseMan)" v-text="purchaseMan.isOffer ? '已报价' : '我要报价'"></a>
           </span>
           <div class="expand-content">
             <div>

+ 10 - 1
components/applyPurchase/PublishApply.vue

@@ -184,7 +184,16 @@
                 this.$message.error('发布失败')
               })
           } else {
-            this.$message.error('请填写正确的信息')
+            if (!this.validObj.code) {
+              this.$message.error('型号不能为空')
+            } else if (!this.validObj.brand) {
+              this.$message.error('品牌不能为空')
+            } else if (!this.validObj.deadline) {
+              this.$message.error('截止日期不能为空')
+            } else if (!this.validObj.amount || !this.validObj.unitPrice) {
+              this.$message.error('请输入正确的数值')
+            }
+//            this.$message.error('请填写正确的信息')
           }
         } else {
           this.$router.push('/auth/login?returnUrl=' + window.location.href)

+ 1 - 1
nuxt.config.js

@@ -1,6 +1,6 @@
 const path = require('path')
 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://192.168.253.123:8080/platform-b2c/')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://10.10.100.107:8081/platform-b2c/' : 'http://192.168.253.158:8080/platform-b2c/')
 
 module.exports = {
   router: {

+ 29 - 3
store/applyPurchase.js

@@ -1,15 +1,41 @@
 import axios from '~plugins/axios'
 
+let findStoreInfoFromUuid = function ({ commit }, params = {}) {
+  let str = ''
+  let list = params.list
+  for (let i = 0; i < list.content.length; i++) {
+    str += list.content[i].id
+    str += i !== list.content.length - 1 ? ',' : ''
+  }
+  return axios.get('/seek/offer/getSeekPurchaseOfferList', {params: {spIds: str}}).then(response => {
+    for (let i = 0; i < list.content.length; i++) {
+      if (response.data.length) {
+        for (let j = 0; j < response.data.length; j++) {
+          list.content[i].isOffer = list.content[i].id === response.data[j].spId
+        }
+      } else {
+        list.content[i].isOffer = false
+      }
+    }
+    commit('purchaseManList/GET_PURCHASEMAN_SUCCESS', list)
+  }, err => {
+    commit('purchaseManList/GET_PURCHASEMAN_FAILURE', err)
+  })
+}
+
 export const actions = {
 // 采购商列表
   loadPurchaseManList ({ commit }, params = {}) {
     commit('purchaseManList/REQUEST_PURCHASEMAN')
     return axios.get('/seek/getSeekPageInfo', {params})
       .then(response => {
-        for (let i = 0; i < response.data.content.length; i++) {
-          response.data.content[i].active = false
+        let list = response.data
+        for (let i = 0; i < list.content.length; i++) {
+          list.content[i].active = false
         }
-        commit('purchaseManList/GET_PURCHASEMAN_SUCCESS', response.data)
+        return Promise.all([
+          findStoreInfoFromUuid({ commit }, {list: list})
+        ])
       }, err => {
         commit('purchaseManList/GET_PURCHASEMAN_FAILURE', err)
       })