Prechádzať zdrojové kódy

feat: 提醒弹框联调

maliang 1 mesiac pred
rodič
commit
a5f550411c

+ 3 - 0
jshERP-web/src/api/api.js

@@ -3,6 +3,8 @@ import { getAction, deleteAction, putAction, postAction, httpAction } from '@/ap
 //首页统计
 const getBuyAndSaleStatistics = (params) => getAction('/depotHead/getBuyAndSaleStatistics', params)
 const buyOrSalePrice = (params) => getAction('/depotItem/buyOrSalePrice', params)
+const getMaterialWarn = (params) => getAction('/material/getMaterialWarn', params)
+
 //租户管理
 const checkTenant = (params) => getAction('/tenant/checkIsNameExist', params)
 const addTenant = (params) => postAction('/tenant/add', params)
@@ -121,6 +123,7 @@ const findFinancialDetailByNumber = (params) => getAction('/accountHead/getDetai
 export {
   getBuyAndSaleStatistics,
   buyOrSalePrice,
+  getMaterialWarn,
   checkTenant,
   addTenant,
   editTenant,

+ 31 - 2
jshERP-web/src/views/dashboard/Analysis.vue

@@ -8,6 +8,9 @@
 <script>
 import IndexChart from './IndexChart'
 import SysTipModal from './dialog/SysTipModal.vue'
+import { getMaterialWarn } from '@/api/api.js'
+
+let isFirst = true
 export default {
   name: 'Analysis',
   components: {
@@ -15,10 +18,36 @@ export default {
     SysTipModal,
   },
   data() {
-    return {}
+    return {
+      warnData: {}
+    }
+  },
+  created() {
+    if(isFirst){
+      this.getWarnData()
+    }
   },
-  created() {},
   methods: {
+    getWarnData(){
+      isFirst = false
+      const hasArrayData = (val) => {
+        return Array.isArray(val) && val.length > 0
+      }
+      getMaterialWarn().then(res => {
+        const {expirationReminder = [],inventoryReminder = [],noMovingPinReminder = []} = res.data
+        if(hasArrayData(expirationReminder)||hasArrayData(inventoryReminder)||hasArrayData(noMovingPinReminder)){
+          this.$nextTick(() => {
+            this.$refs.sysTipModal.open(
+              {
+                expirationReminder,
+                inventoryReminder,
+                noMovingPinReminder
+              }
+            )
+          })
+        }
+      })
+    },
     openSysTipModal() {
       this.$refs.sysTipModal.open({})
     },

+ 13 - 6
jshERP-web/src/views/dashboard/dialog/SysTipModal.vue

@@ -18,12 +18,14 @@
       <div class="tip-body">
         <div class="tip-content">
           <div class="text-title">无动销提醒</div>
-          <p class="text-val">1.商品名称xxx,在【无动销提醒周期】内,无动销,请及时处理</p>
-          <p class="text-val">1.商品名称xxx,在【无动销提醒周期】内,无动销,请及时处理</p>
+          <p class="text-val" v-for="(item,index) in dataInfo.noMovingPinReminder" :key="index">{{ `${index+1}.${item}` }}</p>
+          <p class="text-val" v-show="dataInfo.noMovingPinReminder.length===0">暂无</p>
           <div class="text-title">过期提醒</div>
-          <p class="text-val">3.商品名称xxx,条码xxx,生产日期xxx,保质期xxx,库存xxx,即将要过期,请及时处理</p>
+          <p class="text-val" v-for="(item,index) in dataInfo.expirationReminder" :key="index">{{ `${index+1}.${item}` }}</p>
+          <p class="text-val" v-show="dataInfo.expirationReminder.length===0">暂无</p>
           <div class="text-title">库存提醒</div>
-          <p class="text-val">4.商品名称xxx,库存告警,请及时处理</p>
+          <p class="text-val" v-for="(item,index) in dataInfo.inventoryReminder" :key="index">{{ `${index+1}.${item}` }}</p>
+          <p class="text-val" v-show="dataInfo.inventoryReminder.length===0">暂无</p>
         </div>
         <div class="btn-wrap">
           <a-button type="primary" @click="handleOk" class="confirm-btn">好的</a-button>
@@ -39,7 +41,11 @@ export default {
     return {
       visible: false,
       confirmLoading: false,
-      dataInfo: {},
+      dataInfo: {
+        expirationReminder: [],
+        inventoryReminder: [],
+        noMovingPinReminder: []
+      },
     }
   },
   methods: {
@@ -103,7 +109,8 @@ export default {
     background-color: rgba(255, 255, 255, 0.8);
   }
   .tip-content {
-    height: 210px;
+    max-height: 300px;
+    overflow: hidden scroll;
   }
   .btn-wrap {
     margin-top: 16px;

+ 4 - 4
jshERP-web/src/views/material/modules/MaterialModal.vue

@@ -223,10 +223,10 @@
                 >
                   <a-tooltip title="无动销提醒周期">
                     <a-select placeholder="无动销提醒周期" v-decorator="['movingPinReminderCycle']">
-                      <a-select-option value="一周">一周</a-select-option>
-                      <a-select-option value="两周">两周</a-select-option>
-                      <a-select-option value="一个月">一个月</a-select-option>
-                      <a-select-option value="一季度">一季度</a-select-option>
+                      <a-select-option value="7">一周</a-select-option>
+                      <a-select-option value="14">两周</a-select-option>
+                      <a-select-option value="30">一个月</a-select-option>
+                      <a-select-option value="90">一季度</a-select-option>
                     </a-select>
                   </a-tooltip>
                 </a-form-item>