lilei 2 năm trước cách đây
mục cha
commit
761483a7ae

+ 2 - 1
src/store/getters.js

@@ -15,7 +15,8 @@ const getters = {
   isNewTab: state => state.app.isNewTab,
   isNewSubTab: state => state.app.isNewSubTab,
   closeTabPages: state => state.app.closeTabPages,
-  loadingStatus: state => state.app.loadingStatus
+  loadingStatus: state => state.app.loadingStatus,
+  employeeList: state => state.app.employeeList
 }
 
 export default getters

+ 15 - 1
src/store/modules/app.js

@@ -1,4 +1,5 @@
 import Vue from 'vue'
+import { employeeQueryList } from '@/api/expenseManagement'
 import {
   SIDEBAR_TYPE,
   DEFAULT_THEME,
@@ -31,6 +32,7 @@ const app = {
     winHeight: 0 ,//  窗口高度
     loadingStatus: false,
     closeTabPages: [], // 已关闭的页面
+    employeeList: [], // 申请人列表
   },
   mutations: {
     SET_SIDEBAR_TYPE: (state, type) => {
@@ -87,6 +89,9 @@ const app = {
     SET_loadingStatus: (state, val) => {
       state.loadingStatus = val
     },
+    SET_employeeList:(state, val) => {
+      state.employeeList = val
+    },
   },
   actions: {
     setSidebar ({ commit }, type) {
@@ -130,7 +135,16 @@ const app = {
     },
     SetWinHeight ({ commit }, val) {
       commit('SET_WIN_HEIGHT', val)
-    }
+    },
+    GetEmployeeList({ commit }, val) {
+      employeeQueryList({}).then(res => {
+        if (res.status == 200) {
+          commit('SET_employeeList', res.data)
+        } else {
+          commit('SET_employeeList', [])
+        }
+      })
+    },
   }
 }
 

+ 3 - 1
src/views/Home.vue

@@ -33,7 +33,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { mapGetters } from 'vuex'
+import { mapGetters, mapActions } from 'vuex'
 import ResetPwd from '@/views/user/ResetPwd.vue'
 import newProduct from '@/views/productManagement/newProduct/modal.vue'
 import { queryNewProductPage } from '@/api/product'
@@ -55,7 +55,9 @@ export default {
   created () {
   },
   methods: {
+    ...mapActions(['GetEmployeeList']),
     hasNewProduct () {
+      this.GetEmployeeList()
       queryNewProductPage({ pageNo: 1, pageSize: 20, onlineFalg: this.onlineFalg }).then(res => {
         if (res.status == 200) {
           if (res.data.count > 0) {

+ 10 - 7
src/views/expenseManagement/expenseReimbursement/employee.js

@@ -57,13 +57,16 @@ const Employee = {
       this.$emit('input', value);
     },
     getList () {
-      employeeQueryList({}).then(res => {
-        if (res.status == 200) {
-          this.list = res.data
-        } else {
-          this.list = []
-        }
-      })
+      this.list = this.$store.state.app.employeeList
+      if(this.list.length==0){
+        employeeQueryList({}).then(res => {
+          if (res.status == 200) {
+            this.list = res.data
+          } else {
+            this.list = []
+          }
+        })
+      }
     },
   },
 };

+ 5 - 1
src/views/financialManagement/financialCollection/baseModal.vue

@@ -17,7 +17,7 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol">
         <a-form-model-item label="申请人" prop="applyPersonSn">
-          <employee style="width: 100%;" @change="employeeChange" id="fc-Employee" v-model="form.applyPersonSn"></employee>
+          <employee style="width: 100%;" @change="employeeChange" ref="applyPerson" v-model="form.applyPersonSn"></employee>
         </a-form-model-item>
         <a-form-model-item label="收款事由" prop="bookReason">
           <a-input :maxLength="100" placeholder="请输入收款事由(最多100个字符)" v-model="form.bookReason"></a-input>
@@ -148,6 +148,10 @@ export default {
           this.form.attachmentList = ''
           this.attachList = res.data.attachmentList
           this.$refs.attachList.setFileList(this.attachList)
+          // 回显客户
+          // if (this.form.applyPersonSn) {
+          //   this.$refs.applyPerson.getDetail(this.form.applyPersonSn)
+          // }
         } else {
           this.$refs.ruleForm.resetFields()
         }