Browse Source

前端: 合同待评价提示优化

baichengfei 4 years ago
parent
commit
49a1e774a1

+ 6 - 0
src/dashoo.cn/frontend_web/src/api/oilcontract/contract.js

@@ -226,6 +226,12 @@ export default {
       url: `/contract/countMoney/${id}`,
       method: 'get'
     })
+  },
+  getNeedEvaList (myAxios) {
+    return myAxios({
+      url: '/contract/need-eva-list',
+      method: 'get'
+    })
   }
 
 }

+ 24 - 14
src/dashoo.cn/frontend_web/src/pages/index.vue

@@ -421,6 +421,7 @@
 
 <script>
   import api from '@/api/oilsupplier/supplier'
+  import contractApi from '@/api/oilcontract/contract'
 
   import {
     mapGetters
@@ -586,22 +587,31 @@
         }
         _this.$axios.get('paramset/get-param-by-cate', { params })
           .then(res => {
-            console.log('配置的是否评价', res)
             if (res.data === 'true') {
-              let contractNum = 20
-              this.$confirm('您有 ' + contractNum + ' 份合同待评价,请前往评价!', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning',
-                showCancelButton: false,
-                showConfirmButton: false,
-                center: true
-              }).then(() => {
-                console.log('不能点到的')
-              }).catch(() => {
-                if (process.client) {
-                  window.localStorage.setItem('firstContractInfoParams', '2') // 初次登录弹框
+              let contractNum = 0
+              contractApi.getNeedEvaList(this.$axios).then(res => {
+                if (res.status === 200) {
+                  contractNum = res.data.currentItemCount
+                  this.$confirm('您有 ' + contractNum + ' 份合同评价待处理,请及时评价!', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning',
+                    showCancelButton: false,
+                    showConfirmButton: false,
+                    center: true
+                  }).then(() => {
+                    console.log('')
+                  }).catch(() => {
+                    if (process.client) {
+                      window.localStorage.setItem('firstContractInfoParams', '2') // 初次登录弹框
+                    }
+                  })
+                  if (process.client) {
+                    window.localStorage.setItem('firstContractInfoParams', '2') // 初次登录弹框
+                  }
                 }
+              }).catch(err => {
+                console.log(err)
               })
             }
           })